Fix invoice
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
eea85c9da4
commit
7fc17244fd
|
|
@ -42,9 +42,7 @@ class MassStoreAction
|
||||||
->year($year);
|
->year($year);
|
||||||
|
|
||||||
$invoice = Invoice::createFromFactory($factory);
|
$invoice = Invoice::createFromFactory($factory);
|
||||||
$invoice->save();
|
$invoices->push($invoice);
|
||||||
$invoice->positions()->createMany($invoice->positions->toArray());
|
|
||||||
$invoices->push($invoice->fresh('positions'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
event(new InvoicesMassStored($year, $invoices));
|
event(new InvoicesMassStored($year, $invoices));
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,8 @@ class Invoice extends Model
|
||||||
'usage' => $factory->getUsage(),
|
'usage' => $factory->getUsage(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$invoice->setRelation('positions', $factory->getPositions()->toArray());
|
$invoice->save();
|
||||||
|
$invoice->positions()->createMany($factory->getPositions()->toArray());
|
||||||
|
|
||||||
return $invoice;
|
return $invoice;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue