mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
Merge branch 'dillon/111-manual-invoice-ba' into vapor/production
This commit is contained in:
@@ -84,7 +84,7 @@ class Helper
|
||||
$ringgitWords = $numberTransformer->toWords((int)$ringgit);
|
||||
$centsWords = $numberTransformer->toWords((int)$cents);
|
||||
|
||||
return strtoupper('ringgit ' . $ringgitWords . ' and ' . $centsWords . ' cents only');
|
||||
return strtoupper('ringgit malaysia ' . $ringgitWords . ' and ' . $centsWords . ' cents only');
|
||||
}
|
||||
|
||||
public static function getLHDNStateCodeByName($name)
|
||||
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Bookings\ControllersLogic;
|
||||
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Bookings\Services\FetchesBooking;
|
||||
use App\Classes\Modules\Bookings\Standards\Rules\CanFetchBooking;
|
||||
use App\Classes\Modules\Transactions\Processors\CreateBankingInvoiceTransactionProcessor;
|
||||
use App\Http\Resources\BookingResource;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class CreateBankingInvoiceTransactionLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification():array {
|
||||
return [
|
||||
'title' => 'Create Banking Invoice Transaction',
|
||||
'message' => 'You have successfully create banking invoice transaction'
|
||||
];
|
||||
}
|
||||
|
||||
/** @var CanFetchBooking */
|
||||
private $canFetchBooking;
|
||||
|
||||
/** @var FetchesBooking */
|
||||
private $fetchesBooking;
|
||||
|
||||
/** @var CreateBankingInvoiceTransactionProcessor */
|
||||
private $createBankingInvoiceTransactionProcessor;
|
||||
|
||||
/**
|
||||
* CreateBankingInvoiceTransactionLogic constructor.
|
||||
* @param CanFetchBooking $canFetchBooking
|
||||
* @param FetchesBooking $fetchesBooking
|
||||
* @param CreateBankingInvoiceTransactionProcessor $createBankingInvoiceTransactionProcessor
|
||||
*/
|
||||
public function __construct(
|
||||
CanFetchBooking $canFetchBooking,
|
||||
FetchesBooking $fetchesBooking,
|
||||
CreateBankingInvoiceTransactionProcessor $createBankingInvoiceTransactionProcessor
|
||||
)
|
||||
{
|
||||
$this->canFetchBooking = $canFetchBooking;
|
||||
$this->fetchesBooking = $fetchesBooking;
|
||||
$this->createBankingInvoiceTransactionProcessor = $createBankingInvoiceTransactionProcessor;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws \App\Classes\Exceptions\AccessForbiddenException
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
* @throws \App\Classes\Exceptions\RequestValidationException
|
||||
*/
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
// $this->canFetchBooking->passes();
|
||||
|
||||
$booking = $this->fetchesBooking->execute(['id' => $request->route('id')]);
|
||||
|
||||
$this->createBankingInvoiceTransactionProcessor->execute($booking);
|
||||
|
||||
return $this->resourceResponse(new BookingResource($booking));
|
||||
}
|
||||
|
||||
}
|
||||
+233
@@ -0,0 +1,233 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Transactions\Processors;
|
||||
|
||||
use App\Classes\Modules\Bookings\Services\CalculatesBookingOutstanding;
|
||||
use App\Classes\Modules\Bookings\Services\FetchesBookingQuotation;
|
||||
use App\Classes\Modules\Companies\Services\FetchesCompanyPaymentAttemptLimit;
|
||||
use App\Classes\Modules\Currencies\DataTransferObjects\CurrencyConversionObject;
|
||||
use App\Classes\Modules\Transactions\Services\CreatesTransaction;
|
||||
use App\Classes\Modules\Transactions\Services\GeneratesTransactionBillNumber;
|
||||
use App\Classes\Modules\Companies\Services\FetchesCompany;
|
||||
use App\Classes\Modules\Documents\Services\CreatesDocument;
|
||||
use App\Classes\Modules\Documents\Services\CreatesFiles;
|
||||
use App\Classes\Modules\Transactions\DataTransferObjects\TransactionObject;
|
||||
use App\Classes\Modules\Documents\DataTransferObjects\DocumentObject;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\PaymentMethodType;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Classes\ValueObjects\Constants\DocumentType;
|
||||
use App\Models\Booking;
|
||||
use App\Models\Document;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Mccarlosen\LaravelMpdf\Facades\LaravelMpdf;
|
||||
|
||||
class CreateBankingInvoiceTransactionProcessor
|
||||
{
|
||||
|
||||
/** @var CreatesTransaction */
|
||||
private $createsTransaction;
|
||||
|
||||
/** @var GeneratesTransactionBillNumber */
|
||||
private $generatesTransactionBillNumber;
|
||||
|
||||
/** @var FetchesCompany */
|
||||
private $fetchesCompany;
|
||||
|
||||
/** @var CreatesDocument */
|
||||
private $createsDocument;
|
||||
|
||||
/** @var CreatesFiles */
|
||||
private $createsFile;
|
||||
|
||||
/** @var CalculatesBookingOutstanding */
|
||||
private $calculatesBookingOutstanding;
|
||||
|
||||
/** @var FetchesBookingQuotation */
|
||||
private $fetchesBookingQuotation;
|
||||
|
||||
/** @var FetchesCompanyPaymentAttemptLimit */
|
||||
private $fetchesCompanyPaymentAttemptLimit;
|
||||
|
||||
|
||||
/**
|
||||
* CreateBankingInvoiceTransactionProcessor constructor.
|
||||
* @param CreatesTransaction $createsTransaction
|
||||
* @param GeneratesTransactionBillNumber $generatesTransactionBillNumber
|
||||
* @param FetchesCompany $fetchesCompany
|
||||
* @param CreatesDocument $createsDocument
|
||||
* @param CreatesFiles $createsFile
|
||||
* @param CalculatesBookingOutstanding $calculatesBookingOutstanding
|
||||
* @param FetchesBookingQuotation $fetchesBookingQuotation
|
||||
* @param FetchesCompanyPaymentAttemptLimit $fetchesCompanyPaymentAttemptLimit
|
||||
*/
|
||||
public function __construct(CreatesTransaction $createsTransaction, GeneratesTransactionBillNumber $generatesTransactionBillNumber, FetchesCompany $fetchesCompany, CreatesDocument $createsDocument, CreatesFiles $createsFile, CalculatesBookingOutstanding $calculatesBookingOutstanding, FetchesBookingQuotation $fetchesBookingQuotation, FetchesCompanyPaymentAttemptLimit $fetchesCompanyPaymentAttemptLimit)
|
||||
{
|
||||
$this->createsTransaction = $createsTransaction;
|
||||
$this->generatesTransactionBillNumber = $generatesTransactionBillNumber;
|
||||
$this->fetchesCompany = $fetchesCompany;
|
||||
$this->createsDocument = $createsDocument;
|
||||
$this->createsFile = $createsFile;
|
||||
$this->calculatesBookingOutstanding = $calculatesBookingOutstanding;
|
||||
$this->fetchesBookingQuotation = $fetchesBookingQuotation;
|
||||
$this->fetchesCompanyPaymentAttemptLimit = $fetchesCompanyPaymentAttemptLimit;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Booking $booking
|
||||
* @return void
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
*/
|
||||
public function execute(Booking $booking)
|
||||
{
|
||||
$po_order_transaction = $booking->transactions()
|
||||
->where('type', TransactionType::PURCHASE_ORDER)
|
||||
->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::APPROVED])
|
||||
->first();
|
||||
|
||||
$transaction = $booking->transactions()
|
||||
->where('type', TransactionType::PAYMENT)
|
||||
->whereNotIn('status', [ApprovalStatus::SUSPENDED])
|
||||
->first();
|
||||
|
||||
if (!$transaction) {
|
||||
$outstanding = $this->calculatesBookingOutstanding->execute($booking);
|
||||
|
||||
$conversionObject = new CurrencyConversionObject(floatval(str_replace(',', '', $outstanding)), $booking->convertible_currency_id, $booking->service_id, $booking->fix_currency_id === 1 ? 0 : 1, PaymentMethodType::CASH);
|
||||
|
||||
$configurations = $this->fetchesBookingQuotation->execute($booking->company, $conversionObject); //cief todo: 76
|
||||
|
||||
$paymentAttemptLimit = $this->fetchesCompanyPaymentAttemptLimit->execute($booking->company);
|
||||
|
||||
$billNumber = $this->generatesTransactionBillNumber->execute('PYMT-');
|
||||
|
||||
$object = new TransactionObject(
|
||||
$billNumber,
|
||||
TransactionType::PAYMENT,
|
||||
1,
|
||||
$booking->company->id,
|
||||
$configurations->getConfigurations()->getBankId(),
|
||||
$configurations->getConversionObject()->getPaymentMethod(),
|
||||
$configurations->getTotal(),
|
||||
$configurations->getForeignTotal(),
|
||||
1,
|
||||
$configurations->getConversionObject()->getCurrencyId(),
|
||||
$configurations->getConfigurations()->getRate(),
|
||||
$configurations->getTax(),
|
||||
$configurations->getServiceCharge(),
|
||||
Carbon::now()->addMinutes($paymentAttemptLimit),
|
||||
ApprovalStatus::PENDING_SUBMISSION,
|
||||
[],
|
||||
isset($billPlzBill) ? $billPlzBill->id : NULL
|
||||
);
|
||||
|
||||
$this->createsTransaction->execute($booking, $object);
|
||||
}
|
||||
|
||||
$billNumber = $this->generatesTransactionBillNumber->execute('BI-');
|
||||
|
||||
$payable_amount = $booking->transactions()->payments()->where(function ($query) {
|
||||
return $query->where(function ($query) {
|
||||
// return $query->where('status', ApprovalStatus::PENDING_SUBMISSION)->whereDate('expires_on', '>=', Carbon::now())->where('expires_on', '>', Carbon::now()->toTimeString());
|
||||
return $query->where('status', ApprovalStatus::PENDING_SUBMISSION)->where('expires_on', '>=', Carbon::now());
|
||||
})->orWhere(function ($query) {
|
||||
return $query->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED]);
|
||||
});
|
||||
})->sum('amount');
|
||||
$booking_amount = $booking->fix_amount;
|
||||
|
||||
$transaction = $booking->transactions()
|
||||
->where('type', TransactionType::PAYMENT)
|
||||
->first();
|
||||
|
||||
$paymentAmount = $booking->transactions()->payments()->where(function ($query) {
|
||||
return $query->where(function ($query) {
|
||||
return $query->where('status', ApprovalStatus::PENDING_SUBMISSION)->where('expires_on', '>=', Carbon::now());
|
||||
})->orWhere(function ($query) {
|
||||
return $query->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED]);
|
||||
});
|
||||
})->selectRaw('sum(amount - service_charge - tax) as sub_total')->get()->sum('sub_total');
|
||||
|
||||
$booking_currency_average_rate = $booking_amount / $paymentAmount;
|
||||
|
||||
$total_service_charge = $booking->transactions()
|
||||
->where('type', TransactionType::PAYMENT)
|
||||
->whereNotIn('status', [ApprovalStatus::REJECTED, ApprovalStatus::SUSPENDED])
|
||||
->sum('service_charge');
|
||||
|
||||
$total_tax = $booking->transactions()
|
||||
->where('type', TransactionType::PAYMENT)
|
||||
->whereIn('status', [ApprovalStatus::REJECTED, ApprovalStatus::SUSPENDED])
|
||||
->sum('tax');
|
||||
|
||||
// delete prev banking transactions
|
||||
$booking->transactions()
|
||||
->where('type', TransactionType::BANKING)
|
||||
->delete();
|
||||
|
||||
$transaction_object = new TransactionObject(
|
||||
$billNumber,
|
||||
TransactionType::BANKING,
|
||||
$transaction->issuer,
|
||||
$transaction->receiver,
|
||||
$transaction->recipient_bank_account_id,
|
||||
$transaction->payment_method,
|
||||
$payable_amount,
|
||||
$booking_amount,
|
||||
$transaction->currency_id,
|
||||
$transaction->original_currency_id,
|
||||
$booking_currency_average_rate,
|
||||
$total_tax,
|
||||
$total_service_charge,
|
||||
null,
|
||||
ApprovalStatus::APPROVED
|
||||
);
|
||||
|
||||
$banking_transaction = $this->createsTransaction->execute($po_order_transaction->booking, $transaction_object);
|
||||
|
||||
$supplier = $this->fetchesCompany->execute(['id' => $transaction->receiver]);
|
||||
$brn = $supplier->documents()->where('document_type', DocumentType::SSM_REGISTRATION)->latest()->first();
|
||||
|
||||
// PDF 1 - Banking Invoice
|
||||
$purchase_order_pdf = LaravelMpdf::loadView('pages.pdfs.banking_invoice',
|
||||
[
|
||||
'transaction' => $banking_transaction,
|
||||
'po_order_transaction' => $po_order_transaction,
|
||||
'supplier' => $supplier,
|
||||
'brn' => $brn,
|
||||
]);
|
||||
$document_object = new DocumentObject(
|
||||
DocumentType::BANKING_INVOICE,
|
||||
[chunk_split('data:application/pdf;base64,' . base64_encode($purchase_order_pdf->output()))],
|
||||
'',
|
||||
ApprovalStatus::COMPLETED,
|
||||
'banking_invoices'
|
||||
);
|
||||
|
||||
/** @var Document $document */
|
||||
$document = $this->createsDocument->execute($po_order_transaction->booking, $document_object);
|
||||
$this->createsFile->execute($document, $document_object);
|
||||
|
||||
// PDF 2 - Banking Delivery Order
|
||||
$purchase_order_pdf = LaravelMpdf::loadView('pages.pdfs.deliver_order_banking',
|
||||
[
|
||||
'transaction' => $banking_transaction,
|
||||
'po_order_transaction' => $po_order_transaction,
|
||||
'supplier' => $supplier,
|
||||
'brn' => $brn,
|
||||
]);
|
||||
$document_object = new DocumentObject(
|
||||
DocumentType::DELIVER_ORDER_BANKING,
|
||||
[chunk_split('data:application/pdf;base64,' . base64_encode($purchase_order_pdf->output()))],
|
||||
'',
|
||||
ApprovalStatus::COMPLETED,
|
||||
'banking_invoices'
|
||||
);
|
||||
|
||||
/** @var Document $document */
|
||||
$document = $this->createsDocument->execute($po_order_transaction->booking, $document_object);
|
||||
$this->createsFile->execute($document, $document_object);
|
||||
}
|
||||
}
|
||||
@@ -30,4 +30,7 @@ final class DocumentType {
|
||||
|
||||
public const RECEIPT_VOUCHER = 'RECEIPT_VOUCHER';
|
||||
public const EINVOICE = 'E_INVOICE';
|
||||
|
||||
public const BANKING_INVOICE = 'BANKING_INVOICE';
|
||||
public const DELIVER_ORDER_BANKING = 'DELIVER_ORDER_BANKING';
|
||||
}
|
||||
|
||||
@@ -40,6 +40,8 @@ final class TransactionType {
|
||||
|
||||
public const RECEIPT_VOUCHER = 17;
|
||||
|
||||
public const BANKING = 18;
|
||||
|
||||
public const ID_TO_NAME = [
|
||||
self::PAYMENT_ATTEMPT => "PAYMENT_ATTEMPT",
|
||||
self::PAYMENT => "PAYMENT",
|
||||
@@ -57,6 +59,7 @@ final class TransactionType {
|
||||
self::CASH_BACK => "CASH_BACK",
|
||||
self::SUPPLIER_PAYMENT => "SUPPLIER_PAYMENT",
|
||||
self::SUPPLIER_REFUND => "SUPPLIER_REFUND",
|
||||
self::BANKING => "BANKING",
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Bookings;
|
||||
|
||||
use App\Classes\Modules\Bookings\ControllersLogic\CreateBankingInvoiceTransactionLogic;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class CreateBankingInvoiceTransactionController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param CreateBankingInvoiceTransactionLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function create(Request $request, CreateBankingInvoiceTransactionLogic $logic): JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -65,6 +65,8 @@ class BookingResource extends JsonResource
|
||||
'supplier_delivery_order' => new DocumentResource($this->documents()->where('document_type', DocumentType::SUPPLIER_DELIVER_ORDER)->first()),
|
||||
'proforma_invoice' => new DocumentResource($this->documents()->where('document_type', DocumentType::PROFORMA_INVOICE)->whereNotIn('status', [ApprovalStatus::REJECTED, ApprovalStatus::EXPIRED])->orderByDesc('id')->first()),
|
||||
'ecommerce_purchase_order' => new DocumentResource($this->documents()->where('document_type', DocumentType::ECOMMERCE_PURCHASE_ORDER)->first()),
|
||||
'banking_invoice' => new DocumentResource($this->documents()->where('document_type', DocumentType::BANKING_INVOICE)->whereNotIn('status', [ApprovalStatus::REJECTED, ApprovalStatus::EXPIRED])->orderByDesc('id')->first()),
|
||||
'delivery_order_banking' => new DocumentResource($this->documents()->where('document_type', DocumentType::DELIVER_ORDER_BANKING)->orderByDesc('id')->first()),
|
||||
],
|
||||
'order_reference_no' => $this->modelAttributes()->where('name', BookingAttributeNames::ORDER_REFERENCE_NO)->get()->map(function ($attr) {
|
||||
return [
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
<div class="absolute w-100 b-l b-b b-r b-success" :class="[{'hide': !serviceType.status}]" style="top: 100%; right: 0; z-index: 1;">
|
||||
<div class="row text-left no-margin bg-white">
|
||||
<div class="col no-padding">
|
||||
<div class="row no-margin" v-for="service in data.services" v-bind:key="service.id" >
|
||||
<div class="row no-margin" v-for="service in data.services.filter(s => ![14,15,16,17,18,19].includes(s.id))" v-bind:key="service.id">
|
||||
<div class="col b-b b-grey p-t-10 p-b-10 pointer hover-t-10 p-b-10" :class="[{'bg-success-light': serviceType.id === service.id}, {'text-white': serviceType.id === service.id}, {'hover-success': serviceType.id !== service.id}, {'pointer': serviceType.id !== service.id}]" @click="updateServiceType(service)">
|
||||
<div class="row align-items-center justify-content-center">
|
||||
<div class="col">
|
||||
@@ -81,6 +81,52 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row no-margin" v-if="data.services.filter(s => [14, 15, 16, 17, 18, 19].includes(s.id)).length">
|
||||
<div class="col b-b b-grey p-t-10 p-b-10 pointer hover-t-10 p-b-10" :class="[{'bg-success-light': [14, 15, 16, 17, 18, 19].includes(serviceType.id)}, {'text-white': [14, 15, 16, 17, 18, 19].includes(serviceType.id)}, {'hover-success': ![14, 15, 16, 17, 18, 19].includes(serviceType.id)}, {'pointer': ![14, 15, 16, 17, 18, 19].includes(serviceType.id)}]">
|
||||
<div class="dropdown w-100" @mouseleave="closeDropdown">
|
||||
<button
|
||||
class="font-heading fs-10 w-100"
|
||||
@click="innerDropdown.main = !innerDropdown.main" style="background: inherit; border: none; text-align: left;"
|
||||
>
|
||||
{{ displaySelection }}
|
||||
<i class="fa" :class="innerDropdown.main ? 'fa-angle-up' : 'fa-angle-down'"></i>
|
||||
</button>
|
||||
|
||||
<div
|
||||
v-if="innerDropdown.main"
|
||||
class="dropdown-menu show p-0 border border-success w-100"
|
||||
style="max-height: 400px; overflow-y: auto;"
|
||||
>
|
||||
<ul class="menu-level w-100">
|
||||
<li
|
||||
v-for="svc in hardcodeBankingInvoiceServices.services"
|
||||
:key="svc.id"
|
||||
class="menu-item w-100 p-l-0"
|
||||
>
|
||||
<div
|
||||
class="level-title w-100 font-heading fs-10"
|
||||
@click="selectService(svc)"
|
||||
:class="{ 'bg-success-light text-white': innerDropdownSelected.service && innerDropdownSelected.service.id === svc.id }"
|
||||
>
|
||||
{{ svc.name }}
|
||||
</div>
|
||||
<ul v-if="innerDropdownHovered.service && innerDropdownHovered.service.id === svc.id" class="menu-level submenu w-100">
|
||||
<li v-for="sub in svc.subservices" :key="'sub-'+sub.id" class="menu-item w-100">
|
||||
<div
|
||||
class="level-title w-100 sub-level font-heading fs-10"
|
||||
@click="selectSubservice(svc, sub)"
|
||||
:class="{ 'bg-success-light text-white': innerDropdownSelected.subservice && innerDropdownSelected.subservice.id === sub.id }"
|
||||
>
|
||||
{{ sub.name }}
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -96,6 +142,14 @@
|
||||
<p class="no-margin" v-if="serviceType.id === 1">The recipient can expect to receive the transfer within <span class="text-success bold">3-5 working days</span>. Explore our BANK TRANSFER (SAVER) option for a better rate!</p>
|
||||
<p class="no-margin" v-if="serviceType.id === 3">Enjoy a <span class="bold text-underline">better rate</span> with this option! The recipient will receive the transfer after <span class="text-success bold">5-7 working days</span>.</p>
|
||||
<p class="no-margin" v-if="serviceType.id === 12">You can request Pay-on-Behalf via Alipay for platforms like Taobao, 1688, Pinduoduo, or any Alipay-supported platform. <br><span class="text-danger">Please use Alipay account "2766384544@QQ.com" to apply for Daifu. This account may change, so always confirm the latest Alipay account before placing an order.</span></p>
|
||||
<p class="no-margin" v-if="serviceType.id === 14 || serviceType.id === 17 || serviceType.id === 18">The customer may request an <span class="bold">official invoice first</span> for Bank submission (e.g. BA Trade Line). <br> <br>
|
||||
The <span class="bold">2% service fee is already included</span> in each product unit price, so it will not appear separately.<br>
|
||||
🕓 Transfer will be processed once bank payment is received.<br>
|
||||
</p>
|
||||
<p class="no-margin" v-if="serviceType.id === 15 || serviceType.id === 16 || serviceType.id === 19">The customer may request an <span class="bold">official invoice first</span> for Bank submission (e.g. BA Trade Line). <br> <br>
|
||||
Invoice will show a <span class="bold">2% service fee</span> as a separate item.<br>
|
||||
🕓 Transfer will be processed once bank payment is received. <br>
|
||||
</p>
|
||||
<p class="no-margin text-danger" v-if="[1, 3].includes(serviceType.id) && serviceType.selectedCurrency.id !== 3">Please ensure is a PERSONAL bank account details. Company bank account details only allow to use as E2E service.</p>
|
||||
<p class="no-margin text-danger" v-if="serviceType.id === 5">Cancellation of E2E service are strictly NO refund on the 2% transfer fee charge.</p>
|
||||
</div>
|
||||
@@ -188,7 +242,65 @@
|
||||
recipientBanks: [],
|
||||
company: {}
|
||||
},
|
||||
parameters: {}
|
||||
parameters: {},
|
||||
|
||||
innerDropdown: { main: false },
|
||||
innerDropdownHovered: {
|
||||
service: null,
|
||||
subservice: null
|
||||
},
|
||||
|
||||
innerDropdownSelected: {
|
||||
service: null,
|
||||
subservice: null,
|
||||
option: null
|
||||
},
|
||||
hardcodeBankingInvoiceServices: {
|
||||
services: [
|
||||
{
|
||||
id: 1,
|
||||
name: "BANK TRANSFER",
|
||||
subservices: [
|
||||
{
|
||||
id: 14,
|
||||
name: "(IN) BANK TRANSFER (CNY/USD) - BA",
|
||||
},
|
||||
{
|
||||
id: 15,
|
||||
name: "(EX) BANK TRANSFER (CNY/USD) - BA",
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "ALIPAY TRANSFER",
|
||||
subservices: [
|
||||
{
|
||||
id: 17,
|
||||
name: "(IN) ALIPAY - BA",
|
||||
},
|
||||
{
|
||||
id: 16,
|
||||
name: "(EX) ALIPAY - BA",
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "ENTERPRISE TO ENTERPRISE 公打公",
|
||||
subservices: [
|
||||
{
|
||||
id: 18,
|
||||
name: "(IN) ENTERPRISE TO ENTERPRISE - BA",
|
||||
},
|
||||
{
|
||||
id: 19,
|
||||
name: "(EX) ENTERPRISE TO ENTERPRISE - BA",
|
||||
},
|
||||
]
|
||||
},
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created(){
|
||||
@@ -204,6 +316,28 @@
|
||||
this.summary.recipientBanks = this.data.recipient_banks.accounts;
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.hardcodeBankingInvoiceServices.services.forEach(service => {
|
||||
service.subservices = service.subservices.map(sub => {
|
||||
const match = this.data.services.find(s => s.id === sub.id);
|
||||
return match
|
||||
? { ...sub, name: match.name, currencies: match.currencies }
|
||||
: sub;
|
||||
});
|
||||
});
|
||||
},
|
||||
computed: {
|
||||
displaySelection() {
|
||||
var defaultName = "BANKING INVOICE";
|
||||
var service = this.innerDropdownSelected.service;
|
||||
var sub = this.innerDropdownSelected.subservice;
|
||||
var opt = this.innerDropdownSelected.option;
|
||||
if (service && sub && opt) return defaultName + " → " + service.name + " → " + sub.name + " → " + opt.name;
|
||||
if (service && sub) return defaultName + " → " + service.name + " → " + sub.name;
|
||||
if (service) return defaultName + " → " + service.name;
|
||||
return defaultName;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
updateServiceType(service){
|
||||
this.serviceType.id = service.id;
|
||||
@@ -222,9 +356,67 @@
|
||||
recipientBanks: this.data.recipient_banks.accounts,
|
||||
company: this.data,
|
||||
}
|
||||
this.innerDropdownSelected = { service: null, subservice: null };
|
||||
},
|
||||
selectService(service) {
|
||||
this.innerDropdownSelected.service = service;
|
||||
this.innerDropdownSelected.subservice = null;
|
||||
this.innerDropdownSelected.option = null;
|
||||
this.innerDropdownHovered.service = service;
|
||||
this.innerDropdownHovered.subservice = null;
|
||||
},
|
||||
selectSubservice(svc, sub) {
|
||||
this.updateServiceType(sub);
|
||||
this.innerDropdownSelected = { service: svc, subservice: sub };
|
||||
|
||||
this.innerDropdownSelected.subservice = sub;
|
||||
this.innerDropdownSelected.option = null;
|
||||
this.innerDropdownHovered.subservice = sub;
|
||||
|
||||
this.innerDropdown.main = false;
|
||||
this.innerDropdownHovered.service = null;
|
||||
},
|
||||
closeDropdown() {
|
||||
this.innerDropdownHovered.service = null;
|
||||
this.innerDropdownHovered.subservice = null;
|
||||
this.innerDropdown.main = false;
|
||||
}
|
||||
},
|
||||
mixins: [formHandler]
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.menu-level {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.menu-item {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.level-title {
|
||||
padding: 4px 8px;
|
||||
width: 100%;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.level-title.sub-level {
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.level-title.option-level {
|
||||
padding-left: 35px;
|
||||
}
|
||||
|
||||
.menu-item:hover > .level-title {
|
||||
background-color: #8fd19e;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.bg-success-light {
|
||||
background-color: #8fd19e !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -222,6 +222,10 @@
|
||||
})
|
||||
},
|
||||
disabledMyr(){
|
||||
if (this.data.id === 14 || this.data.id === 15 || this.data.id === 16 || this.data.id === 17 || this.data.id === 18 || this.data.id === 19) { //default for service type manual / banking invoice
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.currentSegmentNames.includes('enable enter MYR rate')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -16,6 +16,12 @@
|
||||
<div class="col">
|
||||
<input class="form-control" type="text" name="booking_reference" placeholder="Booking Reference" value="{{$bookingReference}}">
|
||||
</div>
|
||||
<div class="col">
|
||||
<input class="form-control" type="text" name="bill_no" placeholder="Bill No" value="">
|
||||
</div>
|
||||
<div class="col">
|
||||
<input class="form-control" type="text" name="autocount_docno_invoice" placeholder="Autocount Invoice Number" value="">
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button class="btn btn-complete" type="submit">Search</button>
|
||||
</div>
|
||||
@@ -63,10 +69,12 @@
|
||||
$purchaseOrder = $booking->transactions()->where('type', \App\Classes\ValueObjects\Constants\TransactionType::PURCHASE_ORDER)->first();
|
||||
@endphp
|
||||
<section class="m-b-50">
|
||||
<h5 class="bold">Booking Reference: {{$booking->marking}}</h5>
|
||||
<h5 class="bold">Booking Reference: <span><a href="{{route('booking.details', $booking->marking)}}" target="_blank">{{$booking->marking}}</a></span></h5>
|
||||
<p>Amount: <span>{{$booking->fix_amount.' '.$booking->fixedCurrency->short_code}}</span></p>
|
||||
<p>Status: <span>{{$booking->status === 3 ? 'Complete' : 'In Progress'}}</span></p>
|
||||
<p>Purchase Order Status: <span>{{$purchaseOrder ? ($purchaseOrder->status === 3 ? 'Approved' : ($purchaseOrder->status === 1 ? 'Pending Approval' : 'Incomplete Submission')) : 'Pending Submission'}}</span></p>
|
||||
<p>Marking: <span><a href="{{route('customer.profile', $booking->company->reference)}}" target="_blank">{{$booking->company->reference}}</a></span></p>
|
||||
|
||||
@if($payments)<p class="m-t-35 bold">Payment History:</p>@endif
|
||||
@php $i = 1; @endphp
|
||||
@foreach($payments as $payment)
|
||||
@@ -123,10 +131,12 @@
|
||||
$purchaseOrder = $booking->transactions()->where('type', \App\Classes\ValueObjects\Constants\TransactionType::PURCHASE_ORDER)->first();
|
||||
@endphp
|
||||
<section>
|
||||
<h5 class="bold">Booking Reference: {{$booking->marking}}</h5>
|
||||
<h5 class="bold">Booking Reference: <span><a href="{{route('booking.details', $booking->marking)}}" target="_blank">{{$booking->marking}}</a></span></h5>
|
||||
<p>Amount: <span>{{$booking->fix_amount.' '.$booking->fixedCurrency->short_code}}</span></p>
|
||||
<p>Status: <span>{{$booking->status === 3 ? 'Complete' : 'In Progress'}}</span></p>
|
||||
<p>Purchase Order Status: <span>{{$purchaseOrder ? ($purchaseOrder->status === 3 ? 'Approved' : ($purchaseOrder->status === 1 ? 'Pending Approval' : 'Incomplete Submission')) : 'Pending Submission'}}</span></p>
|
||||
<p>Marking: <span><a href="{{route('customer.profile', $booking->company->reference)}}" target="_blank">{{$booking->company->reference}}</a></span></p>
|
||||
|
||||
@if($payments)<p class="m-t-35 bold">Payment History:</p>@endif
|
||||
@php $i = 1; @endphp
|
||||
@foreach($payments as $payment)
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
@extends('layouts.base_pdf')
|
||||
|
||||
@section('inner_content')
|
||||
|
||||
<br>
|
||||
<htmlpageheader name="page-header">
|
||||
<br><br>
|
||||
<div class="separator"><strong><i>{{ $transaction->bill_no }}</i></strong></div>
|
||||
</htmlpageheader>
|
||||
|
||||
<table>
|
||||
<!-- Header Section -->
|
||||
<tr>
|
||||
<td class="header-logo">
|
||||
<img src="{{ asset('images/ri_1.png') }}" alt="logo" id="logo" class="logo">
|
||||
</td>
|
||||
<td class="header-cief-address">
|
||||
<span class="company-name"><strong>CIEF WORLDWIDE SDN BHD</strong></span>
|
||||
<span class="company-reg">(1134596-M)</span><br>
|
||||
No. 72-3, Jalan Jalil 1,<br>
|
||||
The Earth Bukit Jalil,<br>
|
||||
57000 Kuala Lumpur<br>
|
||||
Tel: 03-8082 1252<br>
|
||||
TIN: C23880226040, MSIC: 46909<br>
|
||||
SST: W10-2403-32000643
|
||||
</td>
|
||||
<td class="header-details">
|
||||
<div class="title"><strong>Invoice</strong></div>
|
||||
<div class="number">EBI#: {{ $transaction->bill_no }}</div>
|
||||
<div class="ref">Ref# {{ $transaction->booking->marking }}</div>
|
||||
<div class="date">Date: {{ $po_order_transaction->booking->created_at }}</div>
|
||||
<div class="ref">Terms: C.O.D</div>
|
||||
<div> </div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" class="bill-to">
|
||||
<span class="sub-title">Bill To</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" class="address">
|
||||
<div class="label">
|
||||
{{ $supplier->name }}
|
||||
@if ($brn)
|
||||
(ROC: {{ $brn->reference }})
|
||||
@endif
|
||||
</div>
|
||||
<div class="address">
|
||||
@php
|
||||
$billingAddress = $supplier->addresses()->where('billing', '=', true)->first();
|
||||
@endphp
|
||||
{{ $billingAddress->street_one }}
|
||||
{{ $billingAddress->street_two }},
|
||||
{{ $billingAddress->district()->first()->name }},
|
||||
{{ $billingAddress->postcode }}
|
||||
{{ $billingAddress->state()->first()->name }},
|
||||
{{ $billingAddress->country()->first()->name }}
|
||||
</div>
|
||||
<div>Phone: {{ $supplier->contacts()->first()->phone }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<?php
|
||||
$voucher_redemption = $voucher_redemption ?? null;
|
||||
?>
|
||||
|
||||
<!-- Invoice Table -->
|
||||
@include('pages.pdfs.purchase_order_table_v2')
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<div class="note">
|
||||
<p><strong><span>{{ \App\Classes\General\Helper::convert(round($transaction->amount, 2)) }}</span></strong></p>
|
||||
<strong>Notes:</strong><br>
|
||||
1. All cheques should be crossed and made payable to CIEF WORLDWIDE SDN. BHD. (MAYBANK) MBB-568603010762<br>
|
||||
2. Goods sold are neither returnable nor refundable. Otherwise a cancellation fee of 20% on purchase price will be imposed.<br>
|
||||
3. Interest rate 2% per month will be charged on all overdue bills.<br>
|
||||
4. Price offered on invoice is based on present as at the current invoice date.<br><br>
|
||||
No any price amendment will be allowed after invoice being chop & sign.<br>
|
||||
CIEF WORLDWIDE SDN. BHD.<br>
|
||||
</div>
|
||||
<br><br>
|
||||
<htmlpagefooter name="page-footer">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="text-align: right; ">This is generated by computer. No signature required.</td>
|
||||
<td style="text-align: right; ">Page {PAGENO} of {nbpg}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</htmlpagefooter>
|
||||
@endsection
|
||||
@@ -0,0 +1,113 @@
|
||||
@extends('layouts.base_pdf')
|
||||
@section('inner_content')
|
||||
<br>
|
||||
<htmlpageheader name="page-header">
|
||||
<br><br>
|
||||
<div class="separator"><strong><i>{{ str_replace(['BI-'], 'BDO-', $transaction->bill_no) }}</i></strong></div>
|
||||
</htmlpageheader>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td class="header-logo">
|
||||
<img src="{{ asset('images/ri_1.png') }}" alt="logo" id="logo" class="logo">
|
||||
</td>
|
||||
<td class="header-cief-address">
|
||||
<span class="company-name"><strong>CIEF WORLDWIDE SDN BHD</strong></span>
|
||||
<span class="company-reg">(1134596-M)</span><br>
|
||||
No. 72-3, Jalan Jalil 1,<br>
|
||||
The Earth Bukit Jalil,<br>
|
||||
57000 Kuala Lumpur<br>
|
||||
Tel: 03-8082 1252<br>
|
||||
TIN: C23880226040, MSIC: 46909<br>
|
||||
SST: W10-2403-32000643
|
||||
</td>
|
||||
<td class="header-details">
|
||||
<div class="title">
|
||||
<strong>
|
||||
Delivery Order
|
||||
</strong>
|
||||
</div>
|
||||
|
||||
<div class="number">EBDO#: {{ str_replace(['BI-'], 'BDO-', $transaction->bill_no) }}</div>
|
||||
<div class="ref">Ref#: {{ $transaction->booking->marking }}</div>
|
||||
<div class="date">Date: {{
|
||||
$supplier->segments->whereIn('id', [23])->first() ? \Carbon\Carbon::now() : $po_order_transaction->created_at }}</div>
|
||||
<div> </div>
|
||||
</td>
|
||||
<tr>
|
||||
<td colspan="3" class="bill-to">
|
||||
<span class="sub-title">
|
||||
Bill To
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" class="address">
|
||||
<div class="label">
|
||||
{{ $supplier->name }}
|
||||
@if ($brn)
|
||||
(ROC: {{ $brn->reference }})
|
||||
@endif
|
||||
</div>
|
||||
<div class="address">
|
||||
@php
|
||||
$billingAddress = $supplier->addresses()->where('billing', '=', true)->first();
|
||||
@endphp
|
||||
{{ $billingAddress->street_one }}
|
||||
{{ $billingAddress->street_two }} ,
|
||||
{{ $billingAddress->district()->first()->name }},
|
||||
{{ $billingAddress->postcode }}
|
||||
{{ $billingAddress->state()->first()->name }},
|
||||
{{ $billingAddress->country()->first()->name }}
|
||||
</div>
|
||||
<div>
|
||||
Phone: {{ $supplier->contacts()->first()->phone }}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<?php
|
||||
$voucher_redemption = $voucher_redemption ?? null;
|
||||
?>
|
||||
|
||||
@include('pages.pdfs.purchase_order_table_v2')
|
||||
|
||||
<table style="width: 100%; border-spacing: 0;">
|
||||
<tbody>
|
||||
<tr style="border-spacing: 2em;">
|
||||
<td width="60%">
|
||||
|
||||
</td>
|
||||
<td width="40%" valign="top">
|
||||
E & O.E<br>
|
||||
Receive In Good Order & Condition<br>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table style="width: 100%; border-spacing: 0;">
|
||||
<tbody>
|
||||
<tr style="border-spacing: 2em;">
|
||||
<td width="60%">
|
||||
CIEF WORLDWIDE SDN BHD<br>
|
||||
</td>
|
||||
<td width="40%" valign="top">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<htmlpagefooter name="page-footer">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="text-align: right; ">This is generated by computer. No signature required.</td>
|
||||
<td style="text-align: right; ">Page {PAGENO} of {nbpg}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</htmlpagefooter>
|
||||
@endsection
|
||||
@@ -3,6 +3,7 @@
|
||||
use App\Http\Controllers\Bookings\RegenerateBookingPaymentRVController;
|
||||
use App\Http\Controllers\Bookings\RegenerateBookingEInvoiceController;
|
||||
use App\Http\Controllers\Bookings\UpdateBookingAmountController;
|
||||
use App\Http\Controllers\Bookings\CreateBankingInvoiceTransactionController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::group(['prefix' => 'booking', 'as' => 'booking.', 'namespace' => 'Bookings'], function () {
|
||||
@@ -43,6 +44,8 @@ Route::group(['prefix' => 'booking', 'as' => 'booking.', 'namespace' => 'Booking
|
||||
Route::post('/merge', 'MergeBookingController@merge')->name('merge');
|
||||
|
||||
Route::post('{id}/proforma/create', 'CreateProformaInvoiceTransaction@create')->name('proforma.create');
|
||||
Route::post('{id}/banking/create', [CreateBankingInvoiceTransactionController::class, 'create'])->name('banking.create');
|
||||
|
||||
|
||||
Route::group(['prefix' => '{id}/receipt', 'as' => 'receipt.'], function () {
|
||||
Route::post('/', [RegenerateBookingPaymentRVController::class, 'regenerate'])->name('regenerate');
|
||||
|
||||
@@ -36,7 +36,9 @@ use App\Classes\Modules\Transactions\Processors\CreateInvoiceTransactionV2Proces
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use App\Classes\General\AWSS3Helper;
|
||||
use App\Classes\ValueObjects\Constants\KVPKey;
|
||||
use App\Http\Controllers\Reports\UnfinishedPaymentOrders;
|
||||
use App\Models\KeyValuePair;
|
||||
use Illuminate\Support\Facades\File;
|
||||
|
||||
|
||||
@@ -215,6 +217,8 @@ Route::post('/support', function (Request $request) {
|
||||
$marking = $request->input('marking');
|
||||
$email = $request->input('customer_email');
|
||||
$bookingReference = $request->input('booking_reference');
|
||||
$billNo = $request->input('bill_no');
|
||||
$autocountDocNoInvoice = $request->input('autocount_docno_invoice');
|
||||
|
||||
$company = null;
|
||||
$booking = null;
|
||||
@@ -234,6 +238,21 @@ Route::post('/support', function (Request $request) {
|
||||
$company = $booking->company;
|
||||
}
|
||||
|
||||
if($billNo) {
|
||||
$transaction = Transaction::where('bill_no', $billNo)->first();
|
||||
if($transaction){
|
||||
$booking = $transaction->booking;
|
||||
}
|
||||
}
|
||||
|
||||
if($autocountDocNoInvoice) {
|
||||
$kvp = KeyValuePair::where('key', KVPKey::AUTOCOUNT_DOCNO_INVOICE)->where('value', $autocountDocNoInvoice)->first();
|
||||
if($kvp){
|
||||
$transaction = $kvp->owner()->withTrashed()->first();
|
||||
$booking = $transaction ? $transaction->booking : null;
|
||||
}
|
||||
}
|
||||
|
||||
return view('pages.customer_support', [
|
||||
'marking' => $marking,
|
||||
'email' => $email,
|
||||
|
||||
Reference in New Issue
Block a user