mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
Debug an old 504 problem at payment-and-billing page > pending payment tab with no data
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Classes\Modules\Orders\Services\ListsOrders;
|
||||
use App\Classes\Modules\Transactions\Processors\CheckStorageInvoiceTransactionProcessor;
|
||||
use App\Classes\ValueObjects\Constants\OrderType;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class CheckStorageInvoicesSingleOrderV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
protected $order;
|
||||
|
||||
public function __construct($order)
|
||||
{
|
||||
$this->order = $order;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Check single order for storage invoice.');
|
||||
$start = new Carbon();
|
||||
|
||||
try{
|
||||
Log::info("Processing Order - ID: {$this->order->id}, Reference: {$this->order->reference}");
|
||||
(App()->make(CheckStorageInvoiceTransactionProcessor::class))->executeOrder($this->order);
|
||||
}
|
||||
catch(\Exception $ex){
|
||||
Log::info('Exception '.$ex->getMessage());
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Check single order for storage invoice. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -55,9 +55,6 @@ class ListPackingListsLogic extends AbstractControllerLogic
|
||||
|
||||
$query = $this->listsPackingLists->execute($this->listsPackingLists->deserializeFilters($request->input('filters')));
|
||||
|
||||
$data = json_encode($request->input('storages'));
|
||||
Log::info("ListPackingListsLogic storages A");
|
||||
|
||||
// if($request->input('storages')){
|
||||
// Log::info("ListPackingListsLogic storages B");
|
||||
// foreach ($query->items() as $item) {
|
||||
@@ -67,8 +64,9 @@ class ListPackingListsLogic extends AbstractControllerLogic
|
||||
// }
|
||||
|
||||
$filters = json_decode($request->input('filters'), true);
|
||||
Log::info('ListPackingListsLogic storages A with Filters:' . json_encode($filters));
|
||||
|
||||
$useNew = false;
|
||||
Log::info('Filters:', $filters);
|
||||
foreach ($query->items() as $item) {
|
||||
//from middleware
|
||||
if($request->input('storages')){
|
||||
@@ -76,13 +74,6 @@ class ListPackingListsLogic extends AbstractControllerLogic
|
||||
}
|
||||
|
||||
//from front end component
|
||||
if(isset($filters['exclude_storages'])){
|
||||
Log::info("ListPackingListsLogic exclude_storages");
|
||||
if (isset($item['storages'])) {
|
||||
unset($item['storages']);
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($filters['include_packages'])){
|
||||
//'include_packages' filter is an attempt to reduce the request-response time to only load basic information unless explicitly indicated to be included
|
||||
$item['include_packages'] = $filters['include_packages'];
|
||||
@@ -104,12 +95,8 @@ class ListPackingListsLogic extends AbstractControllerLogic
|
||||
$item['include_suspended_invoice'] = $filters['include_suspended_invoice'];
|
||||
$useNew = true;
|
||||
}
|
||||
|
||||
Log::info("ListPackingListsLogic useNew");
|
||||
}
|
||||
|
||||
|
||||
Log::info("ListPackingListsLogic useNew: " . ($useNew ? 'true' : 'false'));
|
||||
if($useNew){
|
||||
return $this->collectionResponse(PackingListBaseResource::collection($query));
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Classes\Jobs\Commands\V2\CheckStorageInvoicesSingleOrderV2CommandJob;
|
||||
use Closure;
|
||||
use App\Classes\Modules\Transactions\Processors\CheckStorageInvoiceTransactionProcessor;
|
||||
use App\Classes\Modules\PackingLists\Services\ListsPackingLists;
|
||||
@@ -57,9 +58,15 @@ class CheckForStorageInvoiceByPackingLists
|
||||
if($packingList){
|
||||
$order = $packingList->owner()->first();
|
||||
if($order instanceof Order){
|
||||
$storages = $this->storageInvoiceTransactionProcessor->executeOrder($order);
|
||||
if($storages){
|
||||
$results = array_merge($results, $storages);
|
||||
if(isset($filters['check_for_storage_invoice_asynchronously'])){
|
||||
Log::info("check_for_storage_invoice_asynchronously Order - ID: {$order->id}, Reference: {$order->reference}");
|
||||
CheckStorageInvoicesSingleOrderV2CommandJob::dispatch($order);
|
||||
}
|
||||
else{
|
||||
$storages = $this->storageInvoiceTransactionProcessor->executeOrder($order);
|
||||
if($storages){
|
||||
$results = array_merge($results, $storages);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -75,9 +75,9 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="btn bg-grey no-border" @click="expanded = !expanded" v-if="['Pending Approval', 'Pending Payment'].includes(invoice_status)">
|
||||
<!-- <div class="btn bg-grey no-border" @click="expanded = !expanded" v-if="['Pending Approval', 'Pending Payment'].includes(invoice_status)">
|
||||
<i class="fa" :class="{'fa-angle-down': !expanded, 'fa-angle-up': expanded}" ></i>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="btn bg-grey no-border muted requestModal" v-if="singleInvoice && invoice_status == 'Pending Approval'" data-type="confirmInvoice">
|
||||
<i class="fa fa-check fs-12"></i>
|
||||
</div>
|
||||
@@ -96,7 +96,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row b-t b-grey p-t-10 m-l-5 m-r-5" v-show="expanded" v-if="invoice_status == 'Pending Payment'">
|
||||
<!-- <div class="row b-t b-grey p-t-10 m-l-5 m-r-5" v-show="expanded" v-if="invoice_status == 'Pending Payment'">
|
||||
<div class="col-12 col-md-7 padding-20">
|
||||
<div class="row bg-master-lightest h-100">
|
||||
<div class="col">
|
||||
@@ -233,7 +233,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
+6
-6
@@ -75,9 +75,9 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="btn bg-grey no-border" @click="expanded = !expanded" v-if="['Pending Approval', 'Pending Payment'].includes(invoice_status)">
|
||||
<!-- <div class="btn bg-grey no-border" @click="expanded = !expanded" v-if="['Pending Approval', 'Pending Payment'].includes(invoice_status)">
|
||||
<i class="fa" :class="{'fa-angle-down': !expanded, 'fa-angle-up': expanded}" ></i>
|
||||
</div>
|
||||
</div> -->
|
||||
<div v-if="!item.shipping_transaction">
|
||||
<div v-if="item.order">
|
||||
<div v-if="!item.order.company_module.billingAddress">
|
||||
@@ -196,7 +196,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row b-t b-grey p-t-10 m-l-5 m-r-5" v-show="expanded" v-if="item.shipping_transaction && invoice_status == 'Pending Payment'">
|
||||
<!-- <div class="row b-t b-grey p-t-10 m-l-5 m-r-5 hide" v-show="expanded" v-if="item.shipping_transaction && invoice_status == 'Pending Payment'">
|
||||
<div class="col-12 col-md-7 padding-20">
|
||||
<div class="row bg-master-lightest h-100">
|
||||
<div class="col">
|
||||
@@ -250,7 +250,7 @@
|
||||
<div class="font-heading all-caps fs-12">Paid Total:</div>
|
||||
</div>
|
||||
<div class="col-auto text-right">
|
||||
<!-- <div class="font-heading fs-12">MYR {{(Math.round((item.shipping_transaction.paid_amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}</div> -->
|
||||
<div class="font-heading fs-12" v-if="false">MYR {{(Math.round((item.shipping_transaction.paid_amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}</div>
|
||||
<div class="font-heading fs-12">Paid Total</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -259,7 +259,7 @@
|
||||
<div class="font-heading all-caps fs-12">Floating Amount:</div>
|
||||
</div>
|
||||
<div class="col-auto text-right">
|
||||
<!-- <div class="font-heading fs-12">MYR {{(Math.round((item.shipping_transaction.floating_amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}</div> -->
|
||||
<div class="font-heading fs-12" v-if="false">MYR {{(Math.round((item.shipping_transaction.floating_amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}</div>
|
||||
<div class="font-heading fs-12">Floating Amount</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -295,7 +295,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
+1
-1
@@ -114,7 +114,7 @@
|
||||
<div class="col">
|
||||
<payment-filter-component :endpoint="route('api.packing_list.list')" :data="data"></payment-filter-component>
|
||||
<!-- <admin-payments-billing-with-search-component :options="{has_invoice_status_in: [2], packing_list_limit_one_by_type_ordered_by_invoice_date: true, per_page: 5, check_for_storage_invoice: 1, include_packages: true, include_receive_packing_list: true, include_shipping_transaction: true, include_suspended_invoice: true }" section="pendingPaymentSection" invoice_status="Pending Payment" :with_export="true"></admin-payments-billing-with-search-component> -->
|
||||
<admin-payments-billing-with-search-component :options="{has_invoice_status_in: [2], packing_list_ordered_by_invoice_date: true, per_page: 5, include_shipping_transaction: true, exclude_storages: true }" section="pendingPaymentSection" invoice_status="Pending Payment" :with_export="true"></admin-payments-billing-with-search-component>
|
||||
<admin-payments-billing-with-search-component :options="{has_invoice_status_in: [2], packing_list_ordered_by_invoice_date: true, per_page: 5, check_for_storage_invoice: 1, check_for_storage_invoice_asynchronously: 1, include_packages: true, include_receive_packing_list: true, include_shipping_transaction: true, include_suspended_invoice: true }" section="pendingPaymentSection" invoice_status="Pending Payment" :with_export="true"></admin-payments-billing-with-search-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row tabsContainer tabContent hide" tab-name="paidInvoice" v-if="isActiveTab('paidInvoice') || showTabContent('paidInvoice')">
|
||||
|
||||
Reference in New Issue
Block a user