@@ -62,13 +62,13 @@ |
||
62 | 62 | { |
63 | 63 | |
64 | 64 | $this->addView('ListNCFTipoPago-1', 'NCFTipoPago', 'sales', 'fas fa-store'); |
65 | - $this->addSearchFields('ListNCFTipoPago-1', ['tipopago','codigo','descripcion']); |
|
65 | + $this->addSearchFields('ListNCFTipoPago-1', ['tipopago', 'codigo', 'descripcion']); |
|
66 | 66 | $this->addOrderBy('ListNCFTipoPago-1', ['codigo'], 'code'); |
67 | 67 | $this->addOrderBy('ListNCFTipoPago-1', ['descripcion'], 'description'); |
68 | 68 | $this->addRestoreButton('ListNCFTipoPago-1'); |
69 | 69 | |
70 | 70 | $this->addView('ListNCFTipoPago-2', 'NCFTipoPago', 'purchases', 'fas fa-credit-card'); |
71 | - $this->addSearchFields('ListNCFTipoPago-2', ['tipopago','codigo','descripcion']); |
|
71 | + $this->addSearchFields('ListNCFTipoPago-2', ['tipopago', 'codigo', 'descripcion']); |
|
72 | 72 | $this->addOrderBy('ListNCFTipoPago-2', ['codigo'], 'code'); |
73 | 73 | $this->addOrderBy('ListNCFTipoPago-2', ['descripcion'], 'description'); |
74 | 74 | $this->addRestoreButton('ListNCFTipoPago-2'); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | self::$i18n = new Translator(); |
79 | 79 | } |
80 | 80 | |
81 | - if(self::$type_operation === 'sales') { |
|
81 | + if (self::$type_operation === 'sales') { |
|
82 | 82 | return [ |
83 | 83 | self::TYPE_OPERATION_DOCUMENT_SALES_IPO => self::$i18n->trans('ncf-sales-income-type-ipo'), |
84 | 84 | self::TYPE_OPERATION_DOCUMENT_SALES_IF => self::$i18n->trans('ncf-sales-income-type-if'), |
@@ -111,6 +111,6 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public static function defaultValue() |
113 | 113 | { |
114 | - return (self::$type_operation === 'sales')?self::TYPE_OPERATION_DOCUMENT_SALES_IPO:self::TYPE_OPERATION_DOCUMENT_PURCHASES_GP; |
|
114 | + return (self::$type_operation === 'sales') ?self::TYPE_OPERATION_DOCUMENT_SALES_IPO : self::TYPE_OPERATION_DOCUMENT_PURCHASES_GP; |
|
115 | 115 | } |
116 | 116 | } |
@@ -58,11 +58,11 @@ |
||
58 | 58 | { |
59 | 59 | $customValues = []; |
60 | 60 | $customValues[] = ['value'=>'', 'title'=>'-----------']; |
61 | - foreach(\range('A', 'Z') as $i){ |
|
61 | + foreach (\range('A', 'Z') as $i) { |
|
62 | 62 | $customValues[] = ['value'=>$i, 'title'=>$i]; |
63 | 63 | } |
64 | 64 | $columnToModify = $this->views[$viewName]->columnForName('serie'); |
65 | - if($columnToModify) { |
|
65 | + if ($columnToModify) { |
|
66 | 66 | $columnToModify->widget->setValuesFromArray($customValues); |
67 | 67 | } |
68 | 68 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | { |
47 | 47 | $this->addView('ListNCFRango', 'NCFRango'); |
48 | 48 | $this->addSearchFields('ListNCFRango', ['tipocomprobante']); |
49 | - $this->addOrderBy('ListNCFRango', ['tipocomprobante','correlativo'], 'tipocomprobante'); |
|
49 | + $this->addOrderBy('ListNCFRango', ['tipocomprobante', 'correlativo'], 'tipocomprobante'); |
|
50 | 50 | |
51 | 51 | $this->setSettings('ListNCFRango', 'modalInsert', 'ncf-rango-insert'); |
52 | 52 | $this->setCustomWidgetValues('ListNCFRango'); |
@@ -56,11 +56,11 @@ discard block |
||
56 | 56 | { |
57 | 57 | $customValues = []; |
58 | 58 | $customValues[] = ['value'=>'', 'title'=>'-----------']; |
59 | - foreach(\range('A', 'Z') as $i){ |
|
59 | + foreach (\range('A', 'Z') as $i) { |
|
60 | 60 | $customValues[] = ['value'=>$i, 'title'=>$i]; |
61 | 61 | } |
62 | 62 | $columnToModify = $this->views[$viewName]->columnModalForName('serie_nueva'); |
63 | - if($columnToModify) { |
|
63 | + if ($columnToModify) { |
|
64 | 64 | $columnToModify->widget->setValuesFromArray($customValues); |
65 | 65 | } |
66 | 66 | } |
@@ -74,11 +74,11 @@ discard block |
||
74 | 74 | $valueUsuarioCreacion = $this->request->request->get('usuariocreacion'); |
75 | 75 | $valueFechaCreacion = $this->request->request->get('fechacreacion'); |
76 | 76 | $data = $this->request->request->all(); |
77 | - $data['serie']=(isset($valueSerie) and $valueSerie !=='')?$valueSerie:$data['serie']; |
|
78 | - $data['idempresa']=(isset($valueIdEmpresa) and $valueIdEmpresa !=='')?$valueIdEmpresa:$this->empresa->idempresa; |
|
79 | - $data['usuariomodificacion']=(isset($valueFechaCreacion) and $valueFechaCreacion !=='')?$this->user->nick:null; |
|
80 | - $data['usuariocreacion']=(isset($valueUsuarioCreacion) and $valueUsuarioCreacion !=='')?$valueUsuarioCreacion:$this->user->nick; |
|
81 | - $data['fechacreacion']=(isset($valueFechaCreacion) and $valueFechaCreacion !=='')?$valueFechaCreacion:\date('Y-m-d'); |
|
77 | + $data['serie'] = (isset($valueSerie) and $valueSerie !== '') ? $valueSerie : $data['serie']; |
|
78 | + $data['idempresa'] = (isset($valueIdEmpresa) and $valueIdEmpresa !== '') ? $valueIdEmpresa : $this->empresa->idempresa; |
|
79 | + $data['usuariomodificacion'] = (isset($valueFechaCreacion) and $valueFechaCreacion !== '') ? $this->user->nick : null; |
|
80 | + $data['usuariocreacion'] = (isset($valueUsuarioCreacion) and $valueUsuarioCreacion !== '') ? $valueUsuarioCreacion : $this->user->nick; |
|
81 | + $data['fechacreacion'] = (isset($valueFechaCreacion) and $valueFechaCreacion !== '') ? $valueFechaCreacion : \date('Y-m-d'); |
|
82 | 82 | $rangoNuevo = new NCFRango(); |
83 | 83 | $rangoNuevo->loadFromData($data); |
84 | 84 | $rangoNuevo->save(); |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | |
174 | 174 | protected function saveUpdate(array $values = array()) |
175 | 175 | { |
176 | - if($this->id and isset($this->usuariomodificacion_view)) { |
|
176 | + if ($this->id and isset($this->usuariomodificacion_view)) { |
|
177 | 177 | $this->fechamodificacion = \date('d-m-Y'); |
178 | 178 | $this->usuariomodificacion = $this->usuariomodificacion_view; |
179 | 179 | } |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | . $idempresa |
190 | 190 | . ' AND tipocomprobante = ' |
191 | 191 | . $dataBase->var2str($tipocomprobante) |
192 | - . ' AND estado = ' . $dataBase->var2str(TRUE) |
|
192 | + . ' AND estado = '.$dataBase->var2str(TRUE) |
|
193 | 193 | . ';'; |
194 | 194 | $data = $dataBase->select($sql); |
195 | 195 | return new NCFRango($data[0]); |
@@ -77,13 +77,13 @@ |
||
77 | 77 | parent::install(); |
78 | 78 | return "INSERT INTO rd_ncftipoanulacion (codigo, descripcion, estado) VALUES " . |
79 | 79 | "('01','Deterioro de Factura Pre-Imprensa',true), " . |
80 | - "('02','Errores de Impresión (Factura Pre-Impresa)',true), " . |
|
81 | - "('03','Impresión defectuosa',true), " . |
|
82 | - "('04','Duplicidad de Factura',true), " . |
|
83 | - "('05','Corrección de la Información',true), " . |
|
84 | - "('06','Cambio de Productos',true), " . |
|
85 | - "('07','Devolución de Productos',true), " . |
|
86 | - "('08','Omisión de Productos',true);"; |
|
80 | + "('02','Errores de Impresión (Factura Pre-Impresa)',true), " . |
|
81 | + "('03','Impresión defectuosa',true), " . |
|
82 | + "('04','Duplicidad de Factura',true), " . |
|
83 | + "('05','Corrección de la Información',true), " . |
|
84 | + "('06','Cambio de Productos',true), " . |
|
85 | + "('07','Devolución de Productos',true), " . |
|
86 | + "('08','Omisión de Productos',true);"; |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | public function restoreData() |
@@ -75,21 +75,21 @@ |
||
75 | 75 | public function install() |
76 | 76 | { |
77 | 77 | parent::install(); |
78 | - return "INSERT INTO rd_ncftipoanulacion (codigo, descripcion, estado) VALUES " . |
|
79 | - "('01','Deterioro de Factura Pre-Imprensa',true), " . |
|
80 | - "('02','Errores de Impresión (Factura Pre-Impresa)',true), " . |
|
81 | - "('03','Impresión defectuosa',true), " . |
|
82 | - "('04','Duplicidad de Factura',true), " . |
|
83 | - "('05','Corrección de la Información',true), " . |
|
84 | - "('06','Cambio de Productos',true), " . |
|
85 | - "('07','Devolución de Productos',true), " . |
|
78 | + return "INSERT INTO rd_ncftipoanulacion (codigo, descripcion, estado) VALUES ". |
|
79 | + "('01','Deterioro de Factura Pre-Imprensa',true), ". |
|
80 | + "('02','Errores de Impresión (Factura Pre-Impresa)',true), ". |
|
81 | + "('03','Impresión defectuosa',true), ". |
|
82 | + "('04','Duplicidad de Factura',true), ". |
|
83 | + "('05','Corrección de la Información',true), ". |
|
84 | + "('06','Cambio de Productos',true), ". |
|
85 | + "('07','Devolución de Productos',true), ". |
|
86 | 86 | "('08','Omisión de Productos',true);"; |
87 | 87 | } |
88 | 88 | |
89 | 89 | public function restoreData() |
90 | 90 | { |
91 | 91 | $dataBase = new DataBase(); |
92 | - $sqlClean = "DELETE FROM " . $this->tableName() . ";"; |
|
92 | + $sqlClean = "DELETE FROM ".$this->tableName().";"; |
|
93 | 93 | $dataBase->exec($sqlClean); |
94 | 94 | foreach ($this->arrayTipoAnulacion as $arrayItem) { |
95 | 95 | $initialData = new NCFTipoAnulacion($arrayItem); |
@@ -74,17 +74,17 @@ discard block |
||
74 | 74 | * @var array |
75 | 75 | */ |
76 | 76 | public $arrayComprobantes = array( |
77 | - array ('tipocomprobante' => '01', 'descripcion' => 'FACTURA DE CREDITO FISCAL', 'clasemovimiento'=>'suma', 'ventas'=>'Y', 'compras'=>'Y', 'contribuyente'=>'Y'), |
|
78 | - array ('tipocomprobante' => '02', 'descripcion' => 'FACTURA DE CONSUMO', 'clasemovimiento'=>'suma', 'ventas'=>'Y', 'compras'=>'N', 'contribuyente'=>'Y'), |
|
79 | - array ('tipocomprobante' => '03', 'descripcion' => 'NOTA DE DEBITO', 'clasemovimiento'=>'suma', 'ventas'=>'Y', 'compras'=>'Y', 'contribuyente'=>'N'), |
|
80 | - array ('tipocomprobante' => '04', 'descripcion' => 'NOTA DE CREDITO', 'clasemovimiento'=>'resta', 'ventas'=>'Y', 'compras'=>'Y', 'contribuyente'=>'N'), |
|
81 | - array ('tipocomprobante' => '11', 'descripcion' => 'COMPROBANTE DE COMPRAS', 'clasemovimiento'=>'suma', 'ventas'=>'N', 'compras'=>'Y', 'contribuyente'=>'Y'), |
|
82 | - array ('tipocomprobante' => '12', 'descripcion' => 'REGISTRO UNICO DE INGRESOS', 'clasemovimiento'=>'suma', 'ventas'=>'Y', 'compras'=>'N', 'contribuyente'=>'N'), |
|
83 | - array ('tipocomprobante' => '13', 'descripcion' => 'COMPROBANTE PARA GASTOS MENORES', 'clasemovimiento'=>'suma', 'ventas'=>'N', 'compras'=>'Y', 'contribuyente'=>'N'), |
|
84 | - array ('tipocomprobante' => '14', 'descripcion' => 'COMPROBANTE DE REGIMENES ESPECIALES', 'clasemovimiento'=>'suma', 'ventas'=>'Y', 'compras'=>'Y', 'contribuyente'=>'Y'), |
|
85 | - array ('tipocomprobante' => '15', 'descripcion' => 'COMPROBANTE GUBERNAMENTAL', 'clasemovimiento'=>'suma', 'ventas'=>'Y', 'compras'=>'Y', 'contribuyente'=>'Y'), |
|
86 | - array ('tipocomprobante' => '16', 'descripcion' => 'COMPROBANTE PARA EXPORTACIONES', 'clasemovimiento'=>'suma', 'ventas'=>'Y', 'compras'=>'Y', 'contribuyente'=>'Y'), |
|
87 | - array ('tipocomprobante' => '17', 'descripcion' => 'COMPROBANTE PARA PAGOS AL EXTERIOR', 'clasemovimiento'=>'suma', 'ventas'=>'N', 'compras'=>'Y', 'contribuyente'=>'Y'), |
|
77 | + array('tipocomprobante' => '01', 'descripcion' => 'FACTURA DE CREDITO FISCAL', 'clasemovimiento'=>'suma', 'ventas'=>'Y', 'compras'=>'Y', 'contribuyente'=>'Y'), |
|
78 | + array('tipocomprobante' => '02', 'descripcion' => 'FACTURA DE CONSUMO', 'clasemovimiento'=>'suma', 'ventas'=>'Y', 'compras'=>'N', 'contribuyente'=>'Y'), |
|
79 | + array('tipocomprobante' => '03', 'descripcion' => 'NOTA DE DEBITO', 'clasemovimiento'=>'suma', 'ventas'=>'Y', 'compras'=>'Y', 'contribuyente'=>'N'), |
|
80 | + array('tipocomprobante' => '04', 'descripcion' => 'NOTA DE CREDITO', 'clasemovimiento'=>'resta', 'ventas'=>'Y', 'compras'=>'Y', 'contribuyente'=>'N'), |
|
81 | + array('tipocomprobante' => '11', 'descripcion' => 'COMPROBANTE DE COMPRAS', 'clasemovimiento'=>'suma', 'ventas'=>'N', 'compras'=>'Y', 'contribuyente'=>'Y'), |
|
82 | + array('tipocomprobante' => '12', 'descripcion' => 'REGISTRO UNICO DE INGRESOS', 'clasemovimiento'=>'suma', 'ventas'=>'Y', 'compras'=>'N', 'contribuyente'=>'N'), |
|
83 | + array('tipocomprobante' => '13', 'descripcion' => 'COMPROBANTE PARA GASTOS MENORES', 'clasemovimiento'=>'suma', 'ventas'=>'N', 'compras'=>'Y', 'contribuyente'=>'N'), |
|
84 | + array('tipocomprobante' => '14', 'descripcion' => 'COMPROBANTE DE REGIMENES ESPECIALES', 'clasemovimiento'=>'suma', 'ventas'=>'Y', 'compras'=>'Y', 'contribuyente'=>'Y'), |
|
85 | + array('tipocomprobante' => '15', 'descripcion' => 'COMPROBANTE GUBERNAMENTAL', 'clasemovimiento'=>'suma', 'ventas'=>'Y', 'compras'=>'Y', 'contribuyente'=>'Y'), |
|
86 | + array('tipocomprobante' => '16', 'descripcion' => 'COMPROBANTE PARA EXPORTACIONES', 'clasemovimiento'=>'suma', 'ventas'=>'Y', 'compras'=>'Y', 'contribuyente'=>'Y'), |
|
87 | + array('tipocomprobante' => '17', 'descripcion' => 'COMPROBANTE PARA PAGOS AL EXTERIOR', 'clasemovimiento'=>'suma', 'ventas'=>'N', 'compras'=>'Y', 'contribuyente'=>'Y'), |
|
88 | 88 | ); |
89 | 89 | |
90 | 90 | /** |
@@ -112,17 +112,17 @@ discard block |
||
112 | 112 | public function install() |
113 | 113 | { |
114 | 114 | parent::install(); |
115 | - $sql = "INSERT INTO rd_ncftipo (tipocomprobante, descripcion, estado, clasemovimiento, ventas, compras, contribuyente ) VALUES " . |
|
116 | - "('01','FACTURA DE CREDITO FISCAL',TRUE, 'suma','Y','Y','Y')," . |
|
117 | - "('02','FACTURA DE CONSUMO',TRUE, 'suma','Y','N','Y')," . |
|
118 | - "('03','NOTA DE DEBITO',TRUE, 'suma','Y','Y','N')," . |
|
119 | - "('04','NOTA DE CREDITO',TRUE, 'resta','Y','Y','N')," . |
|
120 | - "('11','COMPROBANTE DE COMPRAS',TRUE, 'suma','N','Y','Y')," . |
|
121 | - "('12','REGISTRO UNICO DE INGRESOS',TRUE, 'suma','Y','N','N')," . |
|
122 | - "('13','COMPROBANTE PARA GASTOS MENORES',TRUE, 'suma','N','Y','N')," . |
|
123 | - "('14','COMPROBANTE DE REGIMENES ESPECIALES',TRUE, 'suma','Y','Y','Y')," . |
|
124 | - "('15','COMPROBANTE GUBERNAMENTAL',TRUE, 'suma','Y','Y','Y')," . |
|
125 | - "('16','COMPROBANTE PARA EXPORTACIONES',TRUE, 'suma','Y','Y','Y')," . |
|
115 | + $sql = "INSERT INTO rd_ncftipo (tipocomprobante, descripcion, estado, clasemovimiento, ventas, compras, contribuyente ) VALUES ". |
|
116 | + "('01','FACTURA DE CREDITO FISCAL',TRUE, 'suma','Y','Y','Y'),". |
|
117 | + "('02','FACTURA DE CONSUMO',TRUE, 'suma','Y','N','Y'),". |
|
118 | + "('03','NOTA DE DEBITO',TRUE, 'suma','Y','Y','N'),". |
|
119 | + "('04','NOTA DE CREDITO',TRUE, 'resta','Y','Y','N'),". |
|
120 | + "('11','COMPROBANTE DE COMPRAS',TRUE, 'suma','N','Y','Y'),". |
|
121 | + "('12','REGISTRO UNICO DE INGRESOS',TRUE, 'suma','Y','N','N'),". |
|
122 | + "('13','COMPROBANTE PARA GASTOS MENORES',TRUE, 'suma','N','Y','N'),". |
|
123 | + "('14','COMPROBANTE DE REGIMENES ESPECIALES',TRUE, 'suma','Y','Y','Y'),". |
|
124 | + "('15','COMPROBANTE GUBERNAMENTAL',TRUE, 'suma','Y','Y','Y'),". |
|
125 | + "('16','COMPROBANTE PARA EXPORTACIONES',TRUE, 'suma','Y','Y','Y'),". |
|
126 | 126 | "('17','COMPROBANTE PARA PAGOS AL EXTERIOR',TRUE, 'suma','N', 'Y','Y');"; |
127 | 127 | return($sql); |
128 | 128 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | public function restoreData() |
131 | 131 | { |
132 | 132 | $dataBase = new DataBase(); |
133 | - $sqlClean = "DELETE FROM " . $this->tableName() . ";"; |
|
133 | + $sqlClean = "DELETE FROM ".$this->tableName().";"; |
|
134 | 134 | $dataBase->exec($sqlClean); |
135 | 135 | foreach ($this->arrayComprobantes as $arrayItem) { |
136 | 136 | $initialData = new NCFTipo($arrayItem); |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | |
142 | 142 | public function allFor($type = "ventas", $movimiento = "suma") |
143 | 143 | { |
144 | - $where = [new DataBaseWhere($type, 'Y'),new DataBaseWhere('clasemovimiento', $movimiento)]; |
|
144 | + $where = [new DataBaseWhere($type, 'Y'), new DataBaseWhere('clasemovimiento', $movimiento)]; |
|
145 | 145 | return $this->all($where, ['tipocomprobante' => 'ASC'], 0, 50); |
146 | 146 | } |
147 | 147 | } |
@@ -67,9 +67,9 @@ |
||
67 | 67 | $data = $this->getBusinessFormData(); |
68 | 68 | $cliente = $cliente0->get($data['subject']['codcliente']); |
69 | 69 | |
70 | - $data['form']['codsubtipodoc'] =(isset($data['form']['codsubtipodoc']))?$cliente->codsubtipodoc:"02"; |
|
71 | - $data['form']['codoperaciondoc'] = (isset($data['form']['codoperaciondoc']))?"01":"LIMPIO"; |
|
72 | - $data['form']['ncftipopago'] = (!isset($data['form']['ncftipopago']))?$cliente->ncftipopago:""; |
|
70 | + $data['form']['codsubtipodoc'] = (isset($data['form']['codsubtipodoc'])) ? $cliente->codsubtipodoc : "02"; |
|
71 | + $data['form']['codoperaciondoc'] = (isset($data['form']['codoperaciondoc'])) ? "01" : "LIMPIO"; |
|
72 | + $data['form']['ncftipopago'] = (!isset($data['form']['ncftipopago'])) ? $cliente->ncftipopago : ""; |
|
73 | 73 | |
74 | 74 | $merged = array_merge($data['custom'], $data['final'], $data['form'], $data['subject']); |
75 | 75 | $this->views[$this->active]->loadFromData($merged); |
@@ -63,13 +63,13 @@ |
||
63 | 63 | { |
64 | 64 | |
65 | 65 | $this->addView('ListNCFTipoMovimiento-1', 'NCFTipoMovimiento', 'sales', 'fas fa-store'); |
66 | - $this->addSearchFields('ListNCFTipoMovimiento-1', ['tipomovimiento','codigo','descripcion']); |
|
66 | + $this->addSearchFields('ListNCFTipoMovimiento-1', ['tipomovimiento', 'codigo', 'descripcion']); |
|
67 | 67 | $this->addOrderBy('ListNCFTipoMovimiento-1', ['id'], 'code'); |
68 | 68 | $this->addOrderBy('ListNCFTipoMovimiento-1', ['descripcion'], 'description'); |
69 | 69 | $this->addRestoreButton('ListNCFTipoMovimiento-1'); |
70 | 70 | |
71 | 71 | $this->addView('ListNCFTipoMovimiento-2', 'NCFTipoMovimiento', 'purchases', 'fas fa-credit-card'); |
72 | - $this->addSearchFields('ListNCFTipoMovimiento-2', ['tipomovimiento','codigo','descripcion']); |
|
72 | + $this->addSearchFields('ListNCFTipoMovimiento-2', ['tipomovimiento', 'codigo', 'descripcion']); |
|
73 | 73 | $this->addOrderBy('ListNCFTipoMovimiento-2', ['id'], 'code'); |
74 | 74 | $this->addOrderBy('ListNCFTipoMovimiento-2', ['descripcion'], 'description'); |
75 | 75 | $this->addRestoreButton('ListNCFTipoMovimiento-2'); |