Skip to content

Commit 2aff07d

Browse files
authored
Merge pull request #13 from elguitarraverde/fix-array-bug
fix array bug
2 parents 3eec6dc + c0810c1 commit 2aff07d

2 files changed

Lines changed: 19 additions & 41 deletions

File tree

Controller/EditRegularizacionImpuesto.php

Lines changed: 18 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@ protected function getListPartidaImpuestoResumen(BaseView $view): void
230230
], [], 0, 0);
231231
$idsAsientos = array_unique(array_column($asientos, Asiento::primaryColumn()));
232232

233+
if(empty($idsAsientos)) {
234+
Tools::log()->warning('accounting-entry-not-found');
235+
return;
236+
}
237+
233238
$partidas = Partida::all([
234239
new DataBaseWhere('idasiento', $idsAsientos, 'IN'),
235240
new DataBaseWhere('codsubcuenta', $subcuentas, 'IN')
@@ -242,47 +247,19 @@ protected function getListPartidaImpuestoResumen(BaseView $view): void
242247
}
243248

244249
// inicializamos el modelo303
245-
$this->modelo303 = [
246-
'01' => 0.00,
247-
'02' => 4.00,
248-
'03' => 0.00,
249-
250-
'04' => 0.00,
251-
'05' => 10.00,
252-
'06' => 0.00,
253-
254-
'07' => 0.00,
255-
'08' => 21.00,
256-
'09' => 0.00,
257-
258-
// IVA 0
259-
'150' => 0.00,
260-
'151' => 0.00,
261-
'152' => 0.00,
262-
263-
// RECARGO 1.75
264-
'156' => 0.00,
265-
'157' => 1.75,
266-
'158' => 0.00,
267-
268-
// RECARGO 0.5
269-
'168' => 0.00,
270-
'169' => 0.5,
271-
'170' => 0.00,
272-
273-
// RECARGO 1.4
274-
'19' => 0.00,
275-
'20' => 1.4,
276-
'21' => 0.00,
277-
278-
// RECARGO 5.2
279-
'22' => 0.00,
280-
'23' => 5.2,
281-
'24' => 0.00,
282-
283-
// Total cuota devengada
284-
'27' => 0.00,
285-
];
250+
$this->modelo303 = [];
251+
for ($i = 0; $i <= 200; $i++) {
252+
$this->modelo303[sprintf('%02d', $i)] = 0.00;
253+
}
254+
255+
// set default values
256+
$this->modelo303['02'] = 4.00;
257+
$this->modelo303['05'] = 10.00;
258+
$this->modelo303['08'] = 21.00;
259+
$this->modelo303['157'] = 1.75;
260+
$this->modelo303['169'] = 0.5;
261+
$this->modelo303['20'] = 1.4;
262+
$this->modelo303['23'] = 5.2;
286263

287264
// obtenemos los códigos de subcuentas agrupados según tipo iva
288265
// esto lo hacemos por si existen varios impuestos

Translation/es_ES.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"accounting-entry-already-created": "Asiento ya creado anteriormente.",
3+
"accounting-entry-not-found": "No se han encontrado asientos para este periodo",
34
"accounting-entry-not-created": "Asiento no creado.",
45
"invoices-without-acc-entry": "Existen facturas sin asiento. Debe crear los asientos de todas las facturas.",
56
"model-303": "Modelo 303",

0 commit comments

Comments
 (0)