mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 04:14:04 +00:00
change billingcharge rate and tax rate table to double. Modify Customer calculation table
This commit is contained in:
@@ -11,6 +11,8 @@ use App\UserBankSlip;
|
||||
use App\User;
|
||||
use App\Invoice;
|
||||
use App\SettingCredit;
|
||||
use App\SettingTaxRate;
|
||||
use App\SettingBillingCharge;
|
||||
use Auth;
|
||||
use Validator;
|
||||
use DateTime;
|
||||
@@ -545,6 +547,8 @@ class BookingController extends Controller
|
||||
$china_beneficiary = $request->input('china_beneficiary');
|
||||
$rates = Rate::orderby('updated_at','desc')->first();
|
||||
$marking = $user = Auth::user()->marking;
|
||||
$taxrate = SettingTaxRate::latest()->first()->tax_rate;
|
||||
$billingChargeRate = SettingBillingCharge::latest()->first()->billing_charge_rate;
|
||||
|
||||
$creditLimit = SettingCredit::orderby('updated_at','desc')->first();
|
||||
|
||||
@@ -595,18 +599,24 @@ class BookingController extends Controller
|
||||
} else {
|
||||
$svcharge = 20.00;
|
||||
}
|
||||
|
||||
$bankin_amount = round(($amount + $svcharge) / $rate + (0 * ($amount + $svcharge)), 2);
|
||||
|
||||
$subtotal = ($amount + $svcharge) / $rate + (0 * ($amount + $svcharge));
|
||||
$taxAmount = round($subtotal * $taxrate,2);
|
||||
$billingChargeAmount = round(($amount + $svcharge) * $billingChargeRate, 2);
|
||||
$bankin_amount = round($subtotal + $taxAmount + $billingChargeAmount , 2);
|
||||
|
||||
return response()->json([
|
||||
'date' => date('Y-m-d'),
|
||||
'marking' => $marking,
|
||||
'amount' => $amount,
|
||||
'payment_method' => $payment_method,
|
||||
'china_beneficary' => $china_beneficiary,
|
||||
'amount' => $amount,
|
||||
'service_charge' => $svcharge,
|
||||
'rate' => $rate,
|
||||
'subtotal' => $subtotal,
|
||||
'taxAmount' => $taxAmount,
|
||||
'billingChargeAmount' => $billingChargeAmount,
|
||||
'bankin_amount' => $bankin_amount,
|
||||
'china_beneficary' => $china_beneficiary
|
||||
], 200);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user