Fixes for regressions

This commit is contained in:
David Bomba 2020-09-22 16:11:32 +10:00
parent 8d3154a149
commit 10d62f23f8
2 changed files with 3 additions and 2 deletions

View File

@ -57,7 +57,7 @@ class AppServiceProvider extends ServiceProvider
{ {
Relation::morphMap([ Relation::morphMap([
'invoices' => \App\Models\Invoice::class, 'invoices' => \App\Models\Invoice::class,
'credits' => \App\Models\Credit::class, // 'credits' => \App\Models\Credit::class,
'proposals' => \App\Models\Proposal::class, 'proposals' => \App\Models\Proposal::class,
]); ]);

View File

@ -18,6 +18,7 @@ use App\Factory\InvoiceItemFactory;
use App\Factory\PaymentFactory; use App\Factory\PaymentFactory;
use App\Helpers\Invoice\InvoiceSum; use App\Helpers\Invoice\InvoiceSum;
use App\Models\Client; use App\Models\Client;
use App\Models\Credit;
use App\Models\Invoice; use App\Models\Invoice;
use App\Models\Payment; use App\Models\Payment;
use App\Models\Paymentable; use App\Models\Paymentable;
@ -102,7 +103,7 @@ class HandleReversal extends AbstractService
$payment->credits()->save($credit); $payment->credits()->save($credit);
$paymentable_credit = $payment->credits() $paymentable_credit = $payment->credits()
->wherePaymentableType('credits') ->wherePaymentableType(Credit::class)
->wherePaymentableId($credit->id) ->wherePaymentableId($credit->id)
->first(); ->first();