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);
|
->year($year);
|
||||||
|
|
||||||
$invoice = Invoice::createFromFactory($factory);
|
$invoice = Invoice::createFromFactory($factory);
|
||||||
|
$invoice->save();
|
||||||
|
$invoice->positions()->createMany($invoice->getRelationValue('positions'));
|
||||||
$invoices->push($invoice);
|
$invoices->push($invoice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,7 @@ class Invoice extends Model
|
||||||
'usage' => $factory->getUsage(),
|
'usage' => $factory->getUsage(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$invoice->save();
|
$invoice->setRelation('positions', $factory->getPositions()->toArray());
|
||||||
$invoice->positions()->createMany($factory->getPositions()->toArray());
|
|
||||||
|
|
||||||
return $invoice;
|
return $invoice;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue