@@ -26,13 +26,13 @@ discard block |
||
26 | 26 | class CalculatorMod implements CalculatorModInterface |
27 | 27 | { |
28 | 28 | |
29 | - public function apply(BusinessDocument &$doc, array &$lines): bool |
|
29 | + public function apply(BusinessDocument & $doc, array &$lines): bool |
|
30 | 30 | { |
31 | 31 | //TODO: Implement apply() method. |
32 | 32 | return true; |
33 | 33 | } |
34 | 34 | |
35 | - public function calculate(BusinessDocument &$doc, array &$lines): bool |
|
35 | + public function calculate(BusinessDocument & $doc, array &$lines): bool |
|
36 | 36 | { |
37 | 37 | // calculamos el total de impuestos |
38 | 38 | // $totalTaxes = 0.0; |
@@ -44,13 +44,13 @@ discard block |
||
44 | 44 | return true; |
45 | 45 | } |
46 | 46 | |
47 | - public function calculateLine(BusinessDocument $doc, BusinessDocumentLine &$line): bool |
|
47 | + public function calculateLine(BusinessDocument $doc, BusinessDocumentLine & $line): bool |
|
48 | 48 | { |
49 | 49 | // TODO: Implement calculateLine() method. |
50 | 50 | return true; |
51 | 51 | } |
52 | 52 | |
53 | - public function clear(BusinessDocument &$doc, array &$lines): bool |
|
53 | + public function clear(BusinessDocument & $doc, array &$lines): bool |
|
54 | 54 | { |
55 | 55 | // TODO: Implement clear() method. |
56 | 56 | return true; |
@@ -38,14 +38,14 @@ discard block |
||
38 | 38 | { |
39 | 39 | $this->printer->text($this->document->codigo, true, true); |
40 | 40 | $this->printer->lineSeparator('-'); |
41 | - $this->printer->text('NCF: ' . $this->document->numeroncf, true, true); |
|
41 | + $this->printer->text('NCF: '.$this->document->numeroncf, true, true); |
|
42 | 42 | //$this->printer->text('TIPO: ' . $this->document->descripcionTipoComprobante(), true, true); |
43 | - $this->printer->text('F. VENC. NCF: ' . $this->document->ncffechavencimiento, true, true); |
|
43 | + $this->printer->text('F. VENC. NCF: '.$this->document->ncffechavencimiento, true, true); |
|
44 | 44 | $this->printer->lineSeparator('-'); |
45 | - $fechacompleta = $this->document->fecha . ' ' . $this->document->hora; |
|
45 | + $fechacompleta = $this->document->fecha.' '.$this->document->hora; |
|
46 | 46 | $this->printer->text($fechacompleta, true, true); |
47 | 47 | |
48 | - $this->printer->text('CLIENTE: ' . $this->document->nombrecliente); |
|
48 | + $this->printer->text('CLIENTE: '.$this->document->nombrecliente); |
|
49 | 49 | $this->printer->lineSeparator('='); |
50 | 50 | |
51 | 51 | $this->printer->text('ARTICULO'); |
@@ -60,10 +60,10 @@ discard block |
||
60 | 60 | $this->printer->textColumns('IMPORTE', NumberTools::format($line->pvpsindto)); |
61 | 61 | |
62 | 62 | $descuento = $line->pvpsindto - ($line->pvpsindto * $line->getEUDiscount()); |
63 | - $this->printer->textColumns('Descuento:', '- ' . NumberTools::format($descuento)); |
|
63 | + $this->printer->textColumns('Descuento:', '- '.NumberTools::format($descuento)); |
|
64 | 64 | |
65 | 65 | $impuestoLinea = $line->pvptotal * $line->iva / 100; |
66 | - $this->printer->textColumns("Impuesto $line->iva%:", '+ ' . NumberTools::format($impuestoLinea)); |
|
66 | + $this->printer->textColumns("Impuesto $line->iva%:", '+ '.NumberTools::format($impuestoLinea)); |
|
67 | 67 | $this->printer->textColumns('Total linea:', NumberTools::format($line->pvptotal + $impuestoLinea)); |
68 | 68 | } |
69 | 69 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | { |
9 | 9 | public function createViews(): Closure |
10 | 10 | { |
11 | - return function () { |
|
11 | + return function() { |
|
12 | 12 | // tu código aquí |
13 | 13 | // createViews() se ejecuta una vez realizado el createViews() del controlador. |
14 | 14 | parent::createViews(); |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | |
19 | 19 | public function execAfterAction(): Closure |
20 | 20 | { |
21 | - return function ($action) { |
|
21 | + return function($action) { |
|
22 | 22 | // tu código aquí |
23 | 23 | // execAfterAction() se ejecuta tras el execAfterAction() del controlador. |
24 | 24 | }; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | public function execPreviousAction(): Closure |
28 | 28 | { |
29 | - return function ($action) { |
|
29 | + return function($action) { |
|
30 | 30 | // tu código aquí |
31 | 31 | // execPreviousAction() se ejecuta después del execPreviousAction() del controlador. |
32 | 32 | // Si devolvemos false detenemos la ejecución del controlador. |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | public function loadData(): Closure |
37 | 37 | { |
38 | - return function ($viewName, $view) { |
|
38 | + return function($viewName, $view) { |
|
39 | 39 | // tu código aquí |
40 | 40 | // loadData() se ejecuta tras el loadData() del controlador. Recibe los parámetros $viewName y $view. |
41 | 41 | switch ($viewName) { |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | { |
25 | 25 | public function execAfterAction(): Closure |
26 | 26 | { |
27 | - return function($action) { |
|
27 | + return function($action) { |
|
28 | 28 | //return $action; |
29 | 29 | if ($action === 'fixfacturasprov') { |
30 | 30 | $dataBase = new DataBase(); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } elseif ($action === 'fixfacturascli') { |
46 | 46 | self::toolBox()->i18nLog()->notice('fixfacturascli'); |
47 | 47 | } |
48 | - }; |
|
48 | + }; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | } |
52 | 52 | \ No newline at end of file |
@@ -33,7 +33,7 @@ |
||
33 | 33 | $sqlType = " INDEX "; |
34 | 34 | $dataBase->exec("set FOREIGN_KEY_CHECKS=0;"); |
35 | 35 | } |
36 | - $result = $dataBase->exec("ALTER TABLE facturasprov DROP " . $sqlType . |
|
36 | + $result = $dataBase->exec("ALTER TABLE facturasprov DROP ".$sqlType. |
|
37 | 37 | " IF EXISTS uniq_empresancf_facturasprov;"); |
38 | 38 | if (strtoupper(FS_DB_TYPE) === 'MYSQL') { |
39 | 39 | $dataBase->exec("set FOREIGN_KEY_CHECKS=1;"); |
@@ -30,16 +30,16 @@ discard block |
||
30 | 30 | { |
31 | 31 | public function createViews(): Closure |
32 | 32 | { |
33 | - return function () { |
|
33 | + return function() { |
|
34 | 34 | parent::createViews(); |
35 | - AssetManager::add('js', \FS_ROUTE . '/Plugins/fsRepublicaDominicana/Assets/JS/CommonModals.js'); |
|
36 | - AssetManager::add('js', \FS_ROUTE . '/Plugins/fsRepublicaDominicana/Assets/JS/CommonDomFunctions.js'); |
|
35 | + AssetManager::add('js', \FS_ROUTE.'/Plugins/fsRepublicaDominicana/Assets/JS/CommonModals.js'); |
|
36 | + AssetManager::add('js', \FS_ROUTE.'/Plugins/fsRepublicaDominicana/Assets/JS/CommonDomFunctions.js'); |
|
37 | 37 | }; |
38 | 38 | } |
39 | 39 | |
40 | 40 | public function execPreviousAction() |
41 | 41 | { |
42 | - return function ($action) { |
|
42 | + return function($action) { |
|
43 | 43 | switch ($action) { |
44 | 44 | case 'busca_tipo': |
45 | 45 | $this->setTemplate(false); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | break; |
60 | 60 | case "verifica_documento": |
61 | 61 | $this->setTemplate(false); |
62 | - CommonFunctionsDominicanRepublic::verifyDocument($_REQUEST['ncf'],$_REQUEST['proveedor']); |
|
62 | + CommonFunctionsDominicanRepublic::verifyDocument($_REQUEST['ncf'], $_REQUEST['proveedor']); |
|
63 | 63 | break; |
64 | 64 | case 'busca_correlativo': |
65 | 65 | $this->setTemplate(false); |
@@ -95,14 +95,14 @@ discard block |
||
95 | 95 | |
96 | 96 | public function ncftipo() |
97 | 97 | { |
98 | - return function () { |
|
98 | + return function() { |
|
99 | 99 | return NCFTipo::allVentas(); |
100 | 100 | }; |
101 | 101 | } |
102 | 102 | |
103 | 103 | public function ncftipoanulacion() |
104 | 104 | { |
105 | - return function () { |
|
105 | + return function() { |
|
106 | 106 | $tiposAnulacion = new NCFTipoAnulacion(); |
107 | 107 | return $tiposAnulacion->all(); |
108 | 108 | }; |
@@ -92,10 +92,10 @@ |
||
92 | 92 | public function getTaxByProduct($idproducto, $rdtaxid, $use = 'venta'): ?ImpuestoProducto |
93 | 93 | { |
94 | 94 | $dataBase = new DataBase(); |
95 | - $sql = "SELECT * FROM impuestosproductos WHERE idproducto = " . |
|
96 | - self::toolBox()->utils()->intval($idproducto) . |
|
97 | - " AND codimpuesto = '" . self::toolBox()->utils()->normalize($rdtaxid) . "'" . |
|
98 | - " AND " . $use . " = true" . ";"; |
|
95 | + $sql = "SELECT * FROM impuestosproductos WHERE idproducto = ". |
|
96 | + self::toolBox()->utils()->intval($idproducto). |
|
97 | + " AND codimpuesto = '".self::toolBox()->utils()->normalize($rdtaxid)."'". |
|
98 | + " AND ".$use." = true".";"; |
|
99 | 99 | $data = $dataBase->select($sql); |
100 | 100 | if (empty($data) === true || in_array($data[0], [null, ''], true)) { |
101 | 101 | return null; |
@@ -184,7 +184,7 @@ |
||
184 | 184 | . $idempresa |
185 | 185 | . ' AND tipocomprobante = ' |
186 | 186 | . $dataBase->var2str($tipocomprobante) |
187 | - . ' AND estado = ' . $dataBase->var2str(true) |
|
187 | + . ' AND estado = '.$dataBase->var2str(true) |
|
188 | 188 | . ' AND correlativo <= secuenciafin ' |
189 | 189 | . ';'; |
190 | 190 | $data = $dataBase->select($sql); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | class SalesLineMod implements SalesLineModInterface |
27 | 27 | { |
28 | 28 | |
29 | - public function apply(SalesDocument &$model, array &$lines, array $formData) |
|
29 | + public function apply(SalesDocument & $model, array &$lines, array $formData) |
|
30 | 30 | { |
31 | 31 | // TODO: Implement apply() method. |
32 | 32 | } |
@@ -37,10 +37,10 @@ discard block |
||
37 | 37 | * @param string $id |
38 | 38 | * @return void |
39 | 39 | */ |
40 | - public function applyToLine(array $formData, SalesDocumentLine &$line, string $id) |
|
40 | + public function applyToLine(array $formData, SalesDocumentLine & $line, string $id) |
|
41 | 41 | { |
42 | - $line->rdtaxisc = $formData['rdtaxisc_' . $id] ?? null; |
|
43 | - $line->rdtaxcdt = $formData['rdtaxcdt_' . $id] ?? null; |
|
42 | + $line->rdtaxisc = $formData['rdtaxisc_'.$id] ?? null; |
|
43 | + $line->rdtaxcdt = $formData['rdtaxcdt_'.$id] ?? null; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | public function assets(): void |
@@ -86,8 +86,7 @@ discard block |
||
86 | 86 | protected function rdTax($i18n, $idlinea, $line, $model, $field): string |
87 | 87 | { |
88 | 88 | $attributes = $model->editable ? |
89 | - 'name="'. $field .'_' . $idlinea . '"' : |
|
90 | - 'disabled=""'; |
|
89 | + 'name="'.$field.'_'.$idlinea.'"' : 'disabled=""'; |
|
91 | 90 | |
92 | 91 | $title = $this->rdTaxTitle($i18n, $field); |
93 | 92 | $lineTax = $this->productoTaxValue($line->idproducto, $field); |
@@ -96,14 +95,14 @@ discard block |
||
96 | 95 | |
97 | 96 | return '<div class="col-6">' |
98 | 97 | . $title |
99 | - . '<input type="number" ' . $attributes . ' value="' . $fieldValue. '" class="form-control" readonly=""/>' |
|
98 | + . '<input type="number" '.$attributes.' value="'.$fieldValue.'" class="form-control" readonly=""/>' |
|
100 | 99 | . '</div>' |
101 | 100 | . '</div>'; |
102 | 101 | } |
103 | 102 | |
104 | 103 | protected function rdTaxTitle($i18n, $field): string |
105 | 104 | { |
106 | - return '<div class="mb-2">' . $i18n->trans($field); |
|
105 | + return '<div class="mb-2">'.$i18n->trans($field); |
|
107 | 106 | } |
108 | 107 | |
109 | 108 | protected function productoTaxValue($idproducto, $rdtaxid): ?ImpuestoProducto |
@@ -29,19 +29,19 @@ discard block |
||
29 | 29 | |
30 | 30 | class SalesFooterMod implements SalesModInterface |
31 | 31 | { |
32 | - public function apply(SalesDocument &$model, array $formData, User $user) |
|
32 | + public function apply(SalesDocument & $model, array $formData, User $user) |
|
33 | 33 | { |
34 | 34 | } |
35 | 35 | |
36 | - public function applyBefore(SalesDocument &$model, array $formData, User $user) |
|
36 | + public function applyBefore(SalesDocument & $model, array $formData, User $user) |
|
37 | 37 | { |
38 | 38 | if ($model->modelClassName() === 'FacturaCliente') { |
39 | - $model->numeroncf = isset($formData['numeroncf']) ? (string)$formData['numeroncf'] : $model->numeroncf; |
|
40 | - $model->tipocomprobante = isset($formData['tipocomprobante']) ? (string)$formData['tipocomprobante'] : $model->tipocomprobante; |
|
41 | - $model->ncffechavencimiento = isset($formData['ncffechavencimiento']) ? (string)$formData['ncffechavencimiento'] : $model->ncffechavencimiento; |
|
42 | - $model->ncftipopago = isset($formData['ncftipopago']) ? (string)$formData['ncftipopago'] : $model->ncftipopago; |
|
43 | - $model->ncftipomovimiento = isset($formData['ncftipomovimiento']) ? (string)$formData['ncftipomovimiento'] : $model->ncftipomovimiento; |
|
44 | - $model->ncftipoanulacion = isset($formData['ncftipoanulacion']) ? (string)$formData['ncftipoanulacion'] : $model->ncftipoanulacion; |
|
39 | + $model->numeroncf = isset($formData['numeroncf']) ? (string) $formData['numeroncf'] : $model->numeroncf; |
|
40 | + $model->tipocomprobante = isset($formData['tipocomprobante']) ? (string) $formData['tipocomprobante'] : $model->tipocomprobante; |
|
41 | + $model->ncffechavencimiento = isset($formData['ncffechavencimiento']) ? (string) $formData['ncffechavencimiento'] : $model->ncffechavencimiento; |
|
42 | + $model->ncftipopago = isset($formData['ncftipopago']) ? (string) $formData['ncftipopago'] : $model->ncftipopago; |
|
43 | + $model->ncftipomovimiento = isset($formData['ncftipomovimiento']) ? (string) $formData['ncftipomovimiento'] : $model->ncftipomovimiento; |
|
44 | + $model->ncftipoanulacion = isset($formData['ncftipoanulacion']) ? (string) $formData['ncftipoanulacion'] : $model->ncftipoanulacion; |
|
45 | 45 | } |
46 | 46 | } |
47 | 47 | |
@@ -119,18 +119,16 @@ discard block |
||
119 | 119 | $options = ['<option value="">------</option>']; |
120 | 120 | foreach ($tipoComprobante as $row) { |
121 | 121 | $options[] = ($row->tipocomprobante === $invoiceTipoComprobante) ? |
122 | - '<option value="' . $row->tipocomprobante . '" selected="">' . $row->descripcion . '</option>' : |
|
123 | - '<option value="' . $row->tipocomprobante . '">' . $row->descripcion . '</option>'; |
|
122 | + '<option value="'.$row->tipocomprobante.'" selected="">'.$row->descripcion.'</option>' : '<option value="'.$row->tipocomprobante.'">'.$row->descripcion.'</option>'; |
|
124 | 123 | } |
125 | 124 | |
126 | 125 | $attributes = ($model->editable || $model->numeroncf === '') ? |
127 | - 'id="tipocomprobante" name="tipocomprobante" required="" onChange="verificarCorrelativoNCF(this.value,\'Ventas\')"' : |
|
128 | - 'disabled=""'; |
|
126 | + 'id="tipocomprobante" name="tipocomprobante" required="" onChange="verificarCorrelativoNCF(this.value,\'Ventas\')"' : 'disabled=""'; |
|
129 | 127 | |
130 | 128 | return '<div class="col-sm-3">' |
131 | 129 | . '<div class="form-group">' |
132 | 130 | . $i18n->trans('tipocomprobante') |
133 | - . '<select ' . $attributes . ' class="form-control">' . implode('', $options) . '</select>' |
|
131 | + . '<select '.$attributes.' class="form-control">'.implode('', $options).'</select>' |
|
134 | 132 | . '</div>' |
135 | 133 | . '</div>'; |
136 | 134 | } |
@@ -154,15 +152,14 @@ discard block |
||
154 | 152 | $options = ['<option value="">------</option>']; |
155 | 153 | foreach ($tipoPago as $row) { |
156 | 154 | $options[] = ($row->codigo === $invoiceTipoPago) ? |
157 | - '<option value="' . $row->codigo . '" selected="">' . $row->descripcion . '</option>' : |
|
158 | - '<option value="' . $row->codigo . '">' . $row->descripcion . '</option>'; |
|
155 | + '<option value="'.$row->codigo.'" selected="">'.$row->descripcion.'</option>' : '<option value="'.$row->codigo.'">'.$row->descripcion.'</option>'; |
|
159 | 156 | } |
160 | 157 | |
161 | 158 | $attributes = $model->editable ? 'name="ncftipopago" required=""' : 'disabled=""'; |
162 | 159 | return '<div class="col-sm-2">' |
163 | 160 | . '<div class="form-group">' |
164 | 161 | . $i18n->trans('ncf-payment-type') |
165 | - . '<select ' . $attributes . ' class="form-control">' . implode('', $options) . '</select>' |
|
162 | + . '<select '.$attributes.' class="form-control">'.implode('', $options).'</select>' |
|
166 | 163 | . '</div>' |
167 | 164 | . '</div>'; |
168 | 165 | } |
@@ -180,15 +177,14 @@ discard block |
||
180 | 177 | $options = ['<option value="">------</option>']; |
181 | 178 | foreach ($tipoMovimiento as $row) { |
182 | 179 | $options[] = ($row->codigo === $invoiceTipoMovimiento) ? |
183 | - '<option value="' . $row->codigo . '" selected="">' . $row->descripcion . '</option>' : |
|
184 | - '<option value="' . $row->codigo . '">' . $row->descripcion . '</option>'; |
|
180 | + '<option value="'.$row->codigo.'" selected="">'.$row->descripcion.'</option>' : '<option value="'.$row->codigo.'">'.$row->descripcion.'</option>'; |
|
185 | 181 | } |
186 | 182 | |
187 | 183 | $attributes = $model->editable ? 'name="ncftipomovimiento" required=""' : 'disabled=""'; |
188 | 184 | return '<div class="col-sm-3">' |
189 | 185 | . '<div class="form-group">' |
190 | 186 | . $i18n->trans('ncf-movement-type') |
191 | - . '<select ' . $attributes . ' class="form-control">' . implode('', $options) . '</select>' |
|
187 | + . '<select '.$attributes.' class="form-control">'.implode('', $options).'</select>' |
|
192 | 188 | . '</div>' |
193 | 189 | . '</div>'; |
194 | 190 | } |
@@ -206,15 +202,14 @@ discard block |
||
206 | 202 | $options = ['<option value="">------</option>']; |
207 | 203 | foreach ($tipoAnulacion as $row) { |
208 | 204 | $options[] = ($row->codigo === $invoiceTipoAnulacion) ? |
209 | - '<option value="' . $row->codigo . '" selected="">' . $row->descripcion . '</option>' : |
|
210 | - '<option value="' . $row->codigo . '">' . $row->descripcion . '</option>'; |
|
205 | + '<option value="'.$row->codigo.'" selected="">'.$row->descripcion.'</option>' : '<option value="'.$row->codigo.'">'.$row->descripcion.'</option>'; |
|
211 | 206 | } |
212 | 207 | |
213 | 208 | $attributes = $model->editable ? 'name="ncftipoanulacion"' : 'disabled=""'; |
214 | 209 | return '<div class="col-sm-2">' |
215 | 210 | . '<div class="form-group">' |
216 | 211 | . $i18n->trans('ncf-cancellation-type') |
217 | - . '<select ' . $attributes . ' class="form-control">' . implode('', $options) . '</select>' |
|
212 | + . '<select '.$attributes.' class="form-control">'.implode('', $options).'</select>' |
|
218 | 213 | . '</div>' |
219 | 214 | . '</div>'; |
220 | 215 | } |
@@ -226,8 +221,8 @@ discard block |
||
226 | 221 | ? date('Y-m-d', strtotime($model->ncffechavencimiento)) |
227 | 222 | : ''; |
228 | 223 | return '<div class="col-sm-2">' |
229 | - . '<div class="form-group">' . $i18n->trans('due-date') |
|
230 | - . '<input type="date" ' . $attributes . ' value="' . $ncfFechaVencimiento . '" class="form-control"/>' |
|
224 | + . '<div class="form-group">'.$i18n->trans('due-date') |
|
225 | + . '<input type="date" '.$attributes.' value="'.$ncfFechaVencimiento.'" class="form-control"/>' |
|
231 | 226 | . '</div>' |
232 | 227 | . '</div>'; |
233 | 228 | } |
@@ -238,7 +233,7 @@ discard block |
||
238 | 233 | return empty($model->codcliente) ? '' : '<div class="col-sm">' |
239 | 234 | . '<div class="form-group">' |
240 | 235 | . $i18n->trans('desc-numeroncf-sales') |
241 | - . '<input type="text" ' . $attributes . ' value="' . $model->numeroncf . '" class="form-control"/>' |
|
236 | + . '<input type="text" '.$attributes.' value="'.$model->numeroncf.'" class="form-control"/>' |
|
242 | 237 | . '</div>' |
243 | 238 | . '</div>'; |
244 | 239 | } |