FIX: findPago sin numero
This commit is contained in:
@ -142,6 +142,9 @@ class Search
|
||||
}
|
||||
protected function findPago(string $query): array
|
||||
{
|
||||
if ($query != 0) {
|
||||
return [];
|
||||
}
|
||||
$methods = [
|
||||
'findPie',
|
||||
'findEscritura',
|
||||
@ -152,7 +155,7 @@ class Search
|
||||
$valor = str_replace(['$', '.', ','], ['', '', '.'], $query);
|
||||
$pagos = [];
|
||||
try {
|
||||
$pagos = $this->pagoRepository->fetchByValue($valor);
|
||||
$pagos = $this->pagoRepository->fetchByValue((int) $valor);
|
||||
} catch (EmptyResult) {}
|
||||
$results = [];
|
||||
foreach ($methods as $method) {
|
||||
@ -164,7 +167,7 @@ class Search
|
||||
{
|
||||
$results = [];
|
||||
try {
|
||||
$pies = $this->pieRepository->fetchByValue($query);
|
||||
$pies = $this->pieRepository->fetchByValue((float) $query);
|
||||
foreach ($pies as $pie) {
|
||||
try {
|
||||
$this->add($results, [$this->ventaRepository->fetchIdByPie($pie->id)]);
|
||||
@ -180,7 +183,7 @@ class Search
|
||||
$results = [];
|
||||
foreach ($pagos as $pago) {
|
||||
try {
|
||||
$pie = $this->pieRepository->fetchByReajuste($pago->id);
|
||||
$pie = $this->pieRepository->fetchByReajuste((int) $pago->id);
|
||||
$this->add($results, [$this->ventaRepository->fetchIdByPie($pie->id)]);
|
||||
} catch (EmptyResult) {}
|
||||
}
|
||||
@ -201,7 +204,7 @@ class Search
|
||||
{
|
||||
$results = [];
|
||||
try {
|
||||
$escrituras = $this->escrituraRepository->fetchByValue($query);
|
||||
$escrituras = $this->escrituraRepository->fetchByValue((int) $query);
|
||||
foreach ($escrituras as $escritura) {
|
||||
try {
|
||||
$this->add($results, [$this->ventaRepository->fetchIdByEscritura($escritura->id)]);
|
||||
@ -231,7 +234,7 @@ class Search
|
||||
{
|
||||
$results = [];
|
||||
try {
|
||||
$creditos = $this->creditoRepository->fetchByValue($query);
|
||||
$creditos = $this->creditoRepository->fetchByValue((int) $query);
|
||||
foreach ($creditos as $credito) {
|
||||
try {
|
||||
$this->add($results, [$this->ventaRepository->fetchIdByCredito($credito->id)]);
|
||||
@ -256,7 +259,7 @@ class Search
|
||||
{
|
||||
$results = [];
|
||||
try {
|
||||
$bonos = $this->bonoPieRepository->fetchByValue($query);
|
||||
$bonos = $this->bonoPieRepository->fetchByValue((float) $query);
|
||||
foreach ($bonos as $bono) {
|
||||
try {
|
||||
$this->add($results, [$this->ventaRepository->fetchIdByBono($bono->id)]);
|
||||
|
Reference in New Issue
Block a user