Skip to content

Commit 9e6cacf

Browse files
committed
fix: generazione numero protocollo fattura in base alla data di competenza
1 parent 8f3c2c1 commit 9e6cacf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

modules/fatture/src/Fattura.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ public function setIdSegmentAttribute($value)
244244
// Calcolo dei numeri fattura
245245
if ($value != $previous) {
246246
$direzione = $this->tipo->dir;
247-
$data = $this->data_registrazione;
247+
$data = $this->data_competenza;
248248

249249
$this->numero = static::getNextNumero($data, $direzione, $value);
250250

@@ -876,7 +876,7 @@ public static function getNextNumero($data, $direzione, $id_segment)
876876
$maschera = Generator::getMaschera($id_segment);
877877

878878
$ultimo = Generator::getPreviousFrom($maschera, 'co_documenti', 'numero', [
879-
'YEAR(data_registrazione) = '.prepare(date('Y', strtotime($data))),
879+
'YEAR(data_competenza) = '.prepare(date('Y', strtotime($data))),
880880
'id_segment = '.prepare($id_segment),
881881
]);
882882
$numero = Generator::generate($maschera, $ultimo, 1, Generator::dateToPattern($data));

0 commit comments

Comments
 (0)