2121
2222use FacturaScripts \Core \Base \DataBase ;
2323use FacturaScripts \Core \Base \DataBase \DataBaseWhere ;
24+ use FacturaScripts \Core \DataSrc \Paises ;
2425use FacturaScripts \Core \Lib \Accounting \AccountingPlanImport ;
2526use FacturaScripts \Core \Lib \Accounting \ClosingToAcounting ;
2627use FacturaScripts \Core \Model \Almacen ;
@@ -59,7 +60,7 @@ public function testCloseExercise(): void
5960 // obtenemos el almacén por defecto
6061 $ almacen = new Almacen ();
6162 $ where = [new DataBaseWhere ('idempresa ' , $ empresa ->idempresa )];
62- $ this ->assertTrue ($ almacen ->loadFromCode ( '' , $ where ));
63+ $ this ->assertTrue ($ almacen ->loadWhere ( $ where ));
6364
6465 // creamos el ejercicio para 2020
6566 $ ejercicio = new Ejercicio ();
@@ -71,7 +72,7 @@ public function testCloseExercise(): void
7172 $ this ->assertTrue ($ ejercicio ->save ());
7273
7374 // copiamos el plan contable
74- $ filePath = FS_FOLDER . '/Core/Data/Codpais/ESP /defaultPlan.csv ' ;
75+ $ filePath = FS_FOLDER . '/Core/Data/Codpais/ ' . Paises:: default ()-> codpais . ' /defaultPlan.csv ' ;
7576 $ planImport = new AccountingPlanImport ();
7677 $ planImport ->importCSV ($ filePath , $ ejercicio ->codejercicio );
7778
@@ -90,10 +91,11 @@ public function testCloseExercise(): void
9091 'copySubAccounts ' => true
9192 ];
9293 $ closing = new ClosingToAcounting ();
94+ $ this ->assertTrue ($ ejercicio ->reload ());
9395 $ this ->assertTrue ($ closing ->exec ($ ejercicio , $ data ));
9496
9597 // comprobamos que el ejercicio está cerrado
96- $ this ->assertTrue ($ ejercicio ->loadFromCode ( $ ejercicio -> codejercicio ));
98+ $ this ->assertTrue ($ ejercicio ->reload ( ));
9799 $ this ->assertFalse ($ ejercicio ->isOpened ());
98100
99101 // comprobamos que todas las subcuentas del ejercicio anterior tienen saldo 0
@@ -133,7 +135,7 @@ public function testCloseExerciseWithMissingEntries(): void
133135 // obtenemos el almacén por defecto
134136 $ almacen = new Almacen ();
135137 $ where = [new DataBaseWhere ('idempresa ' , $ empresa ->idempresa )];
136- $ this ->assertTrue ($ almacen ->loadFromCode ( '' , $ where ));
138+ $ this ->assertTrue ($ almacen ->loadWhere ( $ where ));
137139
138140 // creamos el ejercicio para 2026
139141 $ ejercicio = new Ejercicio ();
@@ -145,7 +147,7 @@ public function testCloseExerciseWithMissingEntries(): void
145147 $ this ->assertTrue ($ ejercicio ->save ());
146148
147149 // copiamos el plan contable
148- $ filePath = FS_FOLDER . '/Core/Data/Codpais/ESP /defaultPlan.csv ' ;
150+ $ filePath = FS_FOLDER . '/Core/Data/Codpais/ ' . Paises:: default ()-> codpais . ' /defaultPlan.csv ' ;
149151 $ planImport = new AccountingPlanImport ();
150152 $ planImport ->importCSV ($ filePath , $ ejercicio ->codejercicio );
151153
0 commit comments