protected function private_core()
 {
     //cargamos configuración de servicios
     $fsvar = new fs_var();
     $this->servicios_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."), FALSE);
     /*Cargamos traduccion*/
     $this->st = $fsvar->array_get(array('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"), FALSE);
     $this->cliente = FALSE;
     $this->impuesto = new impuesto();
     $this->servicio = FALSE;
     /// obtenemos los datos de configuración de impresión
     $this->impresion = array('print_ref' => '1', 'print_dto' => '1', 'print_alb' => '0');
     $fsvar = new fs_var();
     $this->impresion = $fsvar->array_get($this->impresion, FALSE);
     if (isset($_REQUEST['id'])) {
         $serv = new servicio_cliente();
         $this->servicio = $serv->get($_REQUEST['id']);
         if ($this->servicio) {
             $cliente = new cliente();
             $this->cliente = $cliente->get($this->servicio->codcliente);
         }
         if (isset($_POST['email'])) {
             $this->enviar_email('servicio');
         } else {
             $this->generar_pdf_servicio();
         }
     }
     $this->share_extensions();
 }
 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--;
         }
     }
 }
Example #3
0
 protected function private_core()
 {
     $this->provsms = new proveedor_sms();
     $this->documento = FALSE;
     $this->telefono = '';
     $this->mensaje = '';
     $this->documento_url = $this->url();
     $cliente = new cliente();
     $servicio = FALSE;
     if (isset($_REQUEST['servicio'])) {
         $serv = new servicio_cliente();
         $servicio = $serv->get($_REQUEST['id']);
         if ($servicio) {
             $this->cliente = $cliente->get($servicio->codcliente);
             $this->id = $servicio->idservicio;
             $this->documento = 'servicio';
             $this->documento_url = $servicio->url();
         }
     } else {
         if (isset($_REQUEST['pedido'])) {
             $ped = new pedido_cliente();
             $pedido = $ped->get($_REQUEST['id']);
             if ($pedido) {
                 $this->cliente = $cliente->get($pedido->codcliente);
                 $this->id = $pedido->idpedido;
                 $this->documento = 'pedido';
                 $this->documento_url = $pedido->url();
             }
         }
     }
     if (isset($_POST['enviar'])) {
         $this->provsms = FALSE;
         $provsms = new proveedor_sms();
         $this->provsms = $provsms->get($_POST['proveedor']);
         if ($this->provsms) {
             if (!($this->telefono = $_POST['telefono'] == '+34')) {
                 $this->telefono = $_POST['telefono'];
                 $this->mensaje = $_POST['mensaje'];
                 if (strpos($this->provsms->url, 'freevoipdeal')) {
                     if ($this->sms_freevoipdeal()) {
                         $this->new_message('Mensaje desde Freevoipdeal enviado');
                         if ($servicio) {
                             $this->agrega_detalle($servicio);
                         } else {
                             if ($pedido) {
                                 $this->pedido_observaciones();
                             }
                         }
                     } else {
                         $this->new_error_msg('Error al enviar el mensaje');
                     }
                 } else {
                     if (strpos($this->provsms->url, 'clickatell')) {
                         if ($this->sms_clickatell()) {
                             $this->new_message('Mensaje desde Clickatell enviado');
                             if ($servicio) {
                                 $this->agrega_detalle($servicio);
                             }
                         } else {
                             $this->new_error_msg('Error al enviar el mensaje');
                         }
                     }
                 }
             } else {
                 $this->new_error_msg('No has introducido ningún número.');
             }
         } else {
             $this->new_error_msg('Proveedor de SMS no encontrado.');
         }
     }
 }
Example #4
0
 private function delete_servicio()
 {
     $serv = new servicio_cliente();
     $serv1 = $serv->get($_POST['delete']);
     if ($serv1) {
         if ($serv1->delete()) {
             $this->new_message(ucfirst(FS_SERVICIO) . ' ' . $serv1->codigo . " borrado correctamente.");
         } else {
             $this->new_error_msg("¡Imposible borrar el " . FS_SERVICIO . "!");
         }
     } else {
         $this->new_error_msg("¡" . ucfirst(FS_SERVICIO) . " no encontrado!");
     }
 }
 public function show_nombrecliente()
 {
     $nombre = 'desconocido';
     $encontrado = FALSE;
     foreach (self::$servicios as $s) {
         if ($s->idservicio == $this->idservicio) {
             $nombre = $s->nombrecliente;
             $encontrado = TRUE;
             break;
         }
     }
     if (!$encontrado) {
         $sre = new servicio_cliente();
         self::$servicios[] = $sre->get($this->idservicio);
         $nombre = self::$servicios[count(self::$servicios) - 1]->nombrecliente;
     }
     return $nombre;
 }
