diff --git a/app/Helpers/Invoice/InvoiceItemSum.php b/app/Helpers/Invoice/InvoiceItemSum.php index c7d444b9c522..50bb29fd0859 100644 --- a/app/Helpers/Invoice/InvoiceItemSum.php +++ b/app/Helpers/Invoice/InvoiceItemSum.php @@ -399,8 +399,11 @@ class InvoiceItemSum $item_tax = 0; - //$amount = $this->item->line_total - ($this->item->line_total * ($this->invoice->discount / $this->sub_total)); - $amount = ($this->sub_total > 0) ? $this->item->line_total - ($this->invoice->discount * ($this->item->line_total / $this->sub_total)) : 0; + // $amount = $this->item->line_total - ($this->item->line_total * ($this->invoice->discount / $this->sub_total)); + if($this->invoice->discount > 0) + $amount = ($this->sub_total > 0) ? $this->item->line_total - ($this->invoice->discount * ($this->item->line_total / $this->sub_total)) : 0; + else + $amount = $this->item->line_total - ($this->item->line_total * ($this->invoice->discount / $this->sub_total)); $item_tax_rate1_total = $this->calcAmountLineTax($this->item->tax_rate1, $amount); diff --git a/app/PaymentDrivers/GoCardless/DirectDebit.php b/app/PaymentDrivers/GoCardless/DirectDebit.php index f27696d8627d..c99ef060d10f 100644 --- a/app/PaymentDrivers/GoCardless/DirectDebit.php +++ b/app/PaymentDrivers/GoCardless/DirectDebit.php @@ -108,7 +108,8 @@ class DirectDebit implements MethodInterface $response = $this->go_cardless->gateway->billingRequests()->create([ "params" => [ "mandate_request" => [ - "currency" => auth()->guard('contact')->user()->client->currency()->code + "currency" => auth()->guard('contact')->user()->client->currency()->code, + "verify" => "recommended" ] ] ]);