From 2cd5d2d68a0782fc61e7e582a6cde900ff063f28 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 7 Jan 2021 10:18:57 +1100 Subject: [PATCH] Minor fixes for credit_payments in CP --- app/Console/Commands/CreateSingleAccount.php | 2 +- app/Http/Controllers/ClientPortal/PaymentController.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/CreateSingleAccount.php b/app/Console/Commands/CreateSingleAccount.php index 4e3e88fb9558..881542cf0758 100644 --- a/app/Console/Commands/CreateSingleAccount.php +++ b/app/Console/Commands/CreateSingleAccount.php @@ -227,7 +227,7 @@ class CreateSingleAccount extends Command $settings = $client->settings; $settings->currency_id = "1"; - $settings->use_credits_payment = "always"; +// $settings->use_credits_payment = "always"; $client->settings = $settings; diff --git a/app/Http/Controllers/ClientPortal/PaymentController.php b/app/Http/Controllers/ClientPortal/PaymentController.php index ecf65659aa07..4ac2e8d4ba35 100644 --- a/app/Http/Controllers/ClientPortal/PaymentController.php +++ b/app/Http/Controllers/ClientPortal/PaymentController.php @@ -205,6 +205,9 @@ class PaymentController extends Controller $credit_totals = $first_invoice->client->getSetting('use_credits_payment') == 'off' ? 0 : $first_invoice->client->service()->getCreditBalance(); $starting_invoice_amount = $first_invoice->amount; +nlog($credit_totals); +nlog($first_invoice->client->getSetting('use_credits_payment')); + if ($gateway) { $first_invoice->service()->addGatewayFee($gateway, $payment_method_id, $invoice_totals)->save(); }