diff --git a/packages/Webkul/CustomerCreditMax/src/Listeners/Cart.php b/packages/Webkul/CustomerCreditMax/src/Listeners/Cart.php index 1046067b5..c408c5ec6 100644 --- a/packages/Webkul/CustomerCreditMax/src/Listeners/Cart.php +++ b/packages/Webkul/CustomerCreditMax/src/Listeners/Cart.php @@ -56,7 +56,7 @@ class Cart $baseGrandTotal = $this->orderRepository->scopeQuery(function ($query) { return $query - ->where('orders.customer_id', '=', $this->getCurrentCustomerGuard()->user()->id) + ->where('orders.customer_id', $this->getCurrentCustomerGuard()->user()->id) ->where('orders.status', '<>', 'canceled'); })->sum('base_grand_total'); @@ -66,7 +66,7 @@ class Cart ->where('orders.status', '<>', 'canceled'); })->sum('base_grand_total_invoiced'); - if ( ($baseGrandTotal - $baseGrandTotalInvoiced) >= (core()->getConfigData('customer.settings.credit_max.amount') - ($baseGrandTotal - $baseGrandTotalInvoiced))) - throw new \Exception('You available credit limit has been exceeded. Please you pay your pending invoice.'); + if ( ($baseGrandTotal - $baseGrandTotalInvoiced) >= core()->getConfigData('customer.settings.credit_max.amount')) + throw new \Exception('You available credit limit has been exceeded. Please pay your pending invoice.'); } } \ No newline at end of file