mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
30 lines
1.2 KiB
PHP
30 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Bookings\Services;
|
|
|
|
|
|
use App\Classes\Modules\Bookings\DataTransferObjects\CalculationObject;
|
|
use App\Http\Resources\BankResource;
|
|
use App\Models\Bank;
|
|
use Carbon\Carbon;
|
|
|
|
class GeneratesBookingQuotation
|
|
{
|
|
|
|
public function execute(CalculationObject $calculationObject, ?int $paymentAttemptLimit = 0){
|
|
return [
|
|
'bank' => new BankResource(Bank::find($calculationObject->getConfigurations()->getBankId())),
|
|
'rate' => $calculationObject->getConfigurations()->getRate(),
|
|
'local_total' => $calculationObject->getLocalTotal(),
|
|
'foreign_total' => $calculationObject->getForeignTotal(),
|
|
'conversion_amount' => $calculationObject->getConversionTotal(),
|
|
'service_charge' => $calculationObject->getServiceCharge(),
|
|
'tax_total' => $calculationObject->getTax(),
|
|
'tax' => $calculationObject->getConfigurations()->getTax(),
|
|
'sub_total' => $calculationObject->getSubTotal(),
|
|
'total' => $calculationObject->getTotal(),
|
|
'date' => Carbon::now()->timezone('Asia/Singapore')->format('h:i a, jS M, Y \G\M\T T'),
|
|
'payment_attempt_limit' => $paymentAttemptLimit
|
|
];
|
|
}
|
|
} |