mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 04:14:04 +00:00
fix billing charge for x2 to 0
This commit is contained in:
@@ -293,33 +293,34 @@ class BookingController extends Controller
|
||||
break;
|
||||
}
|
||||
|
||||
// Service charge (RMB) : if amount higher than 10,000, no service charge. if amount lower than 10,000, 20.00 service charge
|
||||
// Service charge (RMB) : if amount higher than 10,000 or term x2 no service charge.
|
||||
if ($amount >= 10000 && ($term == 'x2_cash' || $term == 'x2_cheque' || $term == 'x2_ba')) {
|
||||
$svcharge = 0;
|
||||
} else {
|
||||
$svcharge = 20.00;
|
||||
}
|
||||
|
||||
$subtotal = round(($amount + $svcharge) / $rate,2);
|
||||
$subtotal = round(($amount + $svcharge) / $rate, 2);
|
||||
|
||||
// TODO : refactor
|
||||
if ($taxrate !=0){
|
||||
$taxAmount = round($subtotal * $taxrate - $subtotal,2);
|
||||
$taxAmount = round($subtotal * $taxrate - $subtotal, 2);
|
||||
}
|
||||
else{
|
||||
$taxAmount = 0;
|
||||
}
|
||||
|
||||
if ($billingChargeRate !=0){
|
||||
$billingChargeAmount = round(($amount + $svcharge) * $billingChargeRate - ($amount + $svcharge), 2);
|
||||
if ($term == 'x2_cash' || $term == 'x2_cheque' || $term == 'x2_ba'){
|
||||
$billingChargeAmount = 0;
|
||||
}
|
||||
else{
|
||||
$billingChargeAmount = 0;
|
||||
// TODO : billing charge rate to percentage so we do not need to minus amount + svcharge
|
||||
$billingChargeAmount = round((($amount / $rate) * $billingChargeRate) - ($amount / $rate), 2);
|
||||
}
|
||||
|
||||
$billingChargeAmount = round((($amount / $rate) * $billingChargeRate) - ($amount / $rate), 2);
|
||||
|
||||
|
||||
$bankin_amount = round($subtotal + $taxAmount + $billingChargeAmount , 2);
|
||||
|
||||
$booking = new Booking();
|
||||
$booking->account_name = $request->input('account_name');
|
||||
$booking->account_num = $request->input('account_num');
|
||||
@@ -636,14 +637,14 @@ class BookingController extends Controller
|
||||
$taxAmount = 0;
|
||||
}
|
||||
|
||||
if ($billingChargeRate !=0){
|
||||
$billingChargeAmount = round(($amount + $svcharge) * $billingChargeRate - ($amount + $svcharge), 2);
|
||||
}
|
||||
else{
|
||||
if ($term == 'x2_cash' || $term == 'x2_cheque' || $term == 'x2_ba'){
|
||||
$billingChargeAmount = 0;
|
||||
}
|
||||
|
||||
$billingChargeAmount = round((($amount / $rate) * $billingChargeRate) - ($amount / $rate), 2);
|
||||
}
|
||||
else{
|
||||
// TODO : billing charge rate to percentage so we do not need to minus amount + svcharge
|
||||
$billingChargeAmount = round((($amount / $rate) * $billingChargeRate) - ($amount / $rate), 2);
|
||||
}
|
||||
|
||||
$bankin_amount = round($subtotal + $taxAmount + $billingChargeAmount , 2);
|
||||
|
||||
return response()->json([
|
||||
|
||||
Reference in New Issue
Block a user