Fix set relation of invoice
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
7fc17244fd
commit
1e57833724
|
|
@ -42,6 +42,8 @@ class MassStoreAction
|
|||
->year($year);
|
||||
|
||||
$invoice = Invoice::createFromFactory($factory);
|
||||
$invoice->save();
|
||||
$invoice->positions()->createMany($invoice->getRelationValue('positions'));
|
||||
$invoices->push($invoice);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,8 +50,7 @@ class Invoice extends Model
|
|||
'usage' => $factory->getUsage(),
|
||||
]);
|
||||
|
||||
$invoice->save();
|
||||
$invoice->positions()->createMany($factory->getPositions()->toArray());
|
||||
$invoice->setRelation('positions', $factory->getPositions()->toArray());
|
||||
|
||||
return $invoice;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue