1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-08 23:58:42 +01:00

Fix emissione fatture da bulk

This commit is contained in:
MatteoPistorello 2022-12-07 16:25:35 +01:00
parent c4b720a7bc
commit dd73099b14

View File

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