1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-17 03:51:06 +01:00

Fix duplicazione fattura senza numero

This commit is contained in:
Thomas Zilio 2020-03-02 17:16:33 +01:00
parent 5be7d7566e
commit e81b4740e9

View File

@ -223,9 +223,10 @@ switch (post('op')) {
$new = $fattura->replicate();
$new->numero = Fattura::getNextNumero($new->data, $new->direzione, $new->id_segment);
if ($new->direzione == 'entrata') {
if (!empty($fattura->numero_esterno)) {
$new->numero_esterno = Fattura::getNextNumeroSecondario($new->data, $new->direzione, $new->id_segment);
}
$new->stato()->associate($stato);
$new->save();