diff --git a/app/Services/Invoice/ApplyPayment.php b/app/Services/Invoice/ApplyPayment.php index 9177e7ebd7e7..b606002084fd 100644 --- a/app/Services/Invoice/ApplyPayment.php +++ b/app/Services/Invoice/ApplyPayment.php @@ -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; } } diff --git a/app/Services/Invoice/MarkPaid.php b/app/Services/Invoice/MarkPaid.php index 6660c1a7df6c..8778a4ebd346 100644 --- a/app/Services/Invoice/MarkPaid.php +++ b/app/Services/Invoice/MarkPaid.php @@ -61,6 +61,7 @@ class MarkPaid extends AbstractService $this->invoice->service() ->updateBalance($payment->amount*-1) ->setStatus(Invoice::STATUS_PAID) + ->applyNumber() ->save(); /* Update Invoice balance */ diff --git a/database/factories/ClientFactory.php b/database/factories/ClientFactory.php index e00726d139dd..62b30fe15462 100644 --- a/database/factories/ClientFactory.php +++ b/database/factories/ClientFactory.php @@ -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' => '',