From b0d5117a0f9539288a84b8e95cc98febd02eba2e Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 9 Mar 2022 12:31:54 +1100 Subject: [PATCH] Sort order or payment methods --- app/Models/Client.php | 2 +- app/Services/Invoice/AutoBillInvoice.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Models/Client.php b/app/Models/Client.php index 28727d9f3673..da37ade5773b 100644 --- a/app/Models/Client.php +++ b/app/Models/Client.php @@ -153,7 +153,7 @@ class Client extends BaseModel implements HasLocalePreference public function gateway_tokens() { - return $this->hasMany(ClientGatewayToken::class); + return $this->hasMany(ClientGatewayToken::class)->orderBy('is_default', 'ASC'); } public function expenses() diff --git a/app/Services/Invoice/AutoBillInvoice.php b/app/Services/Invoice/AutoBillInvoice.php index 4fe87c4ec4e0..37467098e17a 100644 --- a/app/Services/Invoice/AutoBillInvoice.php +++ b/app/Services/Invoice/AutoBillInvoice.php @@ -189,8 +189,8 @@ class AutoBillInvoice extends AbstractService ->adjustCreditBalance($amount * -1) ->save(); - $this->invoice->ledger() - ->updateInvoiceBalance($amount * -1, "Invoice {$this->invoice->number} payment using Credit {$current_credit->number}") + $this->invoice->ledger() //09-03-2022 + // ->updateInvoiceBalance($amount * -1, "Invoice {$this->invoice->number} payment using Credit {$current_credit->number}") ->updateCreditBalance($amount * -1, "Credit {$current_credit->number} used to pay down Invoice {$this->invoice->number}") ->save();