mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 21:34:35 -04:00
Merge pull request #4297 from hmnd/fix/fee-percent-calculation
(v5) Use correct formula when adjust_fee_percent=true
This commit is contained in:
commit
0c1d2b00cf
@ -287,7 +287,11 @@ class CompanyGateway extends BaseModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($fees_and_limits->fee_percent) {
|
if ($fees_and_limits->fee_percent) {
|
||||||
$fee += round(($amount * $fees_and_limits->fee_percent / 100),2);
|
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);
|
||||||
|
}
|
||||||
info("fee after adding fee percent = {$fee}");
|
info("fee after adding fee percent = {$fee}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user