This commit is contained in:
Luca 2018-10-25 12:34:18 +02:00
parent 94ca505c02
commit dddb24dd53
2 changed files with 4 additions and 4 deletions

View File

@ -129,11 +129,11 @@ class Fattura extends Model
$maschera = static::getMaschera($id_segment);
$ultima_fattura = $database->fetchOne('SELECT numero FROM co_documenti WHERE YEAR(data) = :year AND id_segment = :id_segment '.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 numero DESC' : static::getMascheraOrder($maschera)), [
':year' => date('Y', strtotime($data)),
':id_segment' => $id_segment,
]);
$numero = Generator::generate($maschera, $ultima_fattura['numero']);
return $numero;

View File

@ -43,11 +43,11 @@ class Mail extends PHPMailer\PHPMailer\PHPMailer
$result = MailAccount::get($account);
/*if (empty($return)) {
if (empty($result)) {
$result = $accounts->first(function ($item) {
return !empty($item->predefined);
});
}*/
}
return $result;
}