Merge branch 'dillon/78-order-paid-but-showing-unpaid' into vapor/development

This commit is contained in:
Dillon Ngo
2024-12-11 02:39:13 +08:00
10 changed files with 67 additions and 27 deletions
@@ -8,6 +8,7 @@ use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use App\Classes\Modules\Billplzs\Processors\CallbackBillplzProcessor;
use App\Classes\Modules\Billplzs\Processors\CallbackBillplzDataPatchProcessor;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Models\Transaction;
@@ -19,26 +20,26 @@ class OneTimeTransactionFixBillplzFailedCbV2CommandJob implements ShouldQueue
public function handle()
{
Log::info(Carbon::now() . ': Start job - One time fix failled callback from billplz for transaction with id 17310 cron ended.');
Log::info(Carbon::now() . ': Start job - One time fix failled callback from billplz cron ended.');
$start = new Carbon();
// ini_set('memory_limit', '-1');
//Transaction fix with this one time fix command: 15205, 16803, 17310
//Transaction fix with this one time fix command: 15205, 16803, 17310, 22008, 6770
//This transaction, 16803 has approve payment but not its owner, shipping invoice
$transaction = Transaction::whereIn('id', [17310])->first();
Log::info(Carbon::now() . ' : One time fix failled callback from billplz for transaction with id 17310 cron started.');
$transactions = Transaction::whereIn('id', [22008, 6770])->get();
Log::info(Carbon::now() . ' : One time fix failled callback from billplz started.');
if($transaction && $transaction->id == 17310){
foreach ($transactions as $transaction){
if($transaction){
Log::info(Carbon::now() . ' : 17310.');
$status = ApprovalStatus::APPROVED;
// $this->callbackBillplzProcessor->execute($transaction, $status);
(App()->make(CallbackBillplzDataPatchProcessor::class))->execute($transaction, $status);
Log::info(Carbon::now() . ' : '.$transaction->id);
$status = ApprovalStatus::APPROVED;
(App()->make(CallbackBillplzProcessor::class))->execute($transaction, $status);
// (App()->make(CallbackBillplzDataPatchProcessor::class))->execute($transaction, $status);
}
}
$end = new Carbon();
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
Log::info(Carbon::now() . ': End job - One time fix failled callback from billplz for transaction with id 17310 cron ended. ElapsedTime: ' . $elapsedTime . '.');
Log::info(Carbon::now() . ': End job - One time fix failled callback from billplz cron ended. ElapsedTime: ' . $elapsedTime . '.');
}
}
@@ -24,8 +24,8 @@ class CreateSupplierTaxRebateLogic extends AbstractControllerLogic
protected function notification(): array
{
return [
'title' => 'Create Supplier Tax Rebate',
'message' => 'You have successfully created a Supplier Tax Rebate'
'title' => 'Create Supplier Tax Refund',
'message' => 'You have successfully created a Supplier Tax Refund'
];
}
@@ -17,8 +17,8 @@ class DeleteSupplierTaxRebateLogic extends AbstractControllerLogic
protected function notification(): array
{
return [
'title' => 'Delete Supplier Tax Rebate',
'message' => 'You have successfully deleted a Supplier Tax Rebate'
'title' => 'Delete Supplier Tax Refund',
'message' => 'You have successfully deleted a Supplier Tax Refund'
];
}
@@ -61,6 +61,8 @@ class ReleaseGoodsToCustomerProcessor
$invoiceTransactions = $packingList->transactions()->where('status', ApprovalStatus::APPROVED)->whereIn('type', [TransactionType::SHIPPING_INVOICE, TransactionType::STORAGE_INVOICE])->get();
}
LogHelper::channel('storage_invoices')->info('invoiceTransactions: '. json_encode($invoiceTransactions));
//Part 1: Process each single invoice type and get the total of all invoices (STORAGE + SHIPPING)
foreach($invoiceTransactions as $invoiceTransaction){
$totalInvoiceAmountPaid = $invoiceTransaction->transactions->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->sum('amount');
@@ -65,7 +65,7 @@ class DownloadTaxRebateQrPdfController
$supplierTaxRebate = SupplierTaxRebate::where('reference_number', $tax_rebate_refeerence)->first();
if (!$supplierTaxRebate) {
// If not found, throw an error
abort(404, 'Supplier Tax Rebate not found');
abort(404, 'Supplier Tax Refund not found');
}
$data = [
@@ -2,7 +2,7 @@
<div class="row m-t-15 m-b-15 align-items-end parentContainer" v-if="company">
<div class="col">
<!-- 1688 consent -->
<div class="row m-l-0 m-r-0 m-b-15 animate__animated animate__tada animate__repeat-2 animate__delay-3s" v-if="!company.segments.some(item => item.id === 10 || item.id === 11 || item.id === 12)">
<div class="row m-l-0 m-r-0 m-b-15 animate__animated animate__tada animate__repeat-2 animate__delay-3s" v-if="false && !company.segments.some(item => item.id === 10 || item.id === 11 || item.id === 12)">
<div class="col bg-white padding-15">
<div class="row">
<div class="col">
@@ -68,6 +68,39 @@
</div>
</div>
</modal-component>
<div class="row m-l-0 m-r-0 m-b-15 animate__animated animate__tada animate__repeat-2 animate__delay-3s b-a b-thick b-grey rounded">
<div class="col bg-white padding-15">
<div class="row">
<div class="col">
<div class="row ">
<div class="col">
<div class="position-absolute b-a rounded padding-5 block m-r-10" style="right: 0;">
<div class="inline pointer b-grey rounded padding-5" :class="{'bg-primary': advertisementLanguage == 'en', 'text-white': advertisementLanguage == 'en'}" @click="updateAdvertisementLanguage('en')">EN</div>
<div class="inline pointer b-grey rounded padding-5" :class="{'bg-primary': advertisementLanguage == 'cn', 'text-white': advertisementLanguage == 'cn'}" @click="updateAdvertisementLanguage('cn')">中文</div>
</div>
<div class="block m-t-20">
<div v-if="advertisementLanguage == 'cn'">
<h5 class="bold text-primary block m-b-5">最新消息</h5>
<h5 class="m-t-0 text-justify">
<span class="bold"></span>CIEF 正式开启了新服务<span class="bold">海运散货退税服务</span>供应商要求出口退税不再太复杂只需一路往常的把货物发到广州仓库多加几个简单步骤即可轻松满足供应商的退税需求同时优化清关流程成本节省高达 8
<a class="block pointer m-t-15 m-b-15 semi-bold" target="_blank" href="https://www.cief-malaysia.com/sea-shipping-lcl-tax-refund-tutorial-cn">👉 点此查看教程</a>
</h5>
</div>
<div v-else>
<h5 class="bold text-primary block m-b-5">Great News</h5>
<h5 class="m-t-0 text-justify">
<span class="bold"></span> CIEF officially launches the new service <span class="bold">Sea Shipping LCL Tax Refund Service</span>!
Supplier requests for export tax refunds are no longer complicated. Simply continue sending goods to the Guangzhou warehouse as usual, add a few simple procedures, and easily meet your supplier's tax refund requirements. At the same time, we optimize the clearance process, and can help save up to 8 times on costs!
<a class="block pointer m-t-15 m-b-15 semi-bold" target="_blank" href="https://www.cief-malaysia.com/sea-shipping-lcl-tax-refund-tutorial/">👉 Click here for the tutorial!</a>
</h5>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
@@ -85,6 +118,7 @@
failed: false,
part: 0,
isFetchCompany: false,
advertisementLanguage: 'en',
company: null
}
},
@@ -97,6 +131,9 @@
this.isFetchCompany = true;
this.submit(route('api.company.show', this.$store.getters.getCompanyId), 'get', this.section, false, false)
},
updateAdvertisementLanguage(value){
this.advertisementLanguage = value;
},
activateService(segmentId){
this.parameters = {
segment_id: segmentId
@@ -5,8 +5,8 @@
<div class="col text-center">
<div class="row m-b-20">
<div class="col">
<h5 class="all-caps">Delete Tax Rebate QR Code</h5>
<div class="fs-11">Are you sure you want to delete this Tax Rebate QR Code?</div>
<h5 class="all-caps">Delete Tax Refund QR Code</h5>
<div class="fs-11">Are you sure you want to delete this Tax Refund QR Code?</div>
</div>
</div>
<div class="row">
@@ -9,7 +9,7 @@
<div class="row">
<div class="col">
<div class="justify-content-between d-flex">
<h3>List Of Tax Rebate QR Code</h3>
<h3>List Of Tax Refund QR Code</h3>
<i class="fa fa-times pointer fs-16 text-black" @click="resetSteps()"></i>
</div>
<div class="row">
@@ -48,8 +48,8 @@
<!-- Confirm Creation -->
<div v-if="step === '1'">
<div class="text-center m-b-30">
<h3>Are you sure you want to create a Tax Rebate QR Code?</h3>
<p>A Tax Rebate QR Code allows suppliers to claim tax rebates. <br>We need some additional information for this
<h3>Are you sure you want to create a Tax Refund QR Code?</h3>
<p>A Tax Refund QR Code allows suppliers to claim tax refunds. <br>We need some additional information for this
service.
</p>
</div>
@@ -71,7 +71,7 @@
<!-- Create QR Code Form -->
<div v-if="step === 'create_qr'">
<div class="text-center m-b-30">
<h3>Create Tax Rebate QR Code?</h3>
<h3>Create Tax Refund QR Code?</h3>
</div>
<div class="row">
<div class="col">
@@ -138,7 +138,7 @@
<a @click="download(order)" target="_blank">
<button class="btn btn-sm btn-success bg-master b-rad-none all-caps">Download QR Code Pdf</button>
</a>
<div v-if="order.warehouse.name === 'Guangzhou' || order.supplier_tax_rebate.length" class="btn btn-sm btn-primary b-rad-none all-caps requestModal" data-type="taxRebateQrCode">Tax Rebate QR Code</div>
<div v-if="order.warehouse.name === 'Guangzhou' || order.supplier_tax_rebate.length" class="btn btn-sm btn-primary b-rad-none all-caps requestModal" data-type="taxRebateQrCode">Tax Refund QR Code</div>
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="taxRebateQrCode" size="large">
<tax-rebate-qr-code-form-component :section="section" :data="order"></tax-rebate-qr-code-form-component>
</modal-component>
+2 -2
View File
@@ -14,11 +14,11 @@
</style>
<div class="tax-rebate">
<!-- <h2 style="font-size: 60px;">Tax Rebate Order</h2> -->
<!-- <h2 style="font-size: 60px;">Tax Refund Order</h2> -->
<h2 style="font-size: 60px;">退税单</h2>
<p style="font-size: 25px; color: white;">联络人: {{$supplierTaxRebate['supplier_name']}}</p>
<p style="font-size: 25px; color: white;">联络号码: {{$supplierTaxRebate['supplier_contact_number']}}</p>
<!-- <p style="font-size: 25px;">Tax Rebate No: {{$supplierTaxRebate['reference_number']}}</p> -->
<!-- <p style="font-size: 25px;">Tax Refund No: {{$supplierTaxRebate['reference_number']}}</p> -->
</div>
<table style="width: 100%; border-spacing: 0;">