protected function private_core()
 {
     $this->share_extension();
     /// cargamos la configuración de servicios
     $fsvar = new fs_var();
     $this->setup = $fsvar->array_get(array('servicios_diasfin' => 10, 'servicios_material' => 0, 'servicios_mostrar_material' => 0, 'servicios_material_estado' => 0, 'servicios_mostrar_material_estado' => 0, 'servicios_accesorios' => 0, 'servicios_mostrar_accesorios' => 0, 'servicios_descripcion' => 0, 'servicios_mostrar_descripcion' => 0, 'servicios_solucion' => 0, 'servicios_mostrar_solucion' => 0, 'servicios_fechafin' => 0, 'servicios_mostrar_fechafin' => 0, 'servicios_fechainicio' => 0, 'servicios_mostrar_fechainicio' => 0, 'servicios_mostrar_garantia' => 0, 'servicios_garantia' => 0, 'servicios_condiciones' => "Condiciones del deposito:\nLos presupuestos realizados tienen una" . " validez de 15 días.\nUna vez avisado al cliente para que recoja el producto este dispondrá" . " de un plazo máximo de 2 meses para recogerlo, de no ser así y no haber aviso por parte del" . " cliente se empezará a cobrar 1 euro al día por gastos de almacenaje.\nLos accesorios y" . " productos externos al equipo no especificados en este documento no podrán ser reclamados en" . " caso de disconformidad con el técnico.", 'st_servicio' => "Servicio", 'st_servicios' => "Servicios", 'st_material' => "Material", 'st_material_estado' => "Estado del material entregado", 'st_accesorios' => "Accesorios que entrega", 'st_descripcion' => "Descripción de la averia", 'st_solucion' => "Solución", 'st_fechainicio' => "Fecha de Inicio", 'st_fechafin' => "Fecha de finalización", 'st_garantía' => "Garantía"), FALSE);
     /// cargamos el servicios
     $this->servicio = FALSE;
     if (isset($_GET['id'])) {
         $serv0 = new servicio_cliente();
         $this->servicio = $serv0->get($_GET['id']);
     }
     $term0 = new terminal_caja();
     $this->terminales = $term0->all();
     $this->terminal = FALSE;
     if (isset($_GET['terminal'])) {
         $this->terminal = $term0->get($_GET['terminal']);
     }
     if ($this->servicio and $this->terminal) {
         $cli0 = new cliente();
         $this->cliente = $cli0->get($this->servicio->codcliente);
         $numt = $this->terminal->num_tickets;
         while ($numt > 0) {
             $this->imprimir();
             $this->terminal->save();
             $numt--;
         }
     }
 }
Ejemplo n.º 2
0
 protected function private_core()
 {
     /// ¿El usuario tiene permiso para eliminar en esta página?
     $this->allow_delete = $this->user->allow_delete_on(__CLASS__);
     $this->almacen = new almacen();
     $this->caja = new caja();
     $this->serie = new serie();
     $this->terminal = new terminal_caja();
     $this->ncf_rango = new ncf_rango();
     $terminal = new terminal_caja();
     if (isset($_POST['nuevot'])) {
         $terminal->codalmacen = $_POST['codalmacen'];
         $terminal->codserie = $_POST['codserie'];
         $terminal->area_impresion = $_POST['area_impresion'];
         $terminal->codcliente = NULL;
         if ($_POST['codcliente'] != '') {
             $terminal->codcliente = $_POST['codcliente'];
         }
         $terminal->anchopapel = intval($_POST['anchopapel']);
         $terminal->comandoapertura = $_POST['comandoapertura'];
         $terminal->comandocorte = $_POST['comandocorte'];
         $terminal->num_tickets = intval($_POST['num_tickets']);
         $terminal->sin_comandos = isset($_POST['sin_comandos']);
         if ($terminal->save()) {
             $this->new_message('Terminal añadido correctamente.');
             header('Location: index.php?page=tpv_recambios');
         } else {
             $this->new_error_msg('Error al guardar los datos.');
         }
     } else {
         if (isset($_POST['idt'])) {
             $t2 = $terminal->get($_POST['idt']);
             if ($t2) {
                 $t2->codalmacen = $_POST['codalmacen'];
                 $t2->codserie = $_POST['codserie'];
                 $t2->area_impresion = $_POST['area_impresion'];
                 $t2->codcliente = NULL;
                 if ($_POST['codcliente'] != '') {
                     $t2->codcliente = $_POST['codcliente'];
                 }
                 $t2->anchopapel = intval($_POST['anchopapel']);
                 $t2->comandoapertura = $_POST['comandoapertura'];
                 $t2->comandocorte = $_POST['comandocorte'];
                 $t2->num_tickets = intval($_POST['num_tickets']);
                 $t2->sin_comandos = isset($_POST['sin_comandos']);
                 if ($t2->save()) {
                     $this->new_message('Datos guardados correctamente.');
                 } else {
                     $this->new_error_msg('Error al guardar los datos.');
                 }
             } else {
                 $this->new_error_msg('Terminal no encontrado.');
             }
         } else {
             if (isset($_GET['deletet'])) {
                 if ($this->user->admin) {
                     $t2 = $terminal->get($_GET['deletet']);
                     if ($t2) {
                         if ($t2->delete()) {
                             $this->new_message('Terminal eliminado correctamente.');
                         } else {
                             $this->new_error_msg('Error al eliminar el terminal.');
                         }
                     } else {
                         $this->new_error_msg('Terminal no encontrado.');
                     }
                 } else {
                     $this->new_error_msg("Tienes que ser administrador para poder eliminar terminales.");
                 }
             } else {
                 if (isset($_GET['delete'])) {
                     if ($this->user->admin) {
                         $caja2 = $this->caja->get($_GET['delete']);
                         if ($caja2) {
                             if ($caja2->delete()) {
                                 $this->new_message("Arqueo eliminado correctamente.");
                             } else {
                                 $this->new_error_msg("¡Imposible eliminar el arqueo!");
                             }
                         } else {
                             $this->new_error_msg("Arqueo no encontrado.");
                         }
                     } else {
                         $this->new_error_msg("Tienes que ser administrador para poder eliminar arqueos.");
                     }
                 } else {
                     if (isset($_GET['cerrar'])) {
                         if ($this->user->admin) {
                             $caja2 = $this->caja->get($_GET['cerrar']);
                             if ($caja2) {
                                 $caja2->fecha_fin = Date('d-m-Y H:i:s');
                                 if ($caja2->save()) {
                                     $this->new_message("Arqueo cerrado correctamente.");
                                 } else {
                                     $this->new_error_msg("¡Imposible cerrar el arqueo!");
                                 }
                             } else {
                                 $this->new_error_msg("Arqueo no encontrado.");
                             }
                         } else {
                             $this->new_error_msg("Tienes que ser administrador para poder cerrar arqueos.");
                         }
                     }
                 }
             }
         }
     }
     $this->offset = 0;
     if (isset($_GET['offset'])) {
         $this->offset = intval($_GET['offset']);
     }
     $this->resultados = $this->caja->all($this->offset);
     $this->terminales = $terminal->all();
 }
Ejemplo n.º 3
0
 public function indexAction()
 {
     $terminal = new terminal_caja();
     $this->template = 'tpv_caja';
     $this->offset = 0;
     if (isset($_GET['offset'])) {
         $this->offset = intval($_GET['offset']);
     }
     $this->resultados = $this->caja->all($this->offset);
     $this->terminales = $terminal->all();
 }