Skip to content

Commit aaad744

Browse files
fix: fatturazione da bulk documenti
1 parent 00bb47d commit aaad744

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

modules/contratti/bulk.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
// Informazioni della fattura
5454
$tipo_documento = Tipo::where('id', post('idtipodocumento'))->first();
5555

56-
$stato_documenti_accodabili = Stato::where('name', 'Bozza')->first()->id;
56+
$stato_documenti_accodabili = Stato::where('name', 'Bozza')->first();
5757
$accodare = post('accodare');
5858

5959
$data = date('Y-m-d');
@@ -89,12 +89,12 @@
8989
$fattura = Fattura::where('idanagrafica', $id_anagrafica)
9090
->where('idstatodocumento', $stato_documenti_accodabili->id)
9191
->where('idtipodocumento', $tipo_documento->id)
92+
->where('idsede', $id_sede)
9293
->first();
9394
} else {
9495
$fattura = Fattura::where('idanagrafica', $id_anagrafica)
9596
->where('idstatodocumento', $stato_documenti_accodabili->id)
96-
->where('idtipodocumento', $tipo_standard->id)
97-
->where('idsede', $id_sede)
97+
->where('idtipodocumento', $tipo_documento->id)
9898
->first();
9999
}
100100

modules/ddt/bulk.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
// Informazioni della fattura
5757
$tipo_documento = Tipo::where('id', post('idtipodocumento'))->first();
5858

59-
$stato_documenti_accodabili = Stato::where('name', 'Bozza')->first()->id;
59+
$stato_documenti_accodabili = Stato::where('name', 'Bozza')->first();
6060
$accodare = post('accodare');
6161

6262
$data = date('Y-m-d');
@@ -94,7 +94,7 @@
9494
} else {
9595
$fattura = Fattura::where('idanagrafica', $id_anagrafica)
9696
->where('idstatodocumento', $stato_documenti_accodabili->id)
97-
->where('idtipodocumento', $tipo_standard->id)
97+
->where('idtipodocumento', $tipo_documento->id)
9898
->first();
9999
}
100100

modules/ordini/bulk.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
$tipo_documento = TipoFattura::where('id', post('idtipodocumento'))->first();
5252

53-
$stato_documenti_accodabili = Stato::where('name', 'Bozza')->first()->id;
53+
$stato_documenti_accodabili = Stato::where('name', 'Bozza')->first();
5454
$accodare = post('accodare');
5555

5656
$data = date('Y-m-d');
@@ -84,12 +84,12 @@
8484
$fattura = Fattura::where('idanagrafica', $id_anagrafica)
8585
->where('idstatodocumento', $stato_documenti_accodabili->id)
8686
->where('idtipodocumento', $tipo_documento->id)
87+
->where('idsede', $id_sede)
8788
->first();
8889
} else {
8990
$fattura = Fattura::where('idanagrafica', $id_anagrafica)
9091
->where('idstatodocumento', $stato_documenti_accodabili->id)
91-
->where('idtipodocumento', $tipo_standard->id)
92-
->where('idsede', $id_sede)
92+
->where('idtipodocumento', $tipo_documento->id)
9393
->first();
9494
}
9595

modules/preventivi/bulk.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
// Informazioni della fattura
4949
$tipo_documento = Tipo::where('id', post('idtipodocumento'))->first();
5050

51-
$stato_documenti_accodabili = StatoFattura::where('name', 'Bozza')->first()->id;
51+
$stato_documenti_accodabili = StatoFattura::where('name', 'Bozza')->first();
5252
$accodare = post('accodare');
5353

5454
$data = date('Y-m-d');
@@ -85,12 +85,12 @@
8585
$fattura = Fattura::where('idanagrafica', $id_anagrafica)
8686
->where('idstatodocumento', $stato_documenti_accodabili->id)
8787
->where('idtipodocumento', $tipo_documento->id)
88+
->where('idsede', $id_sede)
8889
->first();
8990
} else {
9091
$fattura = Fattura::where('idanagrafica', $id_anagrafica)
9192
->where('idstatodocumento', $stato_documenti_accodabili->id)
92-
->where('idtipodocumento', $tipo_standard->id)
93-
->where('idsede', $id_sede)
93+
->where('idtipodocumento', $tipo_documento->id)
9494
->first();
9595
}
9696

0 commit comments

Comments
 (0)