Comparar glosa en 75%
This commit is contained in:
@ -72,10 +72,11 @@ class Movimiento extends Ideal\Repository
|
||||
}
|
||||
public function fetchByCuentaAndFechaAndGlosaAndCargoAndAbonoAndSaldo(int $cuenta_id, DateTimeInterface $fecha, string $glosa, int $cargo, int $abono, int $saldo): Model\Contabilidad\Movimiento
|
||||
{
|
||||
$len = (int) round(strlen($glosa) * .75);
|
||||
$query = $this->connection->getQueryBuilder()
|
||||
->select()
|
||||
->from($this->getTable())
|
||||
->where('cuenta_id = ? AND fecha = ? AND LOWER(glosa) = LOWER(?) AND cargo = ? AND abono = ? AND saldo = ?');
|
||||
->where("cuenta_id = ? AND fecha = ? AND SUBSTRING(LOWER(LTRIM(glosa)), 0, {$len}) = SUBSTRING(LOWER(LTRIM(?)), 0, {$len}) AND cargo = ? AND abono = ? AND saldo = ?");
|
||||
return $this->fetchOne($query, [$cuenta_id, $fecha->format('Y-m-d'), $glosa, $cargo, $abono, $saldo]);
|
||||
}
|
||||
public function fetchAmountStartingFrom(int $start, int $amount): array
|
||||
|
Reference in New Issue
Block a user