Example #6
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->ppage = $this->page->get('ventas_servicios');
     $this->agente = FALSE;
     $this->estado = new estados_servicios();
     $servicio = new servicio_cliente();
     $this->servicio = FALSE;
     $this->cliente = new cliente();
     $this->cliente_s = FALSE;
     $this->divisa = new divisa();
     $this->ejercicio = new ejercicio();
     $this->familia = new familia();
     $this->forma_pago = new forma_pago();
     $this->impuesto = new impuesto();
     $this->nuevo_servicio_url = FALSE;
     $this->nueva_marca_url = FALSE;
     $this->nuevo_modelo_url = FALSE;
     $this->nuevo_tipo_url = FALSE;
     $this->pais = new pais();
     $this->serie = new serie();
     $this->fabricante = new fabricante();
     $this->marca = new marca();
     $this->modelo = new modelo();
     $this->tipo = new tipo();
     //cargamos configuración de servicios
     $fsvar = new fs_var();
     $this->servicios_setup = $fsvar->array_get(array('servicios_diasfin' => 10, 'servicios_material' => 0, 'servicios_mostrar_material' => 0, 'servicios_material_estado' => 0, 'servicios_mostrar_marca' => 0, 'servicios_marca' => 0, 'servicios_mostrar_modelo' => 0, 'servicios_modelo' => 0, 'servicios_mostrar_tipo' => 0, 'servicios_tipo' => 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), FALSE);
     /*Cargamos traduccion*/
     $this->st = $fsvar->array_get(array('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_marca' => "Marca del aparato", 'st_modelo' => "Modelo del aparato", 'st_tipo' => "Tipo de aparato"), FALSE);
     /**
      * Comprobamos si el usuario tiene acceso a nueva_venta,
      * necesario para poder añadir líneas.
      */
     if (isset($_GET['delete_detalle'])) {
         $det0 = new detalle_servicio();
         $detalle = $det0->get($_GET['delete_detalle']);
         if ($detalle) {
             if ($detalle->delete()) {
                 $this->new_message('Detalle eliminado correctamente.');
             } else {
                 $this->new_error_msg('Error al eliminar el detalle.');
             }
         } else {
             $this->new_error_msg('Detalle no encontrado.');
         }
     }
     if ($this->user->have_access_to('nueva_venta', FALSE)) {
         $nuevopedp = $this->page->get('nueva_venta');
         if ($nuevopedp) {
             $this->nuevo_servicio_url = $nuevopedp->url();
         }
         $this->nueva_marca_url = $this->marca->url();
         $this->nuevo_modelo_url = $this->modelo->url();
         $this->nuevo_tipo_url = $this->tipo->url();
     }
     if (isset($_POST['idservicio'])) {
         $this->servicio = $servicio->get($_POST['idservicio']);
         $this->modificar();
     } else {
         if (isset($_GET['id'])) {
             $this->servicio = $servicio->get($_GET['id']);
         }
     }
     if ($this->servicio) {
         $this->page->title = $this->servicio->codigo;
         if (isset($_POST['detalle'])) {
             $this->agrega_detalle();
         }
         /// cargamos el agente
         if (!is_null($this->servicio->codagente)) {
             $agente = new agente();
             $this->agente = $agente->get($this->servicio->codagente);
         }
         /// cargamos el cliente
         $this->cliente_s = $this->cliente->get($this->servicio->codcliente);
         $this->marca_s = $this->marca->get($this->servicio->codmarca);
         $this->modelo_s = $this->modelo->get($this->servicio->codmodelo);
         $this->tipo_s = $this->tipo->get($this->servicio->codtipo);
     } else {
         $this->new_error_msg("¡" . ucfirst(FS_SERVICIO) . " de cliente no encontrado!");
     }
 }
Example #7
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->ppage = $this->page->get('ventas_servicios');
     $this->agente = new agente();
     $this->cliente = new cliente();
     $this->cliente_s = FALSE;
     $this->divisa = new divisa();
     $this->ejercicio = new ejercicio();
     $this->estado = new estado_servicio();
     $this->fabricante = new fabricante();
     $this->familia = new familia();
     $this->forma_pago = new forma_pago();
     $this->impuesto = new impuesto();
     $this->pais = new pais();
     $this->serie = new serie();
     /// 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, 'cal_inicio' => "09:00", 'cal_fin' => "20:00", 'cal_intervalo' => "30", 'servicios_linea' => 0, 'servicios_linea1' => 0, 'servicios_material_linea' => 0, 'servicios_material_estado_linea' => 0, 'servicios_accesorios_linea' => 0, 'servicios_descripcion_linea' => 0, 'servicios_solucion_linea' => 0, 'servicios_fechainicio_linea' => 0, 'servicios_fechafin_linea' => 0, 'servicios_garantia_linea' => 0, '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_garantia' => "Garantía"), FALSE);
     /**
      * Comprobamos si el usuario tiene acceso a nueva_venta,
      * necesario para poder añadir líneas.
      */
     $this->nuevo_servicio_url = FALSE;
     if ($this->user->have_access_to('nueva_venta', FALSE)) {
         $nuevopedp = $this->page->get('nueva_venta');
         if ($nuevopedp) {
             $this->nuevo_servicio_url = $nuevopedp->url();
         }
     }
     $this->servicio = FALSE;
     $servicio = new servicio_cliente();
     if (isset($_POST['idservicio'])) {
         $this->servicio = $servicio->get($_POST['idservicio']);
         $this->modificar();
     } else {
         if (isset($_GET['id'])) {
             $this->servicio = $servicio->get($_GET['id']);
         }
     }
     if ($this->servicio) {
         $this->page->title = $this->servicio->codigo;
         /// cargamos el agente
         if ($this->servicio->codagente) {
             $age0 = new agente();
             $this->agente = $age0->get($this->servicio->codagente);
             if (!$this->agente) {
                 $this->agente = new agente();
             }
         } else {
             $this->agente = $this->user->get_agente();
         }
         /// cargamos el cliente
         $this->cliente_s = $this->cliente->get($this->servicio->codcliente);
         $this->modificar_detalles();
     } else {
         $this->new_error_msg("¡" . ucfirst(FS_SERVICIO) . " de cliente no encontrado!");
     }
 }