@@ -26,10 +26,10 @@ |
||
26 | 26 | |
27 | 27 | public function createViews() |
28 | 28 | { |
29 | - return function () { |
|
30 | - AssetManager::add('js', \FS_ROUTE . '/Plugins/fsRepublicaDominicana/Assets/JS/CommonModals.js'); |
|
31 | - AssetManager::add('js', \FS_ROUTE . '/Plugins/fsRepublicaDominicana/Assets/JS/CommonDomFunctions.js'); |
|
32 | - AssetManager::add('js', \FS_ROUTE . '/Plugins/fsRepublicaDominicana/Assets/JS/BusquedaRNCDGII.js'); |
|
29 | + return function() { |
|
30 | + AssetManager::add('js', \FS_ROUTE.'/Plugins/fsRepublicaDominicana/Assets/JS/CommonModals.js'); |
|
31 | + AssetManager::add('js', \FS_ROUTE.'/Plugins/fsRepublicaDominicana/Assets/JS/CommonDomFunctions.js'); |
|
32 | + AssetManager::add('js', \FS_ROUTE.'/Plugins/fsRepublicaDominicana/Assets/JS/BusquedaRNCDGII.js'); |
|
33 | 33 | $ncfTipoPago = new NCFTipoPago(); |
34 | 34 | $ncfTiposPago = $ncfTipoPago->findAllByTipopago('02'); |
35 | 35 | $customValuesNTP = []; |
@@ -27,10 +27,10 @@ |
||
27 | 27 | { |
28 | 28 | public function createViews() |
29 | 29 | { |
30 | - return function () { |
|
31 | - AssetManager::add('js', \FS_ROUTE . '/Plugins/fsRepublicaDominicana/Assets/JS/CommonModals.js'); |
|
32 | - AssetManager::add('js', \FS_ROUTE . '/Plugins/fsRepublicaDominicana/Assets/JS/CommonDomFunctions.js'); |
|
33 | - AssetManager::add('js', \FS_ROUTE . '/Plugins/fsRepublicaDominicana/Assets/JS/BusquedaRNCDGII.js'); |
|
30 | + return function() { |
|
31 | + AssetManager::add('js', \FS_ROUTE.'/Plugins/fsRepublicaDominicana/Assets/JS/CommonModals.js'); |
|
32 | + AssetManager::add('js', \FS_ROUTE.'/Plugins/fsRepublicaDominicana/Assets/JS/CommonDomFunctions.js'); |
|
33 | + AssetManager::add('js', \FS_ROUTE.'/Plugins/fsRepublicaDominicana/Assets/JS/BusquedaRNCDGII.js'); |
|
34 | 34 | $ncfTipo = new NCFTipo(); |
35 | 35 | $ncfTipos = $ncfTipo->allFor('ventas', 'suma'); |
36 | 36 | $customValues = []; |
@@ -21,13 +21,13 @@ |
||
21 | 21 | class Cliente |
22 | 22 | { |
23 | 23 | /** |
24 | - * Payment type based on DGII table |
|
25 | - * @var string |
|
26 | - */ |
|
24 | + * Payment type based on DGII table |
|
25 | + * @var string |
|
26 | + */ |
|
27 | 27 | public $ncftipopago; |
28 | 28 | /** |
29 | - * Type of NCF to generate to the customer |
|
30 | - * @var string |
|
31 | - */ |
|
29 | + * Type of NCF to generate to the customer |
|
30 | + * @var string |
|
31 | + */ |
|
32 | 32 | public $tipocomprobante; |
33 | 33 | } |
@@ -47,8 +47,8 @@ |
||
47 | 47 | |
48 | 48 | public function saveInsert() |
49 | 49 | { |
50 | - return function () { |
|
51 | - $ArrayTipoNCFCompras = ['11','12','16','17']; |
|
50 | + return function() { |
|
51 | + $ArrayTipoNCFCompras = ['11', '12', '16', '17']; |
|
52 | 52 | $ncfrango = new NCFRango(); |
53 | 53 | $cliente = new Proveedor(); |
54 | 54 | $appSettings = new AppSettings; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | protected function insertBusinessDocHeader($model): void |
27 | 27 | { |
28 | 28 | $headerData = [ |
29 | - 'title' => $this->i18n->trans($model->modelClassName() . '-min'), |
|
29 | + 'title' => $this->i18n->trans($model->modelClassName().'-min'), |
|
30 | 30 | 'subject' => $this->i18n->trans('customer'), |
31 | 31 | 'fieldName' => 'nombrecliente' |
32 | 32 | ]; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $headerData['title'] = Utils::fixHtml($this->format->titulo); |
41 | 41 | } |
42 | 42 | |
43 | - $this->pdf->ezText("\n" . $headerData['title'] . ': ' . $model->codigo . "\n", self::FONT_SIZE + 6); |
|
43 | + $this->pdf->ezText("\n".$headerData['title'].': '.$model->codigo."\n", self::FONT_SIZE + 6); |
|
44 | 44 | $this->newLine(); |
45 | 45 | |
46 | 46 | $subject = $model->getSubject(); |
@@ -69,17 +69,17 @@ discard block |
||
69 | 69 | protected function getGroupFields(): string |
70 | 70 | { |
71 | 71 | //return parent::getGroupFields(); // TODO: Change the autogenerated stub |
72 | - return static::MAIN_TABLE.'.idfactura, ' . |
|
73 | - static::MAIN_TABLE.'.idempresa, ' . |
|
74 | - static::MAIN_TABLE.'.codalmacen, ' . |
|
75 | - static::MAIN_TABLE.'.cifnif, ' . |
|
76 | - static::MAIN_TABLE.'.ncftipomovimiento, ' . |
|
77 | - static::MAIN_TABLE.'.numproveedor, ' . |
|
78 | - static::SECONDARY_TABLE_ALIAS.'.numproveedor, ' . |
|
79 | - static::MAIN_TABLE.'.fecha, ' . |
|
80 | - static::ESTADOSDOC_TABLE.'.nombre, ' . |
|
81 | - static::MAIN_TABLE.'.neto, ' . |
|
82 | - static::MAIN_TABLE.'.totaliva' . |
|
72 | + return static::MAIN_TABLE.'.idfactura, '. |
|
73 | + static::MAIN_TABLE.'.idempresa, '. |
|
74 | + static::MAIN_TABLE.'.codalmacen, '. |
|
75 | + static::MAIN_TABLE.'.cifnif, '. |
|
76 | + static::MAIN_TABLE.'.ncftipomovimiento, '. |
|
77 | + static::MAIN_TABLE.'.numproveedor, '. |
|
78 | + static::SECONDARY_TABLE_ALIAS.'.numproveedor, '. |
|
79 | + static::MAIN_TABLE.'.fecha, '. |
|
80 | + static::ESTADOSDOC_TABLE.'.nombre, '. |
|
81 | + static::MAIN_TABLE.'.neto, '. |
|
82 | + static::MAIN_TABLE.'.totaliva'. |
|
83 | 83 | ' '; |
84 | 84 | } |
85 | 85 | |
@@ -90,14 +90,14 @@ discard block |
||
90 | 90 | protected function getSQLFrom(): string |
91 | 91 | { |
92 | 92 | return static::MAIN_TABLE |
93 | - . ' LEFT JOIN '. static::SECONDARY_TABLE . ' ON (' |
|
94 | - . static::MAIN_TABLE . '.idfacturarect = ' . static::SECONDARY_TABLE_ALIAS . '.idfactura)' |
|
95 | - . ' LEFT JOIN '. static::LINES_TABLE . ' ON (' |
|
96 | - . static::MAIN_TABLE . '.idfactura = ' . static::LINES_TABLE . '.idfactura)' |
|
97 | - . ' LEFT JOIN '. static::PRODS_TABLE . ' ON (' |
|
98 | - . static::LINES_TABLE . '.referencia = ' . static::PRODS_TABLE . '.referencia)' |
|
99 | - . ' LEFT JOIN ' . static::ESTADOSDOC_TABLE . ' ON (' |
|
100 | - . static::MAIN_TABLE . '.idestado = ' . static::ESTADOSDOC_TABLE . '.idestado)'; |
|
93 | + . ' LEFT JOIN '.static::SECONDARY_TABLE.' ON (' |
|
94 | + . static::MAIN_TABLE.'.idfacturarect = '.static::SECONDARY_TABLE_ALIAS.'.idfactura)' |
|
95 | + . ' LEFT JOIN '.static::LINES_TABLE.' ON (' |
|
96 | + . static::MAIN_TABLE.'.idfactura = '.static::LINES_TABLE.'.idfactura)' |
|
97 | + . ' LEFT JOIN '.static::PRODS_TABLE.' ON (' |
|
98 | + . static::LINES_TABLE.'.referencia = '.static::PRODS_TABLE.'.referencia)' |
|
99 | + . ' LEFT JOIN '.static::ESTADOSDOC_TABLE.' ON (' |
|
100 | + . static::MAIN_TABLE.'.idestado = '.static::ESTADOSDOC_TABLE.'.idestado)'; |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | /** |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | private function slowParser() |
134 | 134 | { |
135 | 135 | $dataBase = new DataBase(); |
136 | - $sqlDelete = "DELETE FROM " . $this->tableName() . ";"; |
|
136 | + $sqlDelete = "DELETE FROM ".$this->tableName().";"; |
|
137 | 137 | $dataBase->exec($sqlDelete); |
138 | 138 | |
139 | 139 | [$handle, $totalLines] = $this->utf8FopenRead($this->fileNameTxt); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | while (($raw_string = fgets($handle)) !== false) { |
143 | 143 | $totalLines--; |
144 | 144 | if ($maxLine === 2000) { |
145 | - $query = 'INSERT INTO ' . $this->tableName() . |
|
145 | + $query = 'INSERT INTO '.$this->tableName(). |
|
146 | 146 | ' (rnc, nombre, razonsocial, categoria, inicioactividad, estado, regimenpagos) VALUES '; |
147 | 147 | } |
148 | 148 | $linea = str_getcsv($raw_string, "|"); |
@@ -172,14 +172,14 @@ discard block |
||
172 | 172 | $fecha = ($colArray[8] === '00/00/0000') |
173 | 173 | ? "2000-01-01" |
174 | 174 | : \date('Y-m-d', strtotime(str_replace("/", "-", $colArray[8]))); |
175 | - return "('" . |
|
176 | - $colArray[0] . "','" . |
|
177 | - str_replace('\\', '', str_replace('"', '', str_replace("'", "''", str_replace(" ", " ", $colArray[1])))) . "','" . |
|
178 | - str_replace('\\', '', str_replace('"', '', str_replace("'", "''", str_replace(" ", " ", $colArray[2])))) . "','" . |
|
179 | - $colArray[3] . "','" . |
|
180 | - $fecha . "','" . |
|
181 | - $colArray[9] . "','" . |
|
182 | - $colArray[10] . "')" . $semiColon; |
|
175 | + return "('". |
|
176 | + $colArray[0]."','". |
|
177 | + str_replace('\\', '', str_replace('"', '', str_replace("'", "''", str_replace(" ", " ", $colArray[1]))))."','". |
|
178 | + str_replace('\\', '', str_replace('"', '', str_replace("'", "''", str_replace(" ", " ", $colArray[2]))))."','". |
|
179 | + $colArray[3]."','". |
|
180 | + $fecha."','". |
|
181 | + $colArray[9]."','". |
|
182 | + $colArray[10]."')".$semiColon; |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | private function utf8FopenRead($fileName) |
@@ -56,7 +56,7 @@ |
||
56 | 56 | $this->loadExtension(new Extension\Controller\EditProveedor()); |
57 | 57 | $this->loadExtension(new Extension\Controller\EditFacturaCliente()); |
58 | 58 | $this->loadExtension(new Extension\Controller\EditFacturaProveedor()); |
59 | - AssetManager::add('js', \FS_ROUTE . '/Plugins/fsRepublicaDominicana/Assets/JS/CommonDomFunctions.js'); |
|
59 | + AssetManager::add('js', \FS_ROUTE.'/Plugins/fsRepublicaDominicana/Assets/JS/CommonDomFunctions.js'); |
|
60 | 60 | SalesHeaderHTML::addMod(new Mod\SalesHeaderMod()); |
61 | 61 | SalesFooterHTML::addMod(new Mod\SalesFooterMod()); |
62 | 62 | PurchasesFooterHTML::addMod(new Mod\PurchasesFooterMod()); |
@@ -29,20 +29,20 @@ discard block |
||
29 | 29 | |
30 | 30 | class PurchasesFooterMod implements PurchasesModInterface |
31 | 31 | { |
32 | - public function apply(PurchaseDocument &$model, array $formData, User $user) |
|
32 | + public function apply(PurchaseDocument & $model, array $formData, User $user) |
|
33 | 33 | { |
34 | 34 | // TODO: Implement apply() method. |
35 | 35 | } |
36 | 36 | |
37 | - public function applyBefore(PurchaseDocument &$model, array $formData, User $user) |
|
37 | + public function applyBefore(PurchaseDocument & $model, array $formData, User $user) |
|
38 | 38 | { |
39 | 39 | // TODO: Implement applyBefore() method. |
40 | 40 | if ($model->modelClassName() === 'FacturaProveedor') { |
41 | - $model->tipocomprobante = isset($formData['tipocomprobante']) ? (string)$formData['tipocomprobante'] : $model->tipocomprobante; |
|
42 | - $model->ncffechavencimiento = isset($formData['ncffechavencimiento']) ? (string)$formData['ncffechavencimiento'] : $model->ncffechavencimiento; |
|
43 | - $model->ncftipopago = isset($formData['ncftipopago']) ? (string)$formData['ncftipopago'] : $model->ncftipopago; |
|
44 | - $model->ncftipomovimiento = isset($formData['ncftipomovimiento']) ? (string)$formData['ncftipomovimiento'] : $model->ncftipomovimiento; |
|
45 | - $model->ncftipoanulacion = isset($formData['ncftipoanulacion']) ? (string)$formData['ncftipoanulacion'] : $model->ncftipoanulacion; |
|
41 | + $model->tipocomprobante = isset($formData['tipocomprobante']) ? (string) $formData['tipocomprobante'] : $model->tipocomprobante; |
|
42 | + $model->ncffechavencimiento = isset($formData['ncffechavencimiento']) ? (string) $formData['ncffechavencimiento'] : $model->ncffechavencimiento; |
|
43 | + $model->ncftipopago = isset($formData['ncftipopago']) ? (string) $formData['ncftipopago'] : $model->ncftipopago; |
|
44 | + $model->ncftipomovimiento = isset($formData['ncftipomovimiento']) ? (string) $formData['ncftipomovimiento'] : $model->ncftipomovimiento; |
|
45 | + $model->ncftipoanulacion = isset($formData['ncftipoanulacion']) ? (string) $formData['ncftipoanulacion'] : $model->ncftipoanulacion; |
|
46 | 46 | } |
47 | 47 | } |
48 | 48 | |
@@ -101,15 +101,14 @@ discard block |
||
101 | 101 | $options = ['<option value="">------</option>']; |
102 | 102 | foreach ($tipoComprobante as $row) { |
103 | 103 | $options[] = ($row->tipocomprobante === $invoiceTipoComprobante) ? |
104 | - '<option value="' . $row->tipocomprobante . '" selected="">' . $row->descripcion . '</option>' : |
|
105 | - '<option value="' . $row->tipocomprobante . '">' . $row->descripcion . '</option>'; |
|
104 | + '<option value="'.$row->tipocomprobante.'" selected="">'.$row->descripcion.'</option>' : '<option value="'.$row->tipocomprobante.'">'.$row->descripcion.'</option>'; |
|
106 | 105 | } |
107 | 106 | |
108 | 107 | $attributes = ($model->editable || $model->numproveedor === '') ? 'name="tipocomprobante" required=""' : 'disabled=""'; |
109 | 108 | return '<div class="col-sm-3">' |
110 | 109 | . '<div class="form-group">' |
111 | 110 | . $i18n->trans('tipocomprobante') |
112 | - . '<select ' . $attributes . ' class="form-control">' . implode('', $options) . '</select>' |
|
111 | + . '<select '.$attributes.' class="form-control">'.implode('', $options).'</select>' |
|
113 | 112 | . '</div>' |
114 | 113 | . '</div>'; |
115 | 114 | } |
@@ -133,15 +132,14 @@ discard block |
||
133 | 132 | $options = ['<option value="">------</option>']; |
134 | 133 | foreach ($tipoPago as $row) { |
135 | 134 | $options[] = ($row->codigo === $invoiceTipoPago) ? |
136 | - '<option value="' . $row->codigo . '" selected="">' . $row->descripcion . '</option>' : |
|
137 | - '<option value="' . $row->codigo . '">' . $row->descripcion . '</option>'; |
|
135 | + '<option value="'.$row->codigo.'" selected="">'.$row->descripcion.'</option>' : '<option value="'.$row->codigo.'">'.$row->descripcion.'</option>'; |
|
138 | 136 | } |
139 | 137 | |
140 | 138 | $attributes = $model->editable ? 'name="ncftipopago" required=""' : 'disabled=""'; |
141 | 139 | return '<div class="col-sm-2">' |
142 | 140 | . '<div class="form-group">' |
143 | 141 | . $i18n->trans('ncf-payment-type') |
144 | - . '<select ' . $attributes . ' class="form-control">' . implode('', $options) . '</select>' |
|
142 | + . '<select '.$attributes.' class="form-control">'.implode('', $options).'</select>' |
|
145 | 143 | . '</div>' |
146 | 144 | . '</div>'; |
147 | 145 | } |
@@ -159,15 +157,14 @@ discard block |
||
159 | 157 | $options = ['<option value="">------</option>']; |
160 | 158 | foreach ($tipoMovimiento as $row) { |
161 | 159 | $options[] = ($row->codigo === $invoiceTipoMovimiento) ? |
162 | - '<option value="' . $row->codigo . '" selected="">' . $row->descripcion . '</option>' : |
|
163 | - '<option value="' . $row->codigo . '">' . $row->descripcion . '</option>'; |
|
160 | + '<option value="'.$row->codigo.'" selected="">'.$row->descripcion.'</option>' : '<option value="'.$row->codigo.'">'.$row->descripcion.'</option>'; |
|
164 | 161 | } |
165 | 162 | |
166 | 163 | $attributes = $model->editable ? 'name="ncftipomovimiento" required=""' : 'disabled=""'; |
167 | 164 | return '<div class="col-sm-3">' |
168 | 165 | . '<div class="form-group">' |
169 | 166 | . $i18n->trans('ncf-movement-type') |
170 | - . '<select ' . $attributes . ' class="form-control">' . implode('', $options) . '</select>' |
|
167 | + . '<select '.$attributes.' class="form-control">'.implode('', $options).'</select>' |
|
171 | 168 | . '</div>' |
172 | 169 | . '</div>'; |
173 | 170 | } |
@@ -185,15 +182,14 @@ discard block |
||
185 | 182 | $options = ['<option value="">------</option>']; |
186 | 183 | foreach ($tipoAnulacion as $row) { |
187 | 184 | $options[] = ($row->codigo === $invoiceTipoAnulacion) ? |
188 | - '<option value="' . $row->codigo . '" selected="">' . $row->descripcion . '</option>' : |
|
189 | - '<option value="' . $row->codigo . '">' . $row->descripcion . '</option>'; |
|
185 | + '<option value="'.$row->codigo.'" selected="">'.$row->descripcion.'</option>' : '<option value="'.$row->codigo.'">'.$row->descripcion.'</option>'; |
|
190 | 186 | } |
191 | 187 | |
192 | 188 | $attributes = $model->editable ? 'name="ncftipoanulacion"' : 'disabled=""'; |
193 | 189 | return '<div class="col-sm-2">' |
194 | 190 | . '<div class="form-group">' |
195 | 191 | . $i18n->trans('ncf-cancellation-type') |
196 | - . '<select ' . $attributes . ' class="form-control">' . implode('', $options) . '</select>' |
|
192 | + . '<select '.$attributes.' class="form-control">'.implode('', $options).'</select>' |
|
197 | 193 | . '</div>' |
198 | 194 | . '</div>'; |
199 | 195 | } |
@@ -202,8 +198,8 @@ discard block |
||
202 | 198 | { |
203 | 199 | $attributes = ($model->editable && $model->numproveedor === '') ? 'name="ncffechavencimiento"' : 'disabled=""'; |
204 | 200 | return '<div class="col-sm-2">' |
205 | - . '<div class="form-group">' . $i18n->trans('due-date') |
|
206 | - . '<input type="date" ' . $attributes . ' value="' . date('Y-m-d', strtotime($model->ncffechavencimiento)) . '" class="form-control"/>' |
|
201 | + . '<div class="form-group">'.$i18n->trans('due-date') |
|
202 | + . '<input type="date" '.$attributes.' value="'.date('Y-m-d', strtotime($model->ncffechavencimiento)).'" class="form-control"/>' |
|
207 | 203 | . '</div>' |
208 | 204 | . '</div>'; |
209 | 205 | } |