Only create a Stripe Expense if client pays fee is off, a stripe expense vendor and expense category is selected in settings

This commit is contained in:
johnnyq 2024-01-28 14:54:28 -05:00
parent 063d042378
commit 9bd924dc67
1 changed files with 4 additions and 1 deletions

View File

@ -279,7 +279,10 @@ if (isset($_GET['invoice_id'], $_GET['url_key']) && !isset($_GET['payment_intent
if ($config_stripe_client_pays_fees == 1) {
// Calculate the amount to charge the client
$balance_to_pay = ($balance_to_pay + $config_stripe_flat_fee) / (1 - $config_stripe_percentage_fee);
} else {
}
// Check to see if Expense Fields are configured and client pays fee is off then create expense
if ($config_stripe_client_pays_fees == 0 && $config_stripe_expense_vendor > 0 && $config_stripe_expense_category > 0) {
$balance_before_fees = $balance_to_pay;
// Calculate the amount to charge the client
$balance_to_not_pay = ($balance_to_pay + $config_stripe_flat_fee) / (1 - $config_stripe_percentage_fee);