diff --git a/app/Classes/General/Eloquent/Filters/PackingListLimitOneByTypeOrderedByInvoiceDate.php b/app/Classes/General/Eloquent/Filters/PackingListLimitOneByTypeOrderedByInvoiceDate.php new file mode 100644 index 00000000..a0316805 --- /dev/null +++ b/app/Classes/General/Eloquent/Filters/PackingListLimitOneByTypeOrderedByInvoiceDate.php @@ -0,0 +1,32 @@ +select('packing_lists.*')->join('transactions', function($join){ + $join->on('transactions.owner_id', '=', 'packing_lists.id'); + $join->where('transactions.owner_type', '=', PackingList::class); + $join->where('transactions.status', '=', ApprovalStatus::APPROVED); + $join->whereRaw('(transactions.type <> 16 OR transactions.id = ( + SELECT id FROM transactions WHERE owner_id = packing_lists.id AND type = 16 LIMIT 1 + ))'); + })->orderBy('transactions.updated_at', 'DESC'); + } + +} diff --git a/app/Classes/Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php b/app/Classes/Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php index a9f94410..d094ef74 100644 --- a/app/Classes/Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php +++ b/app/Classes/Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php @@ -145,7 +145,7 @@ class CallbackBillplzLogic $pL = $invoice->owner; $order = $pL->owner; if($order){ - $this->storageInvoiceTransactionProcessor->executeOrder($order, false); //original was set true here so that no group is soft deleted or billplz bill got deleted + $this->storageInvoiceTransactionProcessor->executeOrder($order); } } } diff --git a/app/Classes/Modules/Companies/ControllersLogic/UpdateCompanyCreditTermStatusLogic.php b/app/Classes/Modules/Companies/ControllersLogic/UpdateCompanyCreditTermStatusLogic.php index 9d0689a4..ff57b814 100644 --- a/app/Classes/Modules/Companies/ControllersLogic/UpdateCompanyCreditTermStatusLogic.php +++ b/app/Classes/Modules/Companies/ControllersLogic/UpdateCompanyCreditTermStatusLogic.php @@ -7,6 +7,11 @@ use App\Classes\General\Abstracts\AbstractControllerLogic; use App\Classes\Modules\Companies\Services\FetchesCompany; use App\Classes\Modules\Companies\Services\UpdatesCompanyModuleIsCreditTerm; use App\Classes\Modules\Companies\Standards\Rules\CanUpdateCompanyModule; +use App\Classes\Modules\Transactions\Services\ListsTransactions; +use App\Classes\Modules\Transactions\Services\UpdatesTransactionIsWaived; +use App\Classes\Modules\Transactions\Processors\CheckStorageInvoiceTransactionProcessor; +use App\Classes\ValueObjects\Constants\TransactionType; +use App\Models\Order; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; @@ -34,17 +39,34 @@ class UpdateCompanyCreditTermStatusLogic extends AbstractControllerLogic /** @var CanUpdateCompanyModule */ private $canUpdateCompanyModule; + /** @var ListsTransactions */ + private $listsTransactions; + + /** @var UpdatesTransactionIsWaived */ + private $updatesTransactionIsWaived; + + /** @var CheckStorageInvoiceTransactionProcessor */ + private $storageInvoiceTransactionProcessor; + + + /** * UpdateCompanyCreditTermStatusLogic constructor. * @param FetchesCompany $fetchesCompany * @param UpdatesCompanyModuleIsCreditTerm $updatesCompanyModuleIsCreditTerm * @param CanUpdateCompanyModule $canUpdateCompanyModule + * @param UpdatesTransactionIsWaived $updatesTransactionIsWaived + * @param ListsTransactions $listsTransactions + * @param CheckStorageInvoiceTransactionProcessor $storageInvoiceTransactionProcessor */ - public function __construct(FetchesCompany $fetchesCompany, UpdatesCompanyModuleIsCreditTerm $updatesCompanyModuleIsCreditTerm, CanUpdateCompanyModule $canUpdateCompanyModule) + public function __construct(FetchesCompany $fetchesCompany, UpdatesCompanyModuleIsCreditTerm $updatesCompanyModuleIsCreditTerm, CanUpdateCompanyModule $canUpdateCompanyModule, UpdatesTransactionIsWaived $updatesTransactionIsWaived, ListsTransactions $listsTransactions, CheckStorageInvoiceTransactionProcessor $storageInvoiceTransactionProcessor) { $this->fetchesCompany = $fetchesCompany; $this->updatesCompanyModuleIsCreditTerm = $updatesCompanyModuleIsCreditTerm; $this->canUpdateCompanyModule = $canUpdateCompanyModule; + $this->listsTransactions = $listsTransactions; + $this->updatesTransactionIsWaived = $updatesTransactionIsWaived; + $this->storageInvoiceTransactionProcessor = $storageInvoiceTransactionProcessor; } /** @@ -59,7 +81,8 @@ class UpdateCompanyCreditTermStatusLogic extends AbstractControllerLogic $this->canUpdateCompanyModule->passes(); $company = $this->fetchesCompany->execute(['id' => $request->route('id')]); - $isCreditTerm = $company->companyModules()->first()->connections()->first()->is_credit_term; + $companyModule = $company->companyModules()->first(); + $isCreditTerm = $companyModule->connections()->first()->is_credit_term; if ($isCreditTerm == 1) { $isCreditTerm = 0; @@ -67,6 +90,28 @@ class UpdateCompanyCreditTermStatusLogic extends AbstractControllerLogic $isCreditTerm = 1; } + if($isCreditTerm === 1){ + //{"per_page":10,"order_by":{"column":"id","DESC":true},"status_in":[2],"receiver":190,"type_in":[1],"does_not_have_payment_status_in":[0,1],"does_not_have_groups":1,"check_for_storage_invoice":1} + + $filters = [ + 'status_in' => [2], + 'receiver' => $companyModule->id, + 'type_in' => [TransactionType::STORAGE_INVOICE] + ]; + + $transactions = $this->listsTransactions->execute($filters); + foreach($transactions as $transaction){ + $this->updatesTransactionIsWaived->execute($transaction); + $packingList = $transaction->owner()->first(); + if($packingList){ + $order = $packingList->owner()->first(); + if($order instanceof Order){ + $storages = $this->storageInvoiceTransactionProcessor->executeOrder($order); + } + } + } + } + $this->updatesCompanyModuleIsCreditTerm->execute($company->companyModules()->first()->connections()->first(), $isCreditTerm); Log::info(Auth::user()->email." updated credit term status for customer with id: " .$request->route('id'). " to status " . $isCreditTerm); diff --git a/app/Classes/Modules/PackingLists/Processors/ListPackingListsJobProcessor.php b/app/Classes/Modules/PackingLists/Processors/ListPackingListsJobProcessor.php index 535e5d29..b0bcbd93 100644 --- a/app/Classes/Modules/PackingLists/Processors/ListPackingListsJobProcessor.php +++ b/app/Classes/Modules/PackingLists/Processors/ListPackingListsJobProcessor.php @@ -7,8 +7,11 @@ use App\Classes\Modules\PackingLists\Services\ListsPackingLists; use App\Classes\Modules\Jobs\Processors\UpdateJobResultProcessor; use App\Classes\General\Helper; use App\Classes\Modules\Jobs\DataTransferObjects\ListGenericJobObject; +use App\Http\Middleware\CheckForStorageInvoiceByPackingLists; use App\Http\Resources\ListPackingListJobResource; use App\Http\Resources\ListPackingListDetailsJobResource; +use App\Http\Resources\ListPackingListJobWithStorageResource; +use Illuminate\Support\Facades\Log; class ListPackingListsJobProcessor { @@ -19,15 +22,19 @@ class ListPackingListsJobProcessor /** @var UpdateJobResultProcessor */ private $updateJobResultProcessor; + /** @var CheckForStorageInvoiceByPackingLists */ + private $checkForStorageInvoiceByPackingLists; + /** * ListPackingListsJobProcessor constructor. * @param ListsPackingLists $listsPackingLists * @param UpdateJobResultProcessor $updateJobResultProcessor */ - public function __construct(ListsPackingLists $listsPackingLists, UpdateJobResultProcessor $updateJobResultProcessor) + public function __construct(ListsPackingLists $listsPackingLists, UpdateJobResultProcessor $updateJobResultProcessor, CheckForStorageInvoiceByPackingLists $checkForStorageInvoiceByPackingLists) { $this->listsPackingLists = $listsPackingLists; $this->updateJobResultProcessor = $updateJobResultProcessor; + $this->checkForStorageInvoiceByPackingLists = $checkForStorageInvoiceByPackingLists; } /** @@ -41,18 +48,40 @@ class ListPackingListsJobProcessor $query = $this->listsPackingLists->execute($this->listsPackingLists->deserializeFilters($listGenericJobObject->getPayload()['filters']), ['page' => $listGenericJobObject->getPayload()['page']]); // $query = $this->listsPackingLists->execute(array_merge($this->listsPackingLists->deserializeFilters($listGenericJobObject->getPayload()['filters']), ['page' => $listGenericJobObject->getPayload()['page'], 'with_containers_packages' => true])); - foreach ($query->items() as &$item) { - $item['userInfo'] = $listGenericJobObject->getUserInfo(); + $filtersArray = json_decode($listGenericJobObject->getPayload()['filters'], true); + + $storages = []; + if(isset($filtersArray['check_for_storage_invoice'])) + { + $myRequest = new \Illuminate\Http\Request(); + $myRequest->setMethod('POST'); + $myRequest->request->add($listGenericJobObject->getPayload()); + $next = function ($request) { + return $request; + }; + + $response = $this->checkForStorageInvoiceByPackingLists->handle($myRequest, $next); + $storages = $response->input('storages'); } - $filtersArray = json_decode($listGenericJobObject->getPayload()['filters'], true); - if(isset($filtersArray['does_not_have_transaction_type'])){ //For Pending Invoice query + foreach ($query->items() as &$item) { + $item['userInfo'] = $listGenericJobObject->getUserInfo(); + $item['storages'] = $storages; + } + + if(isset($filtersArray['does_not_have_transaction_type'])){ //For Payment and Billing page > Pending Invoice tab $resultCurrent = Helper::collectionResponse(ListPackingListDetailsJobResource::collection($query)); $this->updateJobResultProcessor->execute($listGenericJobObject, $resultCurrent); } else{ - $resultCurrent = Helper::collectionResponse(ListPackingListJobResource::collection($query)); - $this->updateJobResultProcessor->execute($listGenericJobObject, $resultCurrent); + if($storages){ //For Payment and Billing page > Pending Payment tab, Paid Invoice tab + $resultCurrent = Helper::collectionResponse(ListPackingListJobWithStorageResource::collection($query)); + $this->updateJobResultProcessor->execute($listGenericJobObject, $resultCurrent); + } + else{ + $resultCurrent = Helper::collectionResponse(ListPackingListJobResource::collection($query)); + $this->updateJobResultProcessor->execute($listGenericJobObject, $resultCurrent); + } } } } diff --git a/app/Classes/Modules/Transactions/Processors/CheckStorageInvoiceTransactionProcessor.php b/app/Classes/Modules/Transactions/Processors/CheckStorageInvoiceTransactionProcessor.php index bc9adccd..d5c87ce0 100644 --- a/app/Classes/Modules/Transactions/Processors/CheckStorageInvoiceTransactionProcessor.php +++ b/app/Classes/Modules/Transactions/Processors/CheckStorageInvoiceTransactionProcessor.php @@ -99,33 +99,38 @@ class CheckStorageInvoiceTransactionProcessor return $this->executeOrder($order); } - public function executeOrder(Order $order, bool $isBackDoorCheck = false){ + public function executeOrder(Order $order){ $results = []; $marking = $order->companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference; $is_credit_term = $order->companyModule->inviters()->withPivot('is_credit_term')->first()->pivot->is_credit_term; - if(!$is_credit_term){ - Log::channel('storage_invoices')->info('orderId: '.$order->id.', orderReference: '.$order->reference.', marking: '.$marking.', is_credit_term: '.$is_credit_term); - $packingLists = $order->destinationWarehousePackages; + Log::channel('storage_invoices')->info('orderId: '.$order->id.', orderReference: '.$order->reference.', marking: '.$marking.', is_credit_term: '.$is_credit_term); + $packingLists = $order->destinationWarehousePackages; - foreach ($packingLists as $packingList){ - $arrivalDateAtChinaWarehouse = $this->getArrivalDateAtChinaWarehoue($packingList); - Log::channel('storage_invoices')->info('arrivalDateAtChinaWarehouse: '.json_encode($arrivalDateAtChinaWarehouse)); - Log::channel('storage_invoices')->info('destinationWarehousePackage: '.json_encode($packingList)); - $eta = $this->getEtaFromPackingList($packingList); - if($arrivalDateAtChinaWarehouse && $eta){ - $transactions = $packingList->transactions()->where('transactions.type', TransactionType::SHIPPING_INVOICE)->whereIn('transactions.status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->get(); - // $transactions = $destinationWarehousePackage->transactions()->where('transactions.type', TransactionType::SHIPPING_INVOICE)->where('transactions.status', ApprovalStatus::APPROVED)->get(); + foreach ($packingLists as $packingList){ + $arrivalDateAtChinaWarehouse = $this->getArrivalDateAtChinaWarehoue($packingList); + Log::channel('storage_invoices')->info('arrivalDateAtChinaWarehouse: '.json_encode($arrivalDateAtChinaWarehouse)); + Log::channel('storage_invoices')->info('destinationWarehousePackage: '.json_encode($packingList)); + $eta = $this->getEtaFromPackingList($packingList); + if($arrivalDateAtChinaWarehouse && $eta){ + $transactions = $packingList->transactions()->where('transactions.type', TransactionType::SHIPPING_INVOICE)->whereIn('transactions.status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->get(); + // $transactions = $destinationWarehousePackage->transactions()->where('transactions.type', TransactionType::SHIPPING_INVOICE)->where('transactions.status', ApprovalStatus::APPROVED)->get(); - /** @var Transaction $invoice_transaction */ - foreach ($transactions as $invoice_transaction){ - $result = $this->processSingleTransactionOfTypeShippingInvoice($invoice_transaction, $packingList, $order->company_module_id, $eta, $isBackDoorCheck); - if($result){ - $results[] = $result; - } + /** @var Transaction $invoice_transaction */ + foreach ($transactions as $invoice_transaction){ + $result = null; + if(!$is_credit_term){ + $result = $this->processSingleTransactionOfTypeShippingInvoice($invoice_transaction, $packingList, $order->company_module_id, $eta); + } + else{ + $result = $this->isPaidOrWaivedStorageInvoiceExist($invoice_transaction, $packingList, $eta); + } + if($result){ + $results[] = $result; } } } } + return $results; } @@ -167,7 +172,7 @@ class CheckStorageInvoiceTransactionProcessor return null; } - private function processSingleTransactionOfTypeShippingInvoice($transaction, $destinationWarehousePackage, $company_module_id, $eta, $isBackDoorCheck){ + private function processSingleTransactionOfTypeShippingInvoice($transaction, $destinationWarehousePackage, $company_module_id, $eta){ $pricePerCBM = 3; $resultNumberOfDaysFree = 10; $dt1 = $eta->copy()->addDay()->startOfDay(); @@ -227,14 +232,14 @@ class CheckStorageInvoiceTransactionProcessor if(abs($price_cbm - $amount) > $epsilon && $storageInvoice->status !== ApprovalStatus::COMPLETED){ $paymentTransactions = $storageInvoice->transactions()->where('transactions.type', TransactionType::PAYMENT)->where('transactions.status', ApprovalStatus::PENDING_SUBMISSION)->get(); - if(!$isBackDoorCheck){ - if(count($paymentTransactions) > 0){ - $this->updatePaymentTransactionViaNonGroupPayment($paymentTransactions); - } - else{ - $this->updatePaymentTransactionViaGroupPayment($storageInvoice); - } + // if(!$isBackDoorCheck){ + if(count($paymentTransactions) > 0){ + $this->updatePaymentTransactionViaNonGroupPayment($paymentTransactions); } + else{ + $this->updatePaymentTransactionViaGroupPayment($storageInvoice); + } + //} $proceedToUpdate = true; } @@ -266,6 +271,61 @@ class CheckStorageInvoiceTransactionProcessor } + private function isPaidOrWaivedStorageInvoiceExist($transaction, $packingList, $eta){ + $pricePerCBM = 3; + $resultNumberOfDaysFree = 10; + $dt1 = $eta->copy()->addDay()->startOfDay(); + $resultStartDate = $dt1->format('Y-m-d'); + $currentDatetime = Carbon::now(); + $dt2 = $currentDatetime->copy()->addDay()->startOfDay(); + $resultCurrentDate = $dt2->format('Y-m-d H:i:s'); + $interval = Carbon::parse($dt2)->diff($dt1); + $resultNumberOfDaysExceeded = $interval->days - $resultNumberOfDaysFree; + $paidStorageInvoice = $packingList->transactions()->where('transactions.type', TransactionType::STORAGE_INVOICE)->whereIn('transactions.status', [ApprovalStatus::COMPLETED])->first(); + if($paidStorageInvoice){ + $storageInvoice = $paidStorageInvoice; + } + else{ + $waivedStorageInvoice = $packingList->transactions()->where('transactions.type', TransactionType::STORAGE_INVOICE)->where('transactions.is_waived', 1)->whereIn('transactions.status', [ApprovalStatus::APPROVED])->first(); + $storageInvoice = $waivedStorageInvoice; + } + + if($storageInvoice){ + $storageInvoiceId = $storageInvoice->id; + + if(isset($storageInvoice->is_waived) && $storageInvoice->is_waived){ + $pricePerCBM = 0; + } + + $transactionDetailsItems = $transaction->transactionDetails()->get(); + $cbm = 0.00; + foreach ($transactionDetailsItems as $tdItem){ + $quantity = $tdItem->quantity; + if($tdItem->price < 0.00){ + $quantity = $quantity * -1; + } + $cbm = $cbm + $quantity; + } + + if($storageInvoiceId !== 0){ + $result = [ + 'parentInvoiceId' => $transaction->id, + 'storageInvoiceId' => $storageInvoiceId, + 'numberOfDaysExceeded' => $resultNumberOfDaysExceeded, + 'numberOfDaysFree' => $resultNumberOfDaysFree, + 'startDate' => $resultStartDate, + 'currentDate' => $resultCurrentDate, + 'cbm' => $cbm, + 'pricePerCBM' => $pricePerCBM, + 'storageInvoice' => new TransactionWithStorageResource($storageInvoice) + ]; + return $result; + } + } + + return []; + } + private function updatePaymentTransactionViaGroupPayment($storageInvoice){ Log::channel('storage_invoices')->info('updatePaymentTransactionViaGroupPayment'); $groups = $storageInvoice->groups()->get(); diff --git a/app/Classes/Modules/Transactions/Standards/Validators/WaiveTransactionValidation.php b/app/Classes/Modules/Transactions/Standards/Validators/WaiveTransactionValidation.php index d7a80ef3..b6de888b 100644 --- a/app/Classes/Modules/Transactions/Standards/Validators/WaiveTransactionValidation.php +++ b/app/Classes/Modules/Transactions/Standards/Validators/WaiveTransactionValidation.php @@ -5,6 +5,8 @@ namespace App\Classes\Modules\Transactions\Standards\Validators; use App\Classes\General\Abstracts\AbstractValidation; use App\Classes\Modules\Transactions\DataTransferObjects\WaiveTransactionObject; +use App\Classes\ValueObjects\Constants\ApprovalStatus; +use App\Classes\ValueObjects\Constants\TransactionType; class WaiveTransactionValidation extends AbstractValidation { @@ -28,8 +30,8 @@ class WaiveTransactionValidation extends AbstractValidation protected function rules(): array { return [ 'id' => 'required', - 'type' => ['required', 'numeric', 'in:16'], //Only storage invoice (type 16) can be waived - 'status' => ['required', 'numeric', 'in:2'], //Approve storage invoice only, paid invoice stricly forbidden + 'type' => ['required', 'numeric', 'in:'.TransactionType::STORAGE_INVOICE], //Only storage invoice (type 16) can be waived + 'status' => ['required', 'numeric', 'in:'.ApprovalStatus::APPROVED], //Approve storage invoice only, paid invoice stricly forbidden // 'billNo' => 'required', ]; } diff --git a/app/Http/Resources/ListPackingListJobWithStorageResource.php b/app/Http/Resources/ListPackingListJobWithStorageResource.php new file mode 100644 index 00000000..2cb01699 --- /dev/null +++ b/app/Http/Resources/ListPackingListJobWithStorageResource.php @@ -0,0 +1,57 @@ +userInfo ? $this->userInfo->type : Auth()->user()->type, [RoleTypes::SHADOW_ADMIN, RoleTypes::SUPER_ADMIN]); + $packages = !$this->packingLists()->exists() || $exceptionUsers ? $this->packages : $this->packingLists->first()->packages; + $shippingTransaction = $this->transactions()->where('type', TransactionType::SHIPPING_INVOICE)->whereNotIn('status', [ApprovalStatus::SUSPENDED, ApprovalStatus::EXPIRED])->first(); + $transactions = $this->transactions()->whereNotIn('transactions.status', [0, 1])->whereIn('transactions.type', [TransactionType::SHIPPING_INVOICE, TransactionType::STORAGE_INVOICE])->get(); + $storages = []; + + if($this->storages){ + $transactionId = $shippingTransaction->id; + $filteredStorages = array_filter($this->storages, function ($storage) use ($transactionId) { + return isset($storage['parentInvoiceId']) && $storage['parentInvoiceId'] == $transactionId; + }); + $storages = $filteredStorages; + } + + return [ + 'id' => $this->id, + 'claimant_id' => $this->claimant_id, + 'reference' => $this->reference, + 'status' => $this->status, + 'transport' => new TransportResource($this->transports()->first()), + 'type' => $this->type, + // 'receive_packing_list' => $this->when($this->type === PackingListType::SHIPPING_PACKING_LIST, new PackingListV2Resource(PackingList::where('reference', $this->reference)->where('type', PackingListType::WAREHOUSE_RECEIVE_LIST)->first(), $this->userInfo)), + // 'packages' => PackageResource::collection($packages), + // $this->mergeWhen($this->owner instanceof Order, [ + // 'order' => New OrderResource($this->owner) + // ]), + 'container' => new ContainerResource($this->containers->first()), + 'packages' => PackageWithoutOrderResource::collection($packages), + $this->mergeWhen($this->owner instanceof Order, [ 'order' => New OrderResource($this->owner) ]), + 'shipping_transaction' => count($storages) == 0 ? new TransactionWithStorageResource($shippingTransaction): null, + 'storages' => $storages, + 'invoices' => TransactionWithStorageResource::collection($transactions), + 'suspended_invoice' => new TransactionResource($this->transactions()->where('type', TransactionType::SHIPPING_INVOICE)->whereIn('status', [ApprovalStatus::SUSPENDED])->first()), + // 'suspended_invoices' => TransactionResource::collection($this->transactions()->where('type', TransactionType::SHIPPING_INVOICE)->whereIn('status', [ApprovalStatus::SUSPENDED])->get()), + ]; + } +} diff --git a/resources/assets/vue/components/companies/forms/UpdateCreditTermStatusFormComponent.vue b/resources/assets/vue/components/companies/forms/UpdateCreditTermStatusFormComponent.vue index 0a2f95b3..512678b0 100644 --- a/resources/assets/vue/components/companies/forms/UpdateCreditTermStatusFormComponent.vue +++ b/resources/assets/vue/components/companies/forms/UpdateCreditTermStatusFormComponent.vue @@ -8,7 +8,7 @@
Update Credit Term Customer
Are you sure you want to update the credit term status for this company to {{ data.is_credit_term === 1 ? 'NO' : 'YES' }}?
- +

All existing invoices for storage that have not yet been paid will be waived

diff --git a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingWithSearchComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingWithSearchComponent.vue index 9b2cc71f..6cbfa39e 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingWithSearchComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingWithSearchComponent.vue @@ -34,18 +34,12 @@
- - diff --git a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingWithSearchPollingComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingWithSearchPollingComponent.vue index 13df803e..a7017c1f 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingWithSearchPollingComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingWithSearchPollingComponent.vue @@ -34,15 +34,10 @@ - - diff --git a/resources/assets/vue/components/paymentsBilling/elements/GroupPaymentsBillingComponents.vue b/resources/assets/vue/components/paymentsBilling/elements/GroupPaymentsBillingComponents.vue index 3d8a39ae..763f0174 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/GroupPaymentsBillingComponents.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/GroupPaymentsBillingComponents.vue @@ -85,7 +85,7 @@
- +
diff --git a/resources/assets/vue/components/paymentsBilling/elements/PaymentHistoryComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/PaymentHistoryComponent.vue index c09d9334..ec886b13 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/PaymentHistoryComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/PaymentHistoryComponent.vue @@ -50,10 +50,10 @@ -

Container

{{item.packages[0].container.container_reference}}
+
{{item.container.container_reference}}

Invoice Date

diff --git a/resources/assets/vue/components/paymentsBilling/elements/SingleAdminPaymentsBillingWithoutStorageComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/SingleAdminPaymentsBillingWithoutStorageComponent.vue index 08751538..4a26c402 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/SingleAdminPaymentsBillingWithoutStorageComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/SingleAdminPaymentsBillingWithoutStorageComponent.vue @@ -17,6 +17,7 @@

Container

{{item.packages[0].container.container_reference}}
+
{{item.container.container_reference}}

Invoice Date

diff --git a/resources/assets/vue/components/paymentsBilling/elements/SingleGroupPaymentHistoryTransactionDetailsComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/SingleGroupPaymentHistoryTransactionDetailsComponent.vue index 60419010..7a95322e 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/SingleGroupPaymentHistoryTransactionDetailsComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/SingleGroupPaymentHistoryTransactionDetailsComponent.vue @@ -93,7 +93,7 @@
-
+
diff --git a/resources/assets/vue/components/paymentsBilling/elements/SingleGroupPaymentTransactionDetailsComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/SingleGroupPaymentTransactionDetailsComponent.vue index 621f9bcc..b2db1dfa 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/SingleGroupPaymentTransactionDetailsComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/SingleGroupPaymentTransactionDetailsComponent.vue @@ -34,7 +34,7 @@ - + @@ -55,10 +55,12 @@ bank_id: 1 }, section: 'bookingDetailSection', + groupId: 0, } }, mounted() { this.item.id = this.item.payment_transaction.id; + this.groupId = this.item && this.item.transactions_ids && this.item.transactions_ids.length > 0 ? this.item.transactions_ids[0].group_id : 0; }, methods: { clickExpand(){ @@ -71,3 +73,4 @@ mixins: [componentHandler] } + diff --git a/resources/assets/vue/components/paymentsBilling/forms/DeleteGroupPaymentAttemptFormComponent.vue b/resources/assets/vue/components/paymentsBilling/forms/DeleteGroupPaymentAttemptFormComponent.vue new file mode 100644 index 00000000..85b6121f --- /dev/null +++ b/resources/assets/vue/components/paymentsBilling/forms/DeleteGroupPaymentAttemptFormComponent.vue @@ -0,0 +1,40 @@ + + diff --git a/resources/assets/vue/components/paymentsBilling/forms/DeletePaymentAttemptFormComponent.vue b/resources/assets/vue/components/paymentsBilling/forms/DeletePaymentAttemptFormComponent.vue index f3248ed8..9feeda60 100644 --- a/resources/assets/vue/components/paymentsBilling/forms/DeletePaymentAttemptFormComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/forms/DeletePaymentAttemptFormComponent.vue @@ -27,6 +27,15 @@ import componentHandler from '../../../general/mixins/componentHandler'; import ModalFormHandler from '../../../general/mixins/modalFormHandler'; export default { + methods:{ + successHandler(response){ + this.closeModal(); + this.formHandler(); + if(response.payload.data.id){ + window.location.reload(); + } + }, + }, mixins: [componentHandler, ModalFormHandler] } diff --git a/resources/assets/vue/components/paymentsBilling/sections/AdminPaymentsBillingPollingSectionComponent.vue b/resources/assets/vue/components/paymentsBilling/sections/AdminPaymentsBillingPollingSectionComponent.vue index 25e4c303..a8315f55 100644 --- a/resources/assets/vue/components/paymentsBilling/sections/AdminPaymentsBillingPollingSectionComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/sections/AdminPaymentsBillingPollingSectionComponent.vue @@ -113,12 +113,12 @@
- +
- +
diff --git a/resources/views/pages/paymentAndBilling2.blade.php b/resources/views/pages/paymentAndBilling2.blade.php index cf4f339f..ac1de6b2 100644 --- a/resources/views/pages/paymentAndBilling2.blade.php +++ b/resources/views/pages/paymentAndBilling2.blade.php @@ -1,5 +1,136 @@ @extends('layouts.base_portal') @section('inner_content') +
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
Payments
+
+
+
+
+
+ {{--
+
+
+
+
+ +
+
+
+
+
Refunds
+
+
+
+
+
--}} + {{--
+
+
+
+
+ +
+
+
+
+
Supplier Bills
+
+
+
+
+
--}} +
+
+
+
+
+
+
+ + + +
+
+
+
+ {{--
+
+
+
+ + + +
+
+
+
--}} +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
Dispute
+
+
+
+
+
+
+
+
+
+
+ + + +
+
+
+
+
+
+
+