mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-03-09 15:50:14 +01:00
fix: generazione numero protocollo fattura in base alla data di competenza
This commit is contained in:
parent
8f3c2c1b00
commit
9e6cacfb25
@ -244,7 +244,7 @@ class Fattura extends Document
|
|||||||
// Calcolo dei numeri fattura
|
// Calcolo dei numeri fattura
|
||||||
if ($value != $previous) {
|
if ($value != $previous) {
|
||||||
$direzione = $this->tipo->dir;
|
$direzione = $this->tipo->dir;
|
||||||
$data = $this->data_registrazione;
|
$data = $this->data_competenza;
|
||||||
|
|
||||||
$this->numero = static::getNextNumero($data, $direzione, $value);
|
$this->numero = static::getNextNumero($data, $direzione, $value);
|
||||||
|
|
||||||
@ -876,7 +876,7 @@ class Fattura extends Document
|
|||||||
$maschera = Generator::getMaschera($id_segment);
|
$maschera = Generator::getMaschera($id_segment);
|
||||||
|
|
||||||
$ultimo = Generator::getPreviousFrom($maschera, 'co_documenti', 'numero', [
|
$ultimo = Generator::getPreviousFrom($maschera, 'co_documenti', 'numero', [
|
||||||
'YEAR(data_registrazione) = '.prepare(date('Y', strtotime($data))),
|
'YEAR(data_competenza) = '.prepare(date('Y', strtotime($data))),
|
||||||
'id_segment = '.prepare($id_segment),
|
'id_segment = '.prepare($id_segment),
|
||||||
]);
|
]);
|
||||||
$numero = Generator::generate($maschera, $ultimo, 1, Generator::dateToPattern($data));
|
$numero = Generator::generate($maschera, $ultimo, 1, Generator::dateToPattern($data));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user