fixes for invoices not generating invoice numbers on payment

This commit is contained in:
David Bomba 2020-05-28 10:59:33 +10:00
parent 2d2be07944
commit 0485ffe912
3 changed files with 4 additions and 1 deletions

View File

@ -62,6 +62,8 @@ class ApplyPayment extends AbstractService
$this->invoice->service()->clearPartial()->setStatus(Invoice::STATUS_PARTIAL)->updateBalance($this->payment_amount*-1);
}
$this->invoice->service()->applyNumber->save();
return $this->invoice;
}
}

View File

@ -61,6 +61,7 @@ class MarkPaid extends AbstractService
$this->invoice->service()
->updateBalance($payment->amount*-1)
->setStatus(Invoice::STATUS_PAID)
->applyNumber()
->save();
/* Update Invoice balance */

View File

@ -13,7 +13,7 @@ $factory->define(App\Models\Client::class, function (Faker $faker) {
'paid_to_date' => 0,
'vat_number' => $faker->text(25),
'id_number' => '',
'custom_value1' => 'date|'.$faker->date('Y-m-d'),
'custom_value1' => $faker->date('Y-m-d'),
'custom_value2' => '',
'custom_value3' => '',
'custom_value4' => '',