make due date as paid date

This commit is contained in:
denisdulici
2020-01-22 19:03:55 +03:00
parent bd71e2517f
commit c64dfdac1e
3 changed files with 7 additions and 2 deletions

View File

@ -132,7 +132,9 @@ $factory->afterCreating(Bill::class, function ($bill, $faker) use ($company) {
$updated_bill = dispatch_now(new UpdateBill($bill, $request));
if (in_array($bill->status, ['partial', 'paid'])) {
$payment_request = [];
$payment_request = [
'paid_at' => $bill->due_at,
];
if ($bill->status == 'partial') {
$payment_request['amount'] = (double) $amount / 2;