1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-26 00:07:47 +01:00

Update modules/fatture/src/Fattura.php

This commit is contained in:
Luca 2018-11-02 18:16:21 +01:00
parent 46ddf6958a
commit 421ff70be3

View File

@ -127,7 +127,7 @@ class Fattura extends Model
// Recupero maschera per questo segmento // Recupero maschera per questo segmento
$maschera = static::getMaschera($id_segment); $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)), ':year' => date('Y', strtotime($data)),
':id_segment' => $id_segment, ':id_segment' => $id_segment,
]); ]);