Update modules/fatture/src/Fattura.php

This commit is contained in:
Luca 2018-11-02 18:16:21 +01:00
parent 46ddf6958a
commit 421ff70be3
1 changed files with 1 additions and 1 deletions

View File

@ -127,7 +127,7 @@ class Fattura extends Model
// Recupero maschera per questo segmento
$maschera = static::getMaschera($id_segment);
$ultima_fattura = $database->fetchOne('SELECT numero FROM co_documenti WHERE YEAR(data) = :year AND id_segment = :id_segment '.(($direzione == 'uscita') ? 'ORDER BY numero DESC' : static::getMascheraOrder($maschera)), [
$ultima_fattura = $database->fetchOne('SELECT numero FROM co_documenti WHERE YEAR(data) = :year AND id_segment = :id_segment '.(($direzione == 'uscita') ? 'ORDER BY CAST(numero AS UNSIGNED) DESC' : static::getMascheraOrder($maschera)), [
':year' => date('Y', strtotime($data)),
':id_segment' => $id_segment,
]);