Skip to content

Commit e6c2ce7

Browse files
author
Carlos Garcia
committed
Solucionados problemas de tests con Ecuador.
1 parent 6187221 commit e6c2ce7

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

Core/Data/Codpais/ECU/defaultPlan.csv

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"112";"EXIGIBLES";""
99
"1121";"CLIENTES";"CLIENT"
1010
"1122";"OTRAS CUENTAS POR COBRAR";""
11-
"1123";"CREDITO TRIBUTARIO IVA";""
11+
"1123";"CREDITO TRIBUTARIO IVA";"IVASOP"
1212
"1124";"CREDITO TRIBUTARIO RENTA AÑOS ANTERIORES";""
1313
"1125";"CREDITO TRIBUTARIO RENTA AÑO CORRIENTE";""
1414
"113";"REALIZABLES";""
@@ -76,7 +76,7 @@
7676
"5";"COSTOS Y GASTOS";""
7777
"51";"COSTOS OPERACIONALES";""
7878
"511";"COSTOS";""
79-
"5111";"COSTO DE VENTAS";""
79+
"5111";"COSTO DE VENTAS";"COMPRA"
8080
"5112";"DESCUENTO EN COMPRAS";""
8181
"5113";"DEVOLUCION EN COMPRAS";""
8282
"5114";"RECARGO EN COMPRAS";""
@@ -188,7 +188,7 @@
188188
"212143";"IVA Retenido por Emisoras de Tarjetas de Credito Bienes";""
189189
"212144";"IVA por la Compra de Bienes";""
190190
"212145";"IVA en Contratos de Construcción";""
191-
"212146";"IVA en Ventas o por Pagar";""
191+
"212146";"IVA en Ventas o por Pagar";"IVAREP"
192192
"212147";"Impuesto a la Renta por Pagar";""
193193
"212201";"Aporte Personal IESS 9.35% por Pagar";""
194194
"212202";"Aporte Patronal IESS 12.15% por Pagar";""

Test/Core/Lib/AccountingCreationTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
namespace FacturaScripts\Test\Core\Lib;
2121

2222
use FacturaScripts\Core\Base\DataBase;
23+
use FacturaScripts\Core\DataSrc\Paises;
2324
use FacturaScripts\Core\Lib\Accounting\AccountingAccounts;
2425
use FacturaScripts\Core\Lib\Accounting\AccountingCreation;
2526
use FacturaScripts\Core\Model\Cuenta;
@@ -62,10 +63,11 @@ public function testCreateCustomer(): void
6263
$customersAccount = $accounts->getSpecialAccount(AccountingAccounts::SPECIAL_CUSTOMER_ACCOUNT);
6364
$this->assertTrue($customersAccount->exists(), 'cant-get-customer-account');
6465

65-
// obtenemos una nueva subcuenta para el cliente, 1001 veces,
66+
// obtenemos una nueva subcuenta para el cliente, 1001 veces (solo España),
6667
// para comprobar si en todos los casos se crea una nueva
6768
$creator = new AccountingCreation();
68-
for ($i = 0; $i < 1000; $i++) {
69+
$max = Paises::default()->codpais === 'ESP' ? 1000 : 10;
70+
for ($i = 0; $i < $max; $i++) {
6971
$subaccount = $creator->createSubjectAccount($customer, $customersAccount);
7072
$this->assertTrue($subaccount->exists(), 'cant-create-customer-subaccount-' . $i);
7173

Test/Core/Lib/LedgerTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@
2525
use FacturaScripts\Core\Where;
2626
use FacturaScripts\Dinamic\Model\Subcuenta;
2727
use FacturaScripts\Test\Traits\DefaultSettingsTrait;
28+
use FacturaScripts\Test\Traits\LogErrorsTrait;
2829
use PHPUnit\Framework\TestCase;
2930

3031
final class LedgerTest extends TestCase
3132
{
3233
use DefaultSettingsTrait;
34+
use LogErrorsTrait;
3335

3436
public static function setUpBeforeClass(): void
3537
{
@@ -89,4 +91,9 @@ private function getSampleSubaccount(Ejercicio $eje): ?string
8991

9092
return null;
9193
}
94+
95+
protected function tearDown(): void
96+
{
97+
$this->logErrors();
98+
}
9299
}

Test/Traits/DefaultSettingsTrait.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* This file is part of FacturaScripts
4-
* Copyright (C) 2021-2023 Carlos Garcia Gomez <carlos@facturascripts.com>
4+
* Copyright (C) 2021-2025 Carlos Garcia Gomez <carlos@facturascripts.com>
55
*
66
* This program is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU Lesser General Public License as
@@ -49,12 +49,6 @@ protected static function installAccountingPlan(): void
4949
$exercise->save();
5050
}
5151

52-
// si el ejercicio no tiene 10 dígitos en las subcuentas, lo eliminamos
53-
if ($exercise->longsubcuenta != 10) {
54-
$exercise->delete();
55-
continue;
56-
}
57-
5852
$where = [new DataBaseWhere('codejercicio', $exercise->codejercicio)];
5953
if ($cuenta->count($where) > 0) {
6054
// ya tiene plan contable

0 commit comments

Comments
 (0)