Fix emissione fatture da bulk

This commit is contained in:
MatteoPistorello 2022-12-07 16:25:35 +01:00
parent c4b720a7bc
commit dd73099b14
1 changed files with 6 additions and 2 deletions

View File

@ -459,9 +459,13 @@ switch (post('op')) {
case 'change-stato':
$list = [];
$new_stato = Stato::where('descrizione', 'Emessa')->first();
$fatture = Fattura::vendita()
->whereIn('id', $id_records)
->orderBy('data')
->get();
foreach ($id_records as $id) {
$fattura = Fattura::find($id);
foreach ($fatture as $fattura) {
$fattura = Fattura::find($fattura['id']);
$stato_precedente = Stato::find($fattura->idstatodocumento);
if ($stato_precedente->descrizione == 'Bozza' && $fattura->isFiscale()) {