mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-26 16:04:05 +00:00
account-statement-pagination
This commit is contained in:
@@ -20,6 +20,22 @@ class PaymentTransactionResource extends JsonResource
|
||||
{
|
||||
|
||||
$booking = in_array((int)$this->type, [TransactionType::BILL, TransactionType::REFUND])? $this->owner->owner : $this->owner;
|
||||
$current_running_balance = $request['running_balance'];
|
||||
|
||||
switch((int) $this->type){
|
||||
case 1:
|
||||
$request['running_balance'] = bcadd($request['running_balance'], $this->amount, 7);
|
||||
break;
|
||||
case 2:
|
||||
$request['running_balance'] = bcsub($request['running_balance'], $this->amount / $this->currency_rate + $this->service_charge, 7);
|
||||
break;
|
||||
case 5:
|
||||
$request['running_balance'] = bcsub($request['running_balance'], $this->amount, 7);
|
||||
break;
|
||||
case 9:
|
||||
$request['running_balance'] = bcsub($request['running_balance'], $this->amount, 7);
|
||||
break;
|
||||
}
|
||||
|
||||
$booking_marking = '';
|
||||
switch ($this->owner_type) {
|
||||
@@ -43,6 +59,7 @@ class PaymentTransactionResource extends JsonResource
|
||||
'issuer_id' => $this->issuerCompany->id,
|
||||
'amount' => (double) $this->amount,
|
||||
'original_amount' => (double) $this->original_amount,
|
||||
'running_balance' => (double) $current_running_balance,
|
||||
'currency' => new CurrencyResource($this->currency),
|
||||
'original_currency' => new CurrencyResource($this->original_currency),
|
||||
'service_charge' => (double) $this->service_charge,
|
||||
|
||||
Reference in New Issue
Block a user