public function generate()
 {
     $client = WsfeClient::generateSoapClient();
     $ta = new TA();
     $token = $ta->getToken();
     $sign = $ta->getSign();
     try {
         $ultimoNro = WsfeClient::UltNro($client, $token, $sign);
     } catch (WsfeException $e) {
         if ($e->getCode() == "1000") {
             $ta->actualizate();
             $token = $ta->getToken();
             $sign = $ta->getSign();
             $ultimoNro = WsfeClient::UltNro($client, $token, $sign);
         }
     }
     $ultimoCbt = WsfeClient::RecuperaLastCMP($client, $token, $sign, $this->getPuntoVenta()->getCode(), $this->getTipoComprobante()->getCode());
     $comprobanteAutorizado = WsfeClient::Aut($client, $token, $sign, $ultimoNro + 1, $ultimoCbt + 1, $this);
     $this->setNroComprobante($comprobanteAutorizado->getNroComprobante());
     $this->setFechaCae($comprobanteAutorizado->getFechaCae());
     $this->setReproceso($comprobanteAutorizado->getReproceso());
     $this->setMotivo($comprobanteAutorizado->getMotivo());
     $this->setCae($comprobanteAutorizado->getCae());
     $this->setResultado($comprobanteAutorizado->getResultado());
     $this->setMotivo($comprobanteAutorizado->getMotivo());
     $this->setFechaVtoCae($comprobanteAutorizado->getFechaVtoCae());
 }
Esempio n. 2
0
     $result = $student1->getPermanentTimeTable();
     break;
 case "getStudentpreviousCourse":
     //@session_start();
     $student1 = new Student($_SESSION['USERID']);
     //echo($_SESSION['USERID'])
     $courses = $student1->getPreviousCourses($_POST["year"], $_POST["sem"]);
     $result["courses"] = $courses;
     //$result["year"] = $_POST["year"];
     break;
 case "checkIfTa":
     $student1 = new Student($_SESSION['USERID']);
     $result = $student1->checkIfTa();
     break;
 case "getTACurrentCourses":
     $ta1 = new TA($_SESSION['USERID']);
     $result = $ta1->get_course_of_ta();
     break;
     /****End of Student Profile APIs*****/
     /****Faculty Profile APIs*****/
 /****End of Student Profile APIs*****/
 /****Faculty Profile APIs*****/
 case "getFacultypreviousCourse":
     //@session_start();
     $faculty1 = new Faculty($_SESSION['USERID']);
     //echo($_SESSION['USERID'])
     $courses = $faculty1->getPreviousCourses($_POST["year"], $_POST["sem"]);
     $result["courses"] = $courses;
     //$result["year"] = $_POST["year"];
     break;
 case "getFacultyCurrentCourses":