1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Use correct formula when adjust_fee_percent=true

This commit is contained in:
David Roizenman 2020-11-12 02:53:25 -08:00
parent 0be452e144
commit 039544e753
No known key found for this signature in database
GPG Key ID: CD7B405D13E241B6

View File

@ -287,7 +287,11 @@ class CompanyGateway extends BaseModel
} }
if ($fees_and_limits->fee_percent) { if ($fees_and_limits->fee_percent) {
if ($fees_and_limits->adjust_fee_percent) {
$fee += round(($amount / (1 - $fees_and_limits->fee_percent / 100) - $amount),2);
} else {
$fee += round(($amount * $fees_and_limits->fee_percent / 100),2); $fee += round(($amount * $fees_and_limits->fee_percent / 100),2);
}
info("fee after adding fee percent = {$fee}"); info("fee after adding fee percent = {$fee}");
} }