Skip to content

Commit d72283f

Browse files
authored
Merge pull request #6 from EstebanSM85/Tarea-4487-where
Cambiadas llamadas DataBaseWhere por Where
2 parents 29b4aa6 + 41daf03 commit d72283f

3 files changed

Lines changed: 16 additions & 10 deletions

File tree

Controller/EditAsientoPredefinido.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
namespace FacturaScripts\Plugins\AsientosPredefinidos\Controller;
2121

22-
use FacturaScripts\Core\Base\DataBase\DataBaseWhere;
22+
use FacturaScripts\Core\Where;
2323
use FacturaScripts\Core\Lib\ExtendedController\EditController;
2424
use FacturaScripts\Core\Tools;
2525

@@ -132,17 +132,17 @@ protected function loadData($viewName, $view)
132132

133133
switch ($viewName) {
134134
case 'EditAsientoPredefinidoLinea':
135-
$where = [new DataBaseWhere('idasientopre', $id)];
135+
$where = [Where::eq('idasientopre', $id)];
136136
$view->loadData('', $where, ['orden' => 'ASC', 'idasientopre' => 'ASC']);
137137
break;
138138

139139
case 'EditAsientoPredefinidoVariable':
140-
$where = [new DataBaseWhere('idasientopre', $id)];
140+
$where = [Where::eq('idasientopre', $id)];
141141
$view->loadData('', $where, ['idasientopre' => 'ASC', 'codigo' => 'ASC']);
142142
break;
143143

144144
case 'ListAsiento':
145-
$where = [new DataBaseWhere('idasientopre', $id)];
145+
$where = [Where::eq('idasientopre', $id)];
146146
$view->loadData('', $where);
147147
break;
148148

@@ -152,3 +152,5 @@ protected function loadData($viewName, $view)
152152
}
153153
}
154154
}
155+
156+

Lib/AsientoPredefinidoGenerator.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
namespace FacturaScripts\Plugins\AsientosPredefinidos\Lib;
2121

2222
use FacturaScripts\Core\Base\DataBase;
23-
use FacturaScripts\Core\Base\DataBase\DataBaseWhere;
23+
use FacturaScripts\Core\Where;
2424
use FacturaScripts\Core\Tools;
2525
use FacturaScripts\Dinamic\Lib\CodePatterns;
2626
use FacturaScripts\Dinamic\Model\Asiento;
@@ -216,12 +216,14 @@ protected static function subcuentaReplace(string $codsubcuenta, array $variable
216216
$subcuenta->codejercicio = $codejercicio; // necesario para transformCodsubcuenta()
217217
$valorFinal = $subcuenta->transformCodsubcuenta($valor);
218218
$where = [
219-
new DataBaseWhere('codejercicio', $codejercicio),
220-
new DataBaseWhere('codsubcuenta', $valorFinal) // transforma el punto en ceros
219+
Where::eq('codejercicio', $codejercicio),
220+
Where::eq('codsubcuenta', $valorFinal) // transforma el punto en ceros
221221
];
222222
if (false === $subcuenta->loadFromCode('', $where)) {
223223
Tools::log()->warning('subaccount-not-found', ['%subAccountCode%' => $valorFinal]);
224224
}
225225
return $subcuenta;
226226
}
227227
}
228+
229+

Model/AsientoPredefinido.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
namespace FacturaScripts\Plugins\AsientosPredefinidos\Model;
2121

22-
use FacturaScripts\Core\Base\DataBase\DataBaseWhere;
22+
use FacturaScripts\Core\Where;
2323
use FacturaScripts\Core\Template\ModelClass;
2424
use FacturaScripts\Core\Template\ModelTrait;
2525
use FacturaScripts\Core\Tools;
@@ -57,7 +57,7 @@ public function generate(array $form): Asiento
5757
public function getLines(): array
5858
{
5959
$line = new AsientoPredefinidoLinea();
60-
$where = [new DataBaseWhere("idasientopre", $this->id)];
60+
$where = [Where::eq("idasientopre", $this->id)];
6161
return $line->all($where);
6262
}
6363

@@ -69,7 +69,7 @@ public function getLines(): array
6969
public function getVariables(): array
7070
{
7171
$variable = new AsientoPredefinidoVariable();
72-
$where = [new DataBaseWhere("idasientopre", $this->id)];
72+
$where = [Where::eq("idasientopre", $this->id)];
7373
return $variable->all($where);
7474
}
7575

@@ -96,3 +96,5 @@ public function url(string $type = 'auto', string $list = 'ListAsiento?activetab
9696
return parent::url($type, $list);
9797
}
9898
}
99+
100+

0 commit comments

Comments
 (0)