mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
clean up development
This commit is contained in:
@@ -19,7 +19,7 @@ class GeneratesBookingQuotation
|
||||
$hours = $date->diffInHours($date->copy()->addMinutes($paymentAttemptLimit)->subDays($days)) ;
|
||||
$minutes = $date->diffInMinutes($date->copy()->addMinutes($paymentAttemptLimit)->subDays($days)->subHours($hours));
|
||||
|
||||
$receive_date = $currencyConversionObject ? Carbon::now()->endOfDay()->addWeekdays($currencyConversionObject->getServiceId() === 1 ? 1 : 3)->timezone('Asia/Singapore')->format('4:00 \P\M, jS M, Y \G\M\T T') : null;
|
||||
$receive_date = $currencyConversionObject ? Carbon::now()->endOfDay()->addWeekdays($currencyConversionObject->getServiceId() === 3 ? 4 : 2)->timezone('Asia/Singapore')->format('4:00 \P\M, jS M, Y \G\M\T T') : null;
|
||||
|
||||
return [
|
||||
'bank' => new BankResource(Bank::find($calculationObject->getConfigurations()->getBankId())),
|
||||
|
||||
+12
-92
@@ -3,37 +3,19 @@
|
||||
|
||||
namespace App\Classes\Modules\Transactions\ControllersLogic;
|
||||
|
||||
use DB;
|
||||
use Carbon\Carbon;
|
||||
use App\Classes\Modules\Transactions\Processors\CreateSupplierTransactionProcessor;
|
||||
use App\Models\Document;
|
||||
use Barryvdh\DomPDF\PDF;
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\SegmentConstant;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Meneses\LaravelMpdf\Facades\LaravelMpdf;
|
||||
use App\Classes\ValueObjects\Constants\DocumentType;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Classes\Modules\Documents\Services\CreatesFiles;
|
||||
use App\Classes\ValueObjects\Constants\SegmentConstants;
|
||||
use App\Classes\ValueObjects\Constants\PaymentMethodType;
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Companies\Services\FetchesCompany;
|
||||
use App\Classes\Modules\Segments\Services\FetchesConstant;
|
||||
use Meneses\LaravelLaravelMpdf\Facades\LaravelLaravelMpdf;
|
||||
use App\Classes\Modules\Documents\Services\CreatesDocument;
|
||||
use App\Classes\Modules\Transactions\Services\CreatesTransaction;
|
||||
|
||||
use App\Classes\Modules\Transactions\Services\FetchesTransaction;
|
||||
use App\Classes\Modules\Documents\DataTransferObjects\DocumentObject;
|
||||
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
|
||||
use App\Classes\Modules\Transactions\DataTransferObjects\TransactionObject;
|
||||
use App\Classes\Modules\Transactions\Services\GeneratesTransactionBillNumber;
|
||||
use App\Classes\Modules\Transactions\Services\CalculatesTransactionTransferFee;
|
||||
use App\Classes\Modules\Transactions\Services\CalculatesTransactionServiceCharge;
|
||||
|
||||
class CreateSupplierTransactionLogic extends AbstractControllerLogic
|
||||
{
|
||||
@@ -52,14 +34,8 @@ class CreateSupplierTransactionLogic extends AbstractControllerLogic
|
||||
/** @var FetchesCompany */
|
||||
private $fetchesCompany;
|
||||
|
||||
/** @var FetchesTransaction */
|
||||
private $fetchesTransaction;
|
||||
|
||||
/** @var UpdatesTransactionStatus */
|
||||
private $updatesTransactionStatus;
|
||||
|
||||
/** @var CreatesTransaction */
|
||||
private $createsTransaction;
|
||||
/** @var CreateSupplierTransactionProcessor */
|
||||
private $createSupplierTransactionProcessor;
|
||||
|
||||
/** @var CreatesDocument */
|
||||
private $createsDocument;
|
||||
@@ -67,44 +43,19 @@ class CreateSupplierTransactionLogic extends AbstractControllerLogic
|
||||
/** @var CreatesFiles */
|
||||
private $createsFile;
|
||||
|
||||
/** @var GeneratesTransactionBillNumber */
|
||||
private $generatesTransactionBillNumber;
|
||||
|
||||
/** @var CalculatesTransactionServiceCharge */
|
||||
private $calculatesTransactionServiceCharge;
|
||||
|
||||
/** @var CalculatesTransactionTransferFee */
|
||||
private $calculatesTransactionTransferFee;
|
||||
|
||||
/** @var PDF */
|
||||
private $pdf;
|
||||
|
||||
/**
|
||||
* CreateSupplierTransactionLogic constructor.
|
||||
* @param FetchesCompany $fetchesCompany
|
||||
* @param FetchesTransaction $fetchesTransaction
|
||||
* @param FetchesConstant $fetchesConstant
|
||||
* @param UpdatesTransactionStatus $updatesTransactionStatus
|
||||
* @param CreatesTransaction $createsTransaction
|
||||
* @param GeneratesTransactionBillNumber $generatesTransactionBillNumber
|
||||
* @param CalculatesTransactionServiceCharge $calculatesTransactionServiceCharge
|
||||
* @param CalculatesTransactionTransferFee $calculatesTransactionTransferFee
|
||||
* @param PDF $pdf
|
||||
* @param CreateSupplierTransactionProcessor $createSupplierTransactionProcessor
|
||||
* @param CreatesDocument $createsDocument
|
||||
* @param CreatesFiles $createsFile
|
||||
*/
|
||||
public function __construct(FetchesCompany $fetchesCompany, FetchesTransaction $fetchesTransaction, FetchesConstant $fetchesConstant, UpdatesTransactionStatus $updatesTransactionStatus, CreatesTransaction $createsTransaction, CreatesDocument $createsDocument, CreatesFiles $createsFile, GeneratesTransactionBillNumber $generatesTransactionBillNumber, CalculatesTransactionServiceCharge $calculatesTransactionServiceCharge, CalculatesTransactionTransferFee $calculatesTransactionTransferFee, PDF $pdf)
|
||||
public function __construct(FetchesCompany $fetchesCompany, CreateSupplierTransactionProcessor $createSupplierTransactionProcessor, CreatesDocument $createsDocument, CreatesFiles $createsFile)
|
||||
{
|
||||
|
||||
$this->fetchesCompany = $fetchesCompany;
|
||||
$this->fetchesTransaction = $fetchesTransaction;
|
||||
$this->fetchesConstant = $fetchesConstant;
|
||||
$this->updatesTransactionStatus = $updatesTransactionStatus;
|
||||
$this->createsTransaction = $createsTransaction;
|
||||
$this->createSupplierTransactionProcessor = $createSupplierTransactionProcessor;
|
||||
$this->createsDocument = $createsDocument;
|
||||
$this->createsFile = $createsFile;
|
||||
$this->generatesTransactionBillNumber = $generatesTransactionBillNumber;
|
||||
$this->calculatesTransactionServiceCharge = $calculatesTransactionServiceCharge;
|
||||
$this->calculatesTransactionTransferFee = $calculatesTransactionTransferFee;
|
||||
$this->pdf = $pdf;
|
||||
}
|
||||
|
||||
public function logic(Request $request) : JsonResponse
|
||||
@@ -114,44 +65,13 @@ class CreateSupplierTransactionLogic extends AbstractControllerLogic
|
||||
|
||||
$rate = $request->input('rate');
|
||||
|
||||
$transactions = collect();
|
||||
$transferFeeTransactions = collect();
|
||||
$payments = $request->input('payments');
|
||||
|
||||
foreach($request->input('payments') as $payment){
|
||||
$this->createSupplierTransactionProcessor->execute($supplier, $rate, $payments);
|
||||
|
||||
/** @var Transaction $payment */
|
||||
$payment = $this->fetchesTransaction->execute(['id' => $payment['id']]);
|
||||
|
||||
if($payment->status !== ApprovalStatus::APPROVED) continue;
|
||||
if(!count($this->createSupplierTransactionProcessor->getBills())) return $this->response([]);
|
||||
|
||||
$this->updatesTransactionStatus->execute($payment, ApprovalStatus::COMPLETED);
|
||||
$billNumber = $this->generatesTransactionBillNumber->execute('SPLR-');
|
||||
// $constant = $this->fetchesConstant->execute(['service_charge' => $supplier->id]);
|
||||
$constant = SegmentConstant::where('reference', SegmentConstants::SERVICE_CHARGE)->where('detail->id', $supplier->id)->first();
|
||||
$serviceCharge = $this->calculatesTransactionServiceCharge->execute($payment->original_amount, $rate, $constant ? $constant->detail->service_charge->amount : 0);
|
||||
|
||||
$object = new TransactionObject($billNumber, TransactionType::BILL, $supplier->id, 1,
|
||||
$supplier->banks()->where('default', true)->first()->id, PaymentMethodType::CASH,
|
||||
$payment->original_amount * (1 / $rate), $payment->original_amount, 1, $payment->original_currency_id,
|
||||
$rate, 0, $supplier->id == 2 ? 0 : $serviceCharge, null, ApprovalStatus::PENDING_VERIFICATION);
|
||||
|
||||
$transactions[] = $billTransaction = $this->createsTransaction->execute($payment->booking, $object);
|
||||
|
||||
$transferFeeNumber = $this->generatesTransactionBillNumber->execute('TRFR-');
|
||||
$trasferFee = $this->calculatesTransactionTransferFee->execute($payment->original_amount);
|
||||
$object = new TransactionObject($transferFeeNumber, TransactionType::TRANSFER_FEE, 1, $supplier->id,
|
||||
$supplier->banks()->where('default', true)->first()->id, PaymentMethodType::CASH,
|
||||
$payment->original_amount, $payment->original_amount, $payment->original_currency_id, $payment->original_currency_id,
|
||||
1, 0, $trasferFee, null, ApprovalStatus::PENDING_VERIFICATION);
|
||||
|
||||
$transferFeeTransactions[] = $this->createsTransaction->execute($billTransaction, $object);
|
||||
}
|
||||
|
||||
if(!count($transactions)) return $this->response([]);
|
||||
|
||||
$pdf = LaravelMpdf::loadView('pages.pdfs.currency_vendor_order', ['transactions' => $transactions, 'transferFeeTransactions' => $transferFeeTransactions, 'supplier' => $supplier]);
|
||||
|
||||
$path = Str::studly($supplier->name).'_'.Carbon::now()->format('Y_m_d_h_s_i').'.pdf';
|
||||
$pdf = LaravelMpdf::loadView('pages.pdfs.currency_vendor_order', ['transactions' => $this->createSupplierTransactionProcessor->getBills(), 'transferFeeTransactions' => $this->createSupplierTransactionProcessor->getTransferTransactions(), 'supplier' => $supplier]);
|
||||
|
||||
$object = new DocumentObject(
|
||||
DocumentType::CURRENCY_VENDOR_ORDER,
|
||||
|
||||
+27
-90
@@ -3,123 +3,60 @@
|
||||
|
||||
namespace App\Classes\Modules\Transactions\ControllersLogic;
|
||||
|
||||
// use DB;
|
||||
use App\Models\Transaction;
|
||||
use App\Classes\Modules\Transactions\Processors\CreateSupplierTransactionProcessor;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\SegmentConstant;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Meneses\LaravelMpdf\Facades\LaravelMpdf;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Classes\ValueObjects\Constants\SegmentConstants;
|
||||
use App\Classes\ValueObjects\Constants\PaymentMethodType;
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Companies\Services\FetchesCompany;
|
||||
use App\Classes\Modules\Segments\Services\FetchesConstant;
|
||||
use App\Classes\Modules\Transactions\Services\CreatesTransaction;
|
||||
|
||||
use App\Classes\Modules\Transactions\DataTransferObjects\TransactionObject;
|
||||
use App\Classes\Modules\Transactions\Services\GeneratesTransactionBillNumber;
|
||||
use App\Classes\Modules\Transactions\Services\CalculatesTransactionTransferFee;
|
||||
use App\Classes\Modules\Transactions\Services\CalculatesTransactionServiceCharge;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Meneses\LaravelMpdf\Facades\LaravelMpdf;
|
||||
use App\Classes\Modules\Companies\Services\FetchesCompany;
|
||||
use Meneses\LaravelLaravelMpdf\Facades\LaravelLaravelMpdf;
|
||||
|
||||
|
||||
class DownloadMockUpWhiteFormPdfLogic extends AbstractControllerLogic
|
||||
class DownloadMockUpWhiteFormPdfLogic
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification():array {
|
||||
return [
|
||||
'title' => 'Create Mock Up White Form',
|
||||
'message' => 'You have successfully created Mock Up White Form'
|
||||
];
|
||||
}
|
||||
|
||||
/** @var FetchesCompany */
|
||||
private $fetchesCompany;
|
||||
|
||||
/** @var CreatesTransaction */
|
||||
private $createsTransaction;
|
||||
|
||||
/** @var GeneratesTransactionBillNumber */
|
||||
private $generatesTransactionBillNumber;
|
||||
|
||||
/** @var CalculatesTransactionServiceCharge */
|
||||
private $calculatesTransactionServiceCharge;
|
||||
|
||||
/** @var CalculatesTransactionTransferFee */
|
||||
private $calculatesTransactionTransferFee;
|
||||
/** @var CreateSupplierTransactionProcessor */
|
||||
private $createSupplierTransactionProcessor;
|
||||
|
||||
/**
|
||||
* CreateSupplierTransactionLogic constructor.
|
||||
* DownloadMockUpWhiteFormPdfLogic constructor.
|
||||
* @param FetchesCompany $fetchesCompany
|
||||
* @param FetchesConstant $fetchesConstant
|
||||
* @param CreatesTransaction $createsTransaction
|
||||
* @param GeneratesTransactionBillNumber $generatesTransactionBillNumber
|
||||
* @param CalculatesTransactionServiceCharge $calculatesTransactionServiceCharge
|
||||
* @param CalculatesTransactionTransferFee $calculatesTransactionTransferFee
|
||||
* @param CreateSupplierTransactionProcessor $createSupplierTransactionProcessor
|
||||
*/
|
||||
public function __construct(FetchesCompany $fetchesCompany, FetchesConstant $fetchesConstant, CreatesTransaction $createsTransaction, GeneratesTransactionBillNumber $generatesTransactionBillNumber, CalculatesTransactionServiceCharge $calculatesTransactionServiceCharge, CalculatesTransactionTransferFee $calculatesTransactionTransferFee)
|
||||
public function __construct(FetchesCompany $fetchesCompany, CreateSupplierTransactionProcessor $createSupplierTransactionProcessor)
|
||||
{
|
||||
|
||||
$this->fetchesCompany = $fetchesCompany;
|
||||
$this->fetchesConstant = $fetchesConstant;
|
||||
$this->createsTransaction = $createsTransaction;
|
||||
$this->generatesTransactionBillNumber = $generatesTransactionBillNumber;
|
||||
$this->calculatesTransactionServiceCharge = $calculatesTransactionServiceCharge;
|
||||
$this->calculatesTransactionTransferFee = $calculatesTransactionTransferFee;
|
||||
$this->createSupplierTransactionProcessor = $createSupplierTransactionProcessor;
|
||||
}
|
||||
|
||||
public function logic(Request $request) : JsonResponse
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return string|\Symfony\Component\HttpFoundation\Response
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
*/
|
||||
public function execute(Request $request)
|
||||
{
|
||||
|
||||
$supplier = $this->fetchesCompany->execute(['id' => $request->route('id')]);
|
||||
|
||||
$rate = $request->route('rate');
|
||||
$rate = $request->input('rate');
|
||||
|
||||
$transactions = collect();
|
||||
$transferFeeTransactions = collect();
|
||||
|
||||
$payment_ids = explode(",", $request->route('payment_ids'));
|
||||
$payments = array_map(function($value){
|
||||
return ['id' => $value];
|
||||
}, json_decode($request->input('payments')));
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
foreach($payment_ids as $payment_id){
|
||||
$this->createSupplierTransactionProcessor->execute($supplier, $rate, $payments);
|
||||
|
||||
/** @var Transaction $payment */
|
||||
$payment = Transaction::find($payment_id);
|
||||
|
||||
if($payment->status !== ApprovalStatus::APPROVED) continue;
|
||||
if(!count($this->createSupplierTransactionProcessor->getBills())) return 'unexpected error';
|
||||
|
||||
$billNumber = $this->generatesTransactionBillNumber->execute('SPLR-');
|
||||
$constant = SegmentConstant::where('reference', SegmentConstants::SERVICE_CHARGE)->where('detail->id', $supplier->id)->first();
|
||||
$serviceCharge = $this->calculatesTransactionServiceCharge->execute($payment->original_amount, $rate, $constant ? $constant->detail->service_charge->amount : 0);
|
||||
$pdf = LaravelMpdf::loadView('pages.pdfs.currency_vendor_order', ['transactions' => $this->createSupplierTransactionProcessor->getBills(), 'transferFeeTransactions' => $this->createSupplierTransactionProcessor->getTransferTransactions(), 'supplier' => $supplier]);
|
||||
|
||||
$object = new TransactionObject($billNumber, TransactionType::BILL, $supplier->id, 1,
|
||||
$supplier->banks()->where('default', true)->first()->id, PaymentMethodType::CASH,
|
||||
$payment->original_amount * (1 / $rate), $payment->original_amount, 1, $payment->original_currency_id,
|
||||
$rate, 0, $supplier->id == 2 ? 0 : $serviceCharge, null, ApprovalStatus::PENDING_VERIFICATION);
|
||||
DB::rollBack();
|
||||
|
||||
$transactions[] = $billTransaction = $this->createsTransaction->execute($payment->booking, $object);
|
||||
|
||||
$transferFeeNumber = $this->generatesTransactionBillNumber->execute('TRFR-');
|
||||
$trasferFee = $this->calculatesTransactionTransferFee->execute($payment->original_amount);
|
||||
$object = new TransactionObject($transferFeeNumber, TransactionType::TRANSFER_FEE, 1, $supplier->id,
|
||||
$supplier->banks()->where('default', true)->first()->id, PaymentMethodType::CASH,
|
||||
$payment->original_amount, $payment->original_amount, $payment->original_currency_id, $payment->original_currency_id,
|
||||
1, 0, $trasferFee, null, ApprovalStatus::PENDING_VERIFICATION);
|
||||
|
||||
$transferFeeTransactions[] = $this->createsTransaction->execute($billTransaction, $object);
|
||||
}
|
||||
|
||||
|
||||
if(!count($transactions)) return $this->response([]);
|
||||
|
||||
$pdf = LaravelMpdf::loadView('pages.pdfs.currency_vendor_order', ['transactions' => $transactions, 'transferFeeTransactions' => $transferFeeTransactions, 'supplier' => $supplier]);
|
||||
DB::rollback();
|
||||
return $pdf->stream('MockUpWhiteForm.pdf');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Transactions\Processors;
|
||||
|
||||
use App\Classes\Modules\Transactions\DataTransferObjects\TransactionObject;
|
||||
use App\Classes\Modules\Transactions\Services\CalculatesTransactionServiceCharge;
|
||||
use App\Classes\Modules\Transactions\Services\CalculatesTransactionTransferFee;
|
||||
use App\Classes\Modules\Transactions\Services\CreatesTransaction;
|
||||
use App\Classes\Modules\Transactions\Services\FetchesTransaction;
|
||||
use App\Classes\Modules\Transactions\Services\GeneratesTransactionBillNumber;
|
||||
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\PaymentMethodType;
|
||||
use App\Classes\ValueObjects\Constants\SegmentConstants;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Models\Company;
|
||||
use App\Models\SegmentConstant;
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
class CreateSupplierTransactionProcessor
|
||||
{
|
||||
|
||||
/** @var FetchesTransaction */
|
||||
private $fetchesTransaction;
|
||||
|
||||
/** @var UpdatesTransactionStatus */
|
||||
private $updatesTransactionStatus;
|
||||
|
||||
/** @var CreatesTransaction */
|
||||
private $createsTransaction;
|
||||
|
||||
/** @var GeneratesTransactionBillNumber */
|
||||
private $generatesTransactionBillNumber;
|
||||
|
||||
/** @var CalculatesTransactionServiceCharge */
|
||||
private $calculatesTransactionServiceCharge;
|
||||
|
||||
/** @var CalculatesTransactionTransferFee */
|
||||
private $calculatesTransactionTransferFee;
|
||||
|
||||
/** @var Collection */
|
||||
private $bills;
|
||||
|
||||
/** @var Collection */
|
||||
private $transferFee;
|
||||
|
||||
/**
|
||||
* CreateSupplierTransactionProcessor constructor.
|
||||
* @param FetchesTransaction $fetchesTransaction
|
||||
* @param UpdatesTransactionStatus $updatesTransactionStatus
|
||||
* @param CreatesTransaction $createsTransaction
|
||||
* @param GeneratesTransactionBillNumber $generatesTransactionBillNumber
|
||||
* @param CalculatesTransactionServiceCharge $calculatesTransactionServiceCharge
|
||||
* @param CalculatesTransactionTransferFee $calculatesTransactionTransferFee
|
||||
*/
|
||||
public function __construct(FetchesTransaction $fetchesTransaction, UpdatesTransactionStatus $updatesTransactionStatus, CreatesTransaction $createsTransaction, GeneratesTransactionBillNumber $generatesTransactionBillNumber, CalculatesTransactionServiceCharge $calculatesTransactionServiceCharge, CalculatesTransactionTransferFee $calculatesTransactionTransferFee)
|
||||
{
|
||||
$this->fetchesTransaction = $fetchesTransaction;
|
||||
$this->updatesTransactionStatus = $updatesTransactionStatus;
|
||||
$this->createsTransaction = $createsTransaction;
|
||||
$this->generatesTransactionBillNumber = $generatesTransactionBillNumber;
|
||||
$this->calculatesTransactionServiceCharge = $calculatesTransactionServiceCharge;
|
||||
$this->calculatesTransactionTransferFee = $calculatesTransactionTransferFee;
|
||||
$this->bills = collect();
|
||||
$this->transferFee = collect();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Company $supplier
|
||||
* @param String $rate
|
||||
* @param array $payments
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
*/
|
||||
public function execute(Company $supplier, String $rate, Array $payments) {
|
||||
|
||||
foreach($payments as $payment){
|
||||
|
||||
/** @var Transaction $payment */
|
||||
$payment = $this->fetchesTransaction->execute(['id' => $payment['id']]);
|
||||
|
||||
if($payment->status !== ApprovalStatus::APPROVED) continue;
|
||||
|
||||
$this->updatesTransactionStatus->execute($payment, ApprovalStatus::COMPLETED);
|
||||
$billNumber = $this->generatesTransactionBillNumber->execute('SPLR-');
|
||||
$constant = SegmentConstant::where('reference', SegmentConstants::SERVICE_CHARGE)->where('detail->id', $supplier->id)->first();
|
||||
|
||||
$serviceCharge = $this->calculatesTransactionServiceCharge->execute($payment->original_amount, $rate, $constant ? (float) $constant->detail->amount : 0);
|
||||
|
||||
$object = new TransactionObject($billNumber, TransactionType::BILL, $supplier->id, 1,
|
||||
$supplier->banks()->where('default', true)->first()->id, PaymentMethodType::CASH,
|
||||
$payment->original_amount * (1 / $rate), $payment->original_amount, 1, $payment->original_currency_id,
|
||||
$rate, 0, $serviceCharge, null, ApprovalStatus::PENDING_VERIFICATION);
|
||||
|
||||
/** @var Transaction $billTransaction */
|
||||
$billTransaction = $this->createsTransaction->execute($payment, $object);
|
||||
$this->pushBill($billTransaction);
|
||||
|
||||
$transferFeeNumber = $this->generatesTransactionBillNumber->execute('TRFR-');
|
||||
$transferFee = $this->calculatesTransactionTransferFee->execute($payment->original_amount);
|
||||
$object = new TransactionObject($transferFeeNumber, TransactionType::TRANSFER_FEE, 1, $supplier->id,
|
||||
$supplier->banks()->where('default', true)->first()->id, PaymentMethodType::CASH,
|
||||
$payment->original_amount, $payment->original_amount, $payment->original_currency_id, $payment->original_currency_id,
|
||||
1, 0, $transferFee, null, ApprovalStatus::PENDING_VERIFICATION);
|
||||
|
||||
$this->pushTransferFee($this->createsTransaction->execute($billTransaction, $object));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function getBills(): Collection
|
||||
{
|
||||
return $this->bills;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function getTransferTransactions(): Collection
|
||||
{
|
||||
return $this->transferFee;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $bill
|
||||
*/
|
||||
private function pushBill($bill): void
|
||||
{
|
||||
$this->bills->push($bill);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $transferFee
|
||||
*/
|
||||
private function pushTransferFee($transferFee): void
|
||||
{
|
||||
$this->transferFee->push($transferFee);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,7 +12,7 @@ class CalculatesTransactionServiceCharge
|
||||
* @param float $transfer_fee
|
||||
* @return float
|
||||
*/
|
||||
public function execute(float $amount, float $rate, ?float $service_charge = 0.75, ?float $transfer_fee = 0.00) {
|
||||
public function execute(float $amount, float $rate, ?float $service_charge = 0, ?float $transfer_fee = 0.00) {
|
||||
return (($amount + $transfer_fee) * (1/$rate)) * $service_charge / 100;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ class CalculatesTransactionTransferFee
|
||||
* @param float $transfer_fee
|
||||
* @return float
|
||||
*/
|
||||
public function execute(float $amount, ?float $transfer_fee = 0.002) {
|
||||
return $amount * $transfer_fee/100;
|
||||
public function execute(float $amount, ?float $transfer_fee = 0) {
|
||||
return $amount * ($transfer_fee / 100);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,4 +8,6 @@ final class BankAccountType {
|
||||
|
||||
public const EXTERNAL = 2;
|
||||
|
||||
public const ALIPAY= 3;
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ use Illuminate\Http\JsonResponse;
|
||||
|
||||
class DownloadMockUpWhiteFormPdfController
|
||||
{
|
||||
public function download(Request $request, DownloadMockUpWhiteFormPdfLogic $logic) : JsonResponse {
|
||||
public function download(Request $request, DownloadMockUpWhiteFormPdfLogic $logic) {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,9 @@ class CompanyResource extends JsonResource
|
||||
$lastPayment = $this->transactions()->where('transactions.type', TransactionType::PAYMENT)->whereIn('transactions.status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->orderBy('id', 'DESC')->first();
|
||||
$totalPayments = $this->transactions()->where('transactions.type', TransactionType::PAYMENT)->whereIn('transactions.status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->sum('amount');
|
||||
|
||||
$segment = SegmentConstant::where('reference', SegmentConstants::SUPPLIER_CURRENCIES)->where('detail->id', $this->id)->first();
|
||||
$serviceCharge = SegmentConstant::where('reference', SegmentConstants::SERVICE_CHARGE)->where('detail->id', $this->id)->first();
|
||||
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
@@ -57,14 +60,14 @@ class CompanyResource extends JsonResource
|
||||
'default' => new BankResource($this->banks->where('type', BankAccountType::EXTERNAL)->where('default', true)->first())
|
||||
],
|
||||
'segments' => SegmentResource::collection($this->segments),
|
||||
'service_charges' => SegmentConstant::where('reference', SegmentConstants::SERVICE_CHARGE)->where('detail->id', $this->id)->first(),
|
||||
'services' => (new FetchesCompanyServices())->getServices($this->servicesConfigurations()),
|
||||
'currencies' => $this->when($this->business_type === BusinessType::CURRENCY_VENDOR, function(){
|
||||
$segment = SegmentConstant::where('reference', SegmentConstants::SUPPLIER_CURRENCIES)->where('detail->id', $this->id)->first();
|
||||
return $segment ? CurrencyResource::collection(Currency::whereIn('id', $segment->detail->currencies)->get()) : [];
|
||||
}),
|
||||
'wallet' => new WalletResource($this->wallets()->first()),
|
||||
'created_at' => $this->created_at->format('d-m-Y')
|
||||
'created_at' => $this->created_at->format('d-m-Y'),
|
||||
$this->mergeWhen($this->business_type === BusinessType::CURRENCY_VENDOR, [
|
||||
'currencies' => $segment ? CurrencyResource::collection(Currency::whereIn('id', $segment->detail->currencies)->get()) : [],
|
||||
'service_charge' => $serviceCharge
|
||||
])
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ class TransactionResource extends JsonResource
|
||||
{
|
||||
|
||||
$booking = (int)$this->type === TransactionType::BILL ? $this->owner->owner : $this->booking;
|
||||
$days = $this->updated_at->endOfDay()->addWeekdays($booking->service_id === 1 ? 1 : 3);
|
||||
$days = $this->updated_at->endOfDay()->addWeekdays($booking->service_id === 3 ? 3 : 1);
|
||||
|
||||
return [
|
||||
'id' => $this->id,
|
||||
|
||||
@@ -33,13 +33,13 @@
|
||||
<div class="row m-b-10">
|
||||
<div class="col">
|
||||
<validation-wrapper-component :validator="$v.parameters.account_no">
|
||||
<label>{{ serviceType.id === 6 ? 'Email / Phone No.' : 'Account No.' }}</label>
|
||||
<label>{{ serviceType ? serviceType.id === 4 ? 'Email / Phone No.' : 'Account No.' : 'Account No.'}}</label>
|
||||
<input type="text" class="form-control" v-model="parameters.account_no" :disabled="disabled">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" v-if="type === 2 && serviceType.id !== 6">
|
||||
<div class="col">
|
||||
<div class="row" v-if="type === 2 && serviceType">
|
||||
<div class="col" v-if="serviceType.id !== 4">
|
||||
<div class="row m-b-10">
|
||||
<div class="col">
|
||||
<validation-wrapper-component :validator="$v.parameters.bank_name">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row align-items-end">
|
||||
<div class="col-2">
|
||||
<div class="col-4">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="font-heading fs-10">{{this.data.serviceType.name}}</div>
|
||||
@@ -20,7 +20,6 @@
|
||||
<div class="font-heading fs-8 all-caps">Service Type</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<div class="row">
|
||||
@@ -79,7 +78,7 @@
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="form-group no-margin form-group-default">
|
||||
<label>{{ data.serviceType.id === 6 ? 'Email / Phone No.' : 'Account No.' }}</label>
|
||||
<label>{{ data.serviceType.id === 4 ? 'Email / Phone No.' : 'Account No.' }}</label>
|
||||
<input type="text" class="form-control" v-model="account_no" @keyup="parameters.bankAccount = {}" @focus="dropdownStatus = true">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<div class="col no-padding m-b-10" :class="[{'p-l-5': index !== 0}, {'p-r-5': index+1 !== data.services.length}]" v-for="(service, index) in data.services" v-bind:key="service.id" >
|
||||
<div class="btn btn-xs b-rad-none padding-25 btn-block" :class="[{'btn-success': serviceType.id === service.id}, {'bg-master-lighter': serviceType.id !== service.id}]" @click="updateServiceType(service)">
|
||||
{{service.name}}
|
||||
<span class="absolute" style="right: -15px;top: -15px;width: 40px;" v-if="index !==0">
|
||||
<span class="absolute" style="right: -10px;top: -15px;width: 30px;" v-if="index !==0">
|
||||
<img src="/images/new-icon.png" class="w-100">
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -49,7 +49,8 @@
|
||||
</div>
|
||||
<div class="row align-items-center">
|
||||
<div class="col-auto p-r-0">
|
||||
<div class="padding-5 bg-master-light">
|
||||
<img v-if="item.service.id === 4" src="https://cdn.iconscout.com/icon/free/png-256/alipay-3521266-2944770.png" alt="" width="40">
|
||||
<div v-if="item.service.id !== 4" class="padding-5 bg-master-light">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
|
||||
width="30" height="30"
|
||||
viewBox="0 0 172 172"
|
||||
@@ -391,6 +392,11 @@
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row m-b-15 m-l-0 m-r-0" v-if="calculation.date">
|
||||
<div class="col padding-15 bg-master-lightest text-center">
|
||||
<div class="fs-14 muted" >The recipient will receive the transfer amount by <br><span class="bold text-success">{{ this.calculation.receive_date }}</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row align-items-end m-b-20 text-danger" v-if="(data.amount - parseFloat(amount.replace(',', '')))">
|
||||
<div class="col">
|
||||
<div class="font-heading all-caps fs-10">Outstanding</div>
|
||||
@@ -399,11 +405,6 @@
|
||||
<div class="font-heading fs-10">{{this.data.fixed_currency.short_code}} {{(Math.round(((this.data.outstanding_amount - parseFloat(amount.replace(',', '')))+ Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-15" v-if="calculation.date">
|
||||
<div class="col text-center">
|
||||
<div class="fs-14 muted" >The recipient will receive the transfer amount by <br><span class="bold text-success">{{ this.calculation.receive_date }}</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row align-items-end m-b-10 text-success bold">
|
||||
<div class="col">
|
||||
<div class="font-heading all-caps fs-12">Recipient Gets</div>
|
||||
|
||||
@@ -23,11 +23,6 @@
|
||||
<div class="font-heading fs-11">You will be redirected to your bank to complete the payment of <span class="text-success bold">{{(Math.round((calculation.total + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}} MYR</span> after clicking on the confirm button below. please follow your bank instruction to complete the payment</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-25" v-if="payment_method === 'payment_gateway'">
|
||||
<div class="col">
|
||||
<div class="font-heading fs-11">You will be redirected to your bank to complete the payment of <span class="text-success bold">{{(Math.round((calculation.total + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}} MYR</span> after clicking on the confirm button below. please follow your bank instruction to complete the payment</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row align-items-center m-b-25" v-if="payment_method !== 'payment_gateway'">
|
||||
<div class="col-auto p-r-0">
|
||||
<div class="icon-thumbnail icon-50 bg-master-lightest">
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<small class="bold fs-10 text-danger">{{error}}</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-15" v-if="calculation.date">
|
||||
<div class="row m-b-15" v-show="calculation.date && !error">
|
||||
<div class="col text-center">
|
||||
<div class="fs-14 muted" >The recipient will receive the transfer amount by <br><span class="bold text-success">{{ this.calculation.receive_date }}</span></div>
|
||||
</div>
|
||||
|
||||
@@ -141,15 +141,11 @@
|
||||
};
|
||||
},
|
||||
generateMockWhiteForm() {
|
||||
var paymentsIds = [];
|
||||
|
||||
this.payments.forEach(function(payment) {
|
||||
paymentsIds.push(payment.id);
|
||||
let paymentIds = this.payments.map(function(payment) {
|
||||
return payment.id
|
||||
});
|
||||
|
||||
paymentsIds = paymentsIds.toString();
|
||||
|
||||
window.open(this.route('transactions.supplier.mockUpWhiteForm.download', this.supplier.id, this.parameters.rate, paymentsIds), '_blank');
|
||||
window.open(this.route('whiteForm.mockUp', this.supplier.id)+'?rate='+this.parameters.rate+'&payments='+JSON.stringify(paymentIds), '_blank');
|
||||
}
|
||||
},
|
||||
mixins: [FormHandler]
|
||||
|
||||
+6
-5
@@ -114,7 +114,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<list-component ref="pendingOrdersList" section="pendingOrdersSection" :endpoint="route('api.transaction.list')" :options="{per_page: 10000, status: 2, owner_type: 'App\\Models\\Booking', type: 1, original_currency_id_in: [selectedCurrency.id], transaction_service_id: selectedService.id}">
|
||||
<list-component ref="pendingOrdersList" section="pendingOrdersSection" :endpoint="route('api.transaction.list')" :options="{per_page: 5, status: 2, owner_type: 'App\\Models\\Booking', type: 1, original_currency_id_in: [selectedCurrency.id], transaction_service_id: selectedService.id}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<supplier-pending-order-component :data="data" v-on:input="updateOrder($event)"></supplier-pending-order-component>
|
||||
</template>
|
||||
@@ -126,7 +126,7 @@
|
||||
<supplier-place-order-form-component :payments="payments" :currency="selectedCurrency" :supplier="selectedSupplier" section="pendingOrdersSection"></supplier-place-order-form-component>
|
||||
<div class="row m-t-20">
|
||||
<div class="col">
|
||||
<list-component key="2" section="currencyOrdersListSection" :options="{'per_page': 5, 'document_type_in': ['CURRENCY_VENDOR_ORDER'], 'status': 1, 'with_company': true}" :endpoint="route('api.document.list')">
|
||||
<list-component key="2" section="currencyOrdersListSection" :options="{'per_page': 10000, 'document_type_in': ['CURRENCY_VENDOR_ORDER'], 'status': 1, 'with_company': true}" :endpoint="route('api.document.list')">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<currency-order-component section="currencyOrdersListSection" :data="data"></currency-order-component>
|
||||
</template>
|
||||
@@ -176,9 +176,10 @@
|
||||
methods: {
|
||||
successHandler(response){
|
||||
this.suppliers = response.payload.data;
|
||||
this.updateSupplier(this.suppliers[0]);
|
||||
this.updateCurrency(this.suppliers[0].currencies[0]);
|
||||
this.updateService(this.suppliers[0].services[0]);
|
||||
this.selectedSupplier= this.suppliers[0];
|
||||
this.selectedService = this.suppliers[0].services[0];
|
||||
this.selectedCurrency = this.suppliers[0].currencies[0];
|
||||
this.updateList();
|
||||
},
|
||||
updateSupplier(supplier){
|
||||
if(supplier !== this.selectedSupplier){
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="font-heading all-caps fs-10">0.00</div>
|
||||
<div class="font-heading all-caps fs-10">{{item.service_charge ? parseFloat(item.service_charge.detail.amount).toFixed(3) : '0.000'}}%</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -59,7 +59,7 @@
|
||||
<i class="fa" :class="[{'fa-angle-up': expanded}, {'fa-angle-down': !expanded}]"></i>
|
||||
</button>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" type="editServiceCharge">
|
||||
<supplier-service-charge-form-component :details="item" :defaultCharge="null" section="suppliersServiceChargeSection"></supplier-service-charge-form-component>
|
||||
<supplier-service-charge-form-component :supplierId="item.id" :data="item.service_charge" section="suppliersSection"></supplier-service-charge-form-component>
|
||||
</modal-component>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="deleteSupplier">
|
||||
<delete-supplier-form-component :data="item" section="suppliersSection" class="text-center"></delete-supplier-form-component>
|
||||
|
||||
+22
-15
@@ -17,8 +17,8 @@
|
||||
<div class="row m-b-10">
|
||||
<div class="col">
|
||||
<validation-wrapper-component :validator="$v.parameters.amount">
|
||||
<label>Service Charge %</label>
|
||||
<input type="text" class="form-control" v-model="parameters.detail.service_charge.amount" v-money="exchangeRate">
|
||||
<label>Service Charge</label>
|
||||
<input type="text" class="form-control" v-model="parameters.detail.amount" v-money="threeDecimalPercentage">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
@@ -40,13 +40,9 @@
|
||||
import { required, requiredIf } from "vuelidate/lib/validators";
|
||||
export default {
|
||||
props: {
|
||||
details: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
defaultCharge: {
|
||||
supplierId: {
|
||||
type: Number,
|
||||
required: false
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data(){
|
||||
@@ -55,11 +51,9 @@
|
||||
name: 'Service Charge',
|
||||
reference: 'SERVICE_CHARGE',
|
||||
detail: {
|
||||
service_charge: {
|
||||
id: this.details.id,
|
||||
type: "percentage",
|
||||
amount: this.defaultCharge,
|
||||
},
|
||||
id: this.supplierId,
|
||||
type: "percentage",
|
||||
amount: 0,
|
||||
},
|
||||
segment_id: 1
|
||||
},
|
||||
@@ -68,13 +62,26 @@
|
||||
validations: {
|
||||
parameters: {
|
||||
amount: {
|
||||
required: true
|
||||
detail: {
|
||||
amount: {
|
||||
required: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
created(){
|
||||
if(this.data){
|
||||
this.parameters.detail = {
|
||||
id: this.supplierId,
|
||||
type: "percentage",
|
||||
amount: parseFloat(this.data.detail.amount).toFixed(3),
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submitForm(){
|
||||
this.submit(this.defaultCharge ? this.route('api.segment_constant.update', this.service_charges.id) : this.route('api.segment_constant.create'), 'post', this.section, true, true);
|
||||
this.submit(this.data ? this.route('api.segment_constant.update', this.data.id) : this.route('api.segment_constant.create'), this.data ? 'put' : 'post', this.section, true, true);
|
||||
},
|
||||
},
|
||||
mixins: [ModalFormHandler]
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
if(!success){return;}
|
||||
|
||||
let vm = this;
|
||||
let mappedList = response.payload.data.map(function(value){
|
||||
let mappedList = $.map(response.payload.data, function(value){
|
||||
let preservedValue = value;
|
||||
return {'id': !isNaN(value[vm.valueColumn]) ? parseInt(value[vm.valueColumn]) : value[vm.valueColumn],
|
||||
'text': vm.labelColumn.map(function(label){
|
||||
|
||||
@@ -77,7 +77,6 @@
|
||||
parameters: {
|
||||
starting_on:'',
|
||||
ending_on:'',
|
||||
// segment_id: '',
|
||||
title: '',
|
||||
description: '',
|
||||
}
|
||||
@@ -106,21 +105,11 @@
|
||||
|
||||
},
|
||||
created(){
|
||||
console.log("lado form");
|
||||
},
|
||||
methods: {
|
||||
submitForm(){
|
||||
//this.submit(route('api.announcement.create'), 'post', this.section, true, false);
|
||||
this.submit((this.data ? this.route('api.announcement.update', this.data.id) : this.route('api.announcement.create')), (this.data ? 'put' : 'post'), this.section, true, false)
|
||||
},
|
||||
// successHandler(response){
|
||||
// this.closeModal();
|
||||
// //this.formHandler();
|
||||
// this.resetForm();
|
||||
// },
|
||||
// errorHandler(error){
|
||||
// this.formHandler(error.message);
|
||||
// }
|
||||
}
|
||||
},
|
||||
mixins: [ModalFormHandler],
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ export default {
|
||||
productPrice: {decimal: '.',thousands: ',', precision: 3},
|
||||
exchangeRate: {decimal: '.', thousands: '', precision: 5},
|
||||
percentage: {decimal: '.', thousands: '', precision: 2, suffix: '%'},
|
||||
threeDecimalPercentage: {decimal: '.', thousands: '', precision: 3, suffix: '%'},
|
||||
integer: {decimal: '', thousands: '', precision: 0},
|
||||
|
||||
}
|
||||
|
||||
@@ -37,12 +37,12 @@
|
||||
</tr>
|
||||
@foreach($transactions as $transaction)
|
||||
<tr style="margin-bottom: 10px;">
|
||||
<td>{{$transaction->owner->marking}}</td>
|
||||
<td>{{$transaction->owner->company->reference}}</td>
|
||||
<td>{{$transaction->owner->owner->marking}}</td>
|
||||
<td>{{$transaction->owner->owner->company->reference}}</td>
|
||||
<td>{{$transaction->currency_rate}}</td>
|
||||
<td>{{$transaction->currency->short_code}} {{number_format((float)$transaction->amount, 2, '.', '')}}</td>
|
||||
<td>Account Holder Name: {{$transaction->owner->bank->holder_name}}<br>{{$transaction->owner->bank->bank_name}}: {{$transaction->owner->bank->account_no}}
|
||||
<br>Branch: {{$transaction->owner->bank->bank_branch}}<br>Bank in Amount: {{$transaction->original_currency->short_code}} {{$transaction->original_amount}}</td>
|
||||
<td>Account Holder Name: {{$transaction->owner->owner->bank->holder_name}}<br>{{$transaction->owner->owner->bank->bank_name}}: {{$transaction->owner->owner->bank->account_no}}
|
||||
<br>Branch: {{$transaction->owner->owner->bank->bank_branch}}<br>Bank in Amount: {{$transaction->original_currency->short_code}} {{$transaction->original_amount}}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
@@ -78,9 +78,9 @@
|
||||
<td>MYR {{$sub_total_amount}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="70%" style="text-align: right;">Service charge ({{ $supplier->id == 2 ? '0.00' : '0.75%' }}): </td>
|
||||
<td width="70%" style="text-align: right;">Service charge: </td>
|
||||
@php
|
||||
$service_charge = number_format((float)$sub_total_amount * 0.75 / 100, 2, '.', '');
|
||||
$service_charge = number_format((float)$transactions->sum('service_charge'), 2, '.', '');
|
||||
@endphp
|
||||
<td>MYR {{$service_charge}}</td>
|
||||
</tr>
|
||||
|
||||
+1
-1
@@ -172,4 +172,4 @@ Route::get('purchase/sensitive/', function(Request $request){
|
||||
}
|
||||
});
|
||||
|
||||
Route::get('/transactions/supplier/{id}/mock-up-white-form/download/{rate}/{payment_ids}', 'Transactions\DownloadMockUpWhiteFormPdfController@download')->name('transactions.supplier.mockUpWhiteForm.download');
|
||||
Route::get('/transactions/supplier/{id}/mock_up', 'Transactions\DownloadMockUpWhiteFormPdfController@download')->name('whiteForm.mockUp');
|
||||
Reference in New Issue
Block a user