From 20d706caf85e6925a2ba288711474ecb6f472967 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Sun, 25 Sep 2022 22:30:24 +0800 Subject: [PATCH 001/104] fix qr image ratio in pdf --- resources/views/pdfs/qr.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/pdfs/qr.blade.php b/resources/views/pdfs/qr.blade.php index 312e3aa2..8518f7f8 100644 --- a/resources/views/pdfs/qr.blade.php +++ b/resources/views/pdfs/qr.blade.php @@ -16,7 +16,7 @@ - id.'}') }}" style="margin-top: 20px;" /> + id.'}') }}" style="margin-top: 20px; width: 250px; height: 250px;" /> From 1f6c6bf87d94ae6ca489fccad85c059f7fc7114f Mon Sep 17 00:00:00 2001 From: omair saleh Date: Sun, 25 Sep 2022 22:33:27 +0800 Subject: [PATCH 002/104] fix qr image ratio in pdf --- resources/views/pdfs/qr.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/pdfs/qr.blade.php b/resources/views/pdfs/qr.blade.php index 8518f7f8..312e3aa2 100644 --- a/resources/views/pdfs/qr.blade.php +++ b/resources/views/pdfs/qr.blade.php @@ -16,7 +16,7 @@ - id.'}') }}" style="margin-top: 20px; width: 250px; height: 250px;" /> + id.'}') }}" style="margin-top: 20px;" /> From 8b3e60a74ac7f4cf40140cb25fa1d5e50d1be12e Mon Sep 17 00:00:00 2001 From: omair saleh Date: Sun, 25 Sep 2022 22:33:59 +0800 Subject: [PATCH 003/104] fix qr image ratio in pdf --- resources/views/pdfs/qr.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/pdfs/qr.blade.php b/resources/views/pdfs/qr.blade.php index 312e3aa2..3c430198 100644 --- a/resources/views/pdfs/qr.blade.php +++ b/resources/views/pdfs/qr.blade.php @@ -16,7 +16,7 @@ - id.'}') }}" style="margin-top: 20px;" /> + id.'}') }}" style="width: 250px; height: 250px;" /> From 4667d8fbc395094e4f9139b3361dd13a3a0d3bac Mon Sep 17 00:00:00 2001 From: omair saleh Date: Sun, 25 Sep 2022 22:34:32 +0800 Subject: [PATCH 004/104] fix qr image ratio in pdf --- resources/views/pdfs/qr.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/pdfs/qr.blade.php b/resources/views/pdfs/qr.blade.php index 3c430198..1338fbc0 100644 --- a/resources/views/pdfs/qr.blade.php +++ b/resources/views/pdfs/qr.blade.php @@ -16,7 +16,7 @@ - id.'}') }}" style="width: 250px; height: 250px;" /> + id.'}') }}" style="width: 240px; height: 240px;" /> From 9b70fdf37f928c749e79c9afcf18a55090af46c9 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Sun, 25 Sep 2022 22:35:09 +0800 Subject: [PATCH 005/104] fix qr image ratio in pdf --- resources/views/pdfs/qr.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/pdfs/qr.blade.php b/resources/views/pdfs/qr.blade.php index 1338fbc0..107d94e3 100644 --- a/resources/views/pdfs/qr.blade.php +++ b/resources/views/pdfs/qr.blade.php @@ -16,7 +16,7 @@ - id.'}') }}" style="width: 240px; height: 240px;" /> + id.'}') }}" style="width: 245px; height: 245px;" /> From 2839f7855c8b9ef4cdaaa56f8861f7e0da85ec30 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Sun, 25 Sep 2022 22:35:56 +0800 Subject: [PATCH 006/104] fix qr image ratio in pdf --- resources/views/pdfs/qr.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/pdfs/qr.blade.php b/resources/views/pdfs/qr.blade.php index 107d94e3..c8898a38 100644 --- a/resources/views/pdfs/qr.blade.php +++ b/resources/views/pdfs/qr.blade.php @@ -16,7 +16,7 @@ - id.'}') }}" style="width: 245px; height: 245px;" /> + id.'}') }}" style="width: 235px; height: 235px;" /> From 6613ca9a8691e07d22090abacab685500235e3bc Mon Sep 17 00:00:00 2001 From: omair saleh Date: Sun, 25 Sep 2022 22:36:34 +0800 Subject: [PATCH 007/104] fix qr image ratio in pdf --- resources/views/pdfs/qr.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/pdfs/qr.blade.php b/resources/views/pdfs/qr.blade.php index c8898a38..8a7ff9b2 100644 --- a/resources/views/pdfs/qr.blade.php +++ b/resources/views/pdfs/qr.blade.php @@ -16,7 +16,7 @@ - id.'}') }}" style="width: 235px; height: 235px;" /> + id.'}') }}" style="width: 230px; height: 230px;" /> From a90766ba132d129c0fb955b8fac5fc87c63e11dc Mon Sep 17 00:00:00 2001 From: omair saleh Date: Mon, 26 Sep 2022 12:15:45 +0800 Subject: [PATCH 008/104] fix cnt quantity in the invoice --- .../ControllersLogic/CreateShippingInvoiceTransactionLogic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Modules/Transactions/ControllersLogic/CreateShippingInvoiceTransactionLogic.php b/app/Classes/Modules/Transactions/ControllersLogic/CreateShippingInvoiceTransactionLogic.php index 0906275a..601f1ea5 100644 --- a/app/Classes/Modules/Transactions/ControllersLogic/CreateShippingInvoiceTransactionLogic.php +++ b/app/Classes/Modules/Transactions/ControllersLogic/CreateShippingInvoiceTransactionLogic.php @@ -213,7 +213,7 @@ class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic $object_detail = new TransactionDetailObject( 'SHIPPING_FEE', - TransactionDetailType::SHIPPING_FEE.'
'.round($packing_list->packages->sum('quantity'), 3).' CTNS - '.round($cbm, 3).' CBM', + TransactionDetailType::SHIPPING_FEE.'
'.round($packing_list->packages->where('type', '!=', PackageType::OVER_WEIGHT)->sum('quantity'), 3).' CTNS - '.round($cbm, 3).' CBM', $cbm, $price_cbm ); From ee1dfea0c80f8b998f8d23e2a2e2875b62a3f530 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Tue, 27 Sep 2022 10:33:13 +0800 Subject: [PATCH 009/104] show packing list reference --- .../vue/components/containers/elements/PackingListComponent.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/assets/vue/components/containers/elements/PackingListComponent.vue b/resources/assets/vue/components/containers/elements/PackingListComponent.vue index 6aaa5a3b..852b0940 100644 --- a/resources/assets/vue/components/containers/elements/PackingListComponent.vue +++ b/resources/assets/vue/components/containers/elements/PackingListComponent.vue @@ -3,6 +3,7 @@
{{item.order.company_module.marking}}/{{item.order.reference}} +

{{item.reference}}

{{item.receive_packing_list.transport.drop_date}}

Unclaimed Packing List
From ee65ceac1d50641d4c620ed114e317d2d7cef069 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Tue, 27 Sep 2022 10:46:42 +0800 Subject: [PATCH 010/104] update delivery keywords for yd --- .../Processors/FetchOrderListsFromYdPortalProcessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Modules/PackingLists/Processors/FetchOrderListsFromYdPortalProcessor.php b/app/Classes/Modules/PackingLists/Processors/FetchOrderListsFromYdPortalProcessor.php index 16205f62..b2b81541 100644 --- a/app/Classes/Modules/PackingLists/Processors/FetchOrderListsFromYdPortalProcessor.php +++ b/app/Classes/Modules/PackingLists/Processors/FetchOrderListsFromYdPortalProcessor.php @@ -227,7 +227,7 @@ class FetchOrderListsFromYdPortalProcessor $unstuffingDate = Carbon::parse($trackingRow->trackingtime); } - if (Str::contains($trackingRow->tracking, ['派送中', '签收完成', ' 第三方提货', '货物已派送完成'])) { + if (Str::contains($trackingRow->tracking, ['派送中', '签收完成', ' 第三方提货', '货物已派送完成', '派送'])) { $deliveryDate = Carbon::parse($trackingRow->trackingtime); } } From 4d39d7f43f40ad9ad129679963bdcc54d7759439 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Tue, 27 Sep 2022 10:53:40 +0800 Subject: [PATCH 011/104] update delivery keywords for yd --- .../Processors/FetchOrderListsFromYdPortalProcessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Modules/PackingLists/Processors/FetchOrderListsFromYdPortalProcessor.php b/app/Classes/Modules/PackingLists/Processors/FetchOrderListsFromYdPortalProcessor.php index b2b81541..b2a1c2c1 100644 --- a/app/Classes/Modules/PackingLists/Processors/FetchOrderListsFromYdPortalProcessor.php +++ b/app/Classes/Modules/PackingLists/Processors/FetchOrderListsFromYdPortalProcessor.php @@ -227,7 +227,7 @@ class FetchOrderListsFromYdPortalProcessor $unstuffingDate = Carbon::parse($trackingRow->trackingtime); } - if (Str::contains($trackingRow->tracking, ['派送中', '签收完成', ' 第三方提货', '货物已派送完成', '派送'])) { + if (Str::contains($trackingRow->tracking, ['派送中', '签收完成', ' 第三方提货', '货物已派送完成', '派送', 'delivery', 'delivered'])) { $deliveryDate = Carbon::parse($trackingRow->trackingtime); } } From 28e5fa43a52e1666f25993de93df8a09e74cd330 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Tue, 27 Sep 2022 10:54:31 +0800 Subject: [PATCH 012/104] update delivery keywords for yd --- .../Processors/FetchOrderListsFromYdPortalProcessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Modules/PackingLists/Processors/FetchOrderListsFromYdPortalProcessor.php b/app/Classes/Modules/PackingLists/Processors/FetchOrderListsFromYdPortalProcessor.php index b2a1c2c1..2133b4aa 100644 --- a/app/Classes/Modules/PackingLists/Processors/FetchOrderListsFromYdPortalProcessor.php +++ b/app/Classes/Modules/PackingLists/Processors/FetchOrderListsFromYdPortalProcessor.php @@ -227,7 +227,7 @@ class FetchOrderListsFromYdPortalProcessor $unstuffingDate = Carbon::parse($trackingRow->trackingtime); } - if (Str::contains($trackingRow->tracking, ['派送中', '签收完成', ' 第三方提货', '货物已派送完成', '派送', 'delivery', 'delivered'])) { + if (Str::contains($trackingRow->tracking, ['派送中', '已签收', '签收完成', ' 第三方提货', '货物已派送完成', '派送', 'delivery', 'delivered'])) { $deliveryDate = Carbon::parse($trackingRow->trackingtime); } } From 5964123c5f0b38852127ee00e2aaf69065e745ed Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Tue, 27 Sep 2022 13:28:30 +0800 Subject: [PATCH 013/104] fix bug when dispute has no comment --- .../elements/AdminDisputePaymentsBillingComponent.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/assets/vue/components/paymentsBilling/elements/AdminDisputePaymentsBillingComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/AdminDisputePaymentsBillingComponent.vue index 1f0416ca..10560438 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/AdminDisputePaymentsBillingComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/AdminDisputePaymentsBillingComponent.vue @@ -3,7 +3,7 @@
-
+

Marking

@@ -29,7 +29,7 @@

Billing Question

-
{{ latestComment.content }}
+
{{ latestComment ? latestComment.content : '' }}
From 78a8451699cb3d53588d28dff7e61487fde9ddc0 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Tue, 27 Sep 2022 13:31:28 +0800 Subject: [PATCH 014/104] fix unclaimed packing list pending invoice --- .../elements/AdminPaymentsBillingComponent.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue index d7756791..f2785e18 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue @@ -3,7 +3,7 @@
-
+

Marking

@@ -24,9 +24,12 @@
{{ item.shippng_transaction.updated_at }}
-

Address

-
{{ item.order.address.post_code_area}}
-
{{ item.order.address.district.name +' '+item.order.address.postcode+' '+item.order.address.state.name }}
+
+

Address

+
{{ item.order.address.post_code_area}}
+
{{ item.order.address.district.name +' '+item.order.address.postcode+' '+item.order.address.state.name }}
+
+
Unclaimed

Status

@@ -49,7 +52,7 @@
-
+
-
+
From a05a6381dfcdb6237f217512ae2001b48d3a6c17 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Wed, 28 Sep 2022 13:12:57 +0800 Subject: [PATCH 016/104] fix delete packinglist --- .../ControllersLogic/DeletePackingListLogic.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/Classes/Modules/PackingLists/ControllersLogic/DeletePackingListLogic.php b/app/Classes/Modules/PackingLists/ControllersLogic/DeletePackingListLogic.php index 09f6453f..19ded60f 100644 --- a/app/Classes/Modules/PackingLists/ControllersLogic/DeletePackingListLogic.php +++ b/app/Classes/Modules/PackingLists/ControllersLogic/DeletePackingListLogic.php @@ -8,6 +8,7 @@ use App\Classes\Modules\PackingLists\Services\DeletesPackingList; use App\Classes\Modules\PackingLists\Services\FetchesPackingList; use App\Classes\Modules\PackingLists\Standards\Rules\CanDeletePackingList; use App\Classes\ValueObjects\Constants\PackingListType; +use App\Models\PackingList; use ErrorException; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; @@ -59,11 +60,9 @@ class DeletePackingListLogic extends AbstractControllerLogic $this->canDeletePackingList->passes(); - $warehouseList = $this->fetchesPackingList->execute(['id' => $request->route('id')]); - $packingList = $this->fetchesPackingList->execute(['reference' => $warehouseList->reference, 'type' => PackingListType::SHIPPING_PACKING_LIST]); + $packingList = $this->fetchesPackingList->execute(['id' => $request->route('id')]); - $this->deletesPackingList->execute($warehouseList); - $this->deletesPackingList->execute($packingList); + PackingList::where('reference', $packingList->reference)->delete(); return $this->response([]); From f7a1ba05f8c3db5d1e2e165611771ebc8d28f78e Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Wed, 28 Sep 2022 17:34:27 +0800 Subject: [PATCH 017/104] customer announcement in customer profile --- .../companies/sections/CustomerProfileSectionComponent.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/resources/assets/vue/components/companies/sections/CustomerProfileSectionComponent.vue b/resources/assets/vue/components/companies/sections/CustomerProfileSectionComponent.vue index 749e7ef8..31189028 100644 --- a/resources/assets/vue/components/companies/sections/CustomerProfileSectionComponent.vue +++ b/resources/assets/vue/components/companies/sections/CustomerProfileSectionComponent.vue @@ -6,6 +6,11 @@
+ + +
@@ -113,4 +118,4 @@ } } } - \ No newline at end of file + From b01e2022dcc2513a6c057f0e8dcbb7110f187b10 Mon Sep 17 00:00:00 2001 From: edmondlang Date: Thu, 29 Sep 2022 19:11:59 +0800 Subject: [PATCH 018/104] import debtor --- .../Exports/Services/ExportsNullDebtors.php | 99 +++++++++++++++++++ .../Imports/Services/ImportsDebtor.php | 51 ++++++++++ .../ExportCustomersToExcelController.php | 7 ++ .../Imports/ImportUpdateDebtorController.php | 30 ++++++ app/Models/CompanyModule.php | 9 ++ ...0_203803_add_debtor_to_companies_table.php | 32 ++++++ .../elements/UploadDebtorExcelComponent.vue | 81 +++++++++++++++ resources/views/pages/settings.blade.php | 29 ++++++ routes/api.php | 2 + routes/web.php | 1 + 10 files changed, 341 insertions(+) create mode 100644 app/Classes/Modules/Exports/Services/ExportsNullDebtors.php create mode 100644 app/Classes/Modules/Imports/Services/ImportsDebtor.php create mode 100644 app/Http/Controllers/Imports/ImportUpdateDebtorController.php create mode 100644 database/migrations/2022_02_20_203803_add_debtor_to_companies_table.php create mode 100644 resources/assets/vue/components/containers/elements/UploadDebtorExcelComponent.vue diff --git a/app/Classes/Modules/Exports/Services/ExportsNullDebtors.php b/app/Classes/Modules/Exports/Services/ExportsNullDebtors.php new file mode 100644 index 00000000..80283914 --- /dev/null +++ b/app/Classes/Modules/Exports/Services/ExportsNullDebtors.php @@ -0,0 +1,99 @@ +whereNull('debtor')->orWhere('debtor', ''); + })->whereNotIn('id', [2207, 2248, 2029])->where('business_type', BusinessType::IMPORTER)->where('status', ApprovalStatus::APPROVED)->where(function($query){ + $query->whereHas('transactions', function($query){ + return $query->whereIn('type', [TransactionType::PAYMENT])->whereIn('transactions.status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED, ApprovalStatus::PENDING_VERIFICATION]); + })->orWhereHas('wallets', function($query){ + return $query->whereHas('transactions'); + }); + }); + } + + /** + * @param Company $company + * + * @return array + */ + public function map($company): array + { + return [ + '<>', + '300-0000', + '300-0000', + $company->name.' (PURCHASE)', + $company->reference, + '', + 'PIA', + 'MYR', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '',//EmailAddress + '', + '', + '', + '' + ]; + } +} \ No newline at end of file diff --git a/app/Classes/Modules/Imports/Services/ImportsDebtor.php b/app/Classes/Modules/Imports/Services/ImportsDebtor.php new file mode 100644 index 00000000..5e0bdadc --- /dev/null +++ b/app/Classes/Modules/Imports/Services/ImportsDebtor.php @@ -0,0 +1,51 @@ +whereNull('debtor')->first(); + + if ($company) { + $company->debtor = $debtor; + $company->update(); + } + + } + + } catch (\Exception $exception){ + dd($exception); + } + } + + public function batchSize(): int + { + return 100; + } + + public function rules(): array + { + return [ + + ]; + } +} diff --git a/app/Http/Controllers/Exports/ExportCustomersToExcelController.php b/app/Http/Controllers/Exports/ExportCustomersToExcelController.php index d4e050b5..071824a5 100644 --- a/app/Http/Controllers/Exports/ExportCustomersToExcelController.php +++ b/app/Http/Controllers/Exports/ExportCustomersToExcelController.php @@ -8,6 +8,7 @@ use App\Models\User; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Maatwebsite\Excel\Excel; +use App\Classes\Modules\Exports\Services\ExportsNullDebtors; class ExportCustomersToExcelController { @@ -16,4 +17,10 @@ class ExportCustomersToExcelController $request->headers->set('Authorization', 'Bearer '.$token); return $exportsCustomers->download('customer-latest-order-date.csv', Excel::CSV, ['Content-Type' => 'text/csv']); } + + public function nullDebtor(ExportsNullDebtors $exportsNullDebtors, Request $request){ + $response = $exportsNullDebtors->download('nullDebtor.xls', Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']); + ob_end_clean(); + return $response; + } } diff --git a/app/Http/Controllers/Imports/ImportUpdateDebtorController.php b/app/Http/Controllers/Imports/ImportUpdateDebtorController.php new file mode 100644 index 00000000..312b55f2 --- /dev/null +++ b/app/Http/Controllers/Imports/ImportUpdateDebtorController.php @@ -0,0 +1,30 @@ +input('files'), '', ApprovalStatus::APPROVED, 'imports'); + Excel::import(new ImportsDebtor(), json_decode($object->getFiles()[0])->file_info->original->file); + return []; + } +} \ No newline at end of file diff --git a/app/Models/CompanyModule.php b/app/Models/CompanyModule.php index 6a6d53ed..4e9c0526 100644 --- a/app/Models/CompanyModule.php +++ b/app/Models/CompanyModule.php @@ -186,6 +186,15 @@ class CompanyModule extends AbstractModel implements Addressable, Documentable, return $this->morphMany(Remark::class, 'owner'); } + /** + * @return hasManyDeep + */ + public function transactions(): hasManyDeep + { + return $this->hasManyDeep(Transaction::class, [Order::class], ['company_module_id', 'owner_id'], ['id', 'id']); + } + + } diff --git a/database/migrations/2022_02_20_203803_add_debtor_to_companies_table.php b/database/migrations/2022_02_20_203803_add_debtor_to_companies_table.php new file mode 100644 index 00000000..2798b9e7 --- /dev/null +++ b/database/migrations/2022_02_20_203803_add_debtor_to_companies_table.php @@ -0,0 +1,32 @@ +string('debtor')->nullable()->after('reference'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('companies', function (Blueprint $table) { + + }); + } +} diff --git a/resources/assets/vue/components/containers/elements/UploadDebtorExcelComponent.vue b/resources/assets/vue/components/containers/elements/UploadDebtorExcelComponent.vue new file mode 100644 index 00000000..a956a07c --- /dev/null +++ b/resources/assets/vue/components/containers/elements/UploadDebtorExcelComponent.vue @@ -0,0 +1,81 @@ + + + \ No newline at end of file diff --git a/resources/views/pages/settings.blade.php b/resources/views/pages/settings.blade.php index e09653b0..f6ef307a 100644 --- a/resources/views/pages/settings.blade.php +++ b/resources/views/pages/settings.blade.php @@ -167,6 +167,26 @@
+
+
+
+
+
+
+
+
+ +
+
+
Debtor
+
+
+
+
+
+
+
+
@@ -407,6 +427,15 @@
+
+
+
+
+ +
+
+
+
diff --git a/routes/api.php b/routes/api.php index 04094f78..9073989a 100644 --- a/routes/api.php +++ b/routes/api.php @@ -29,6 +29,8 @@ Route::group(['middleware' => 'api', 'prefix' => 'v1', 'as' => 'api.'], function Route::get('/storage/{fileName}/fetch', 'Documents\RenderDocumentController@fileStorageServe')->where(['fileName' => '.*'])->name('storage.document.file'); Route::post('online_payment/callback', 'Billplz\CallbackBillplzController@callback')->name('online_payment.callback'); + + Route::post('/import/update-debtor/f614e339d7058904a831aad742e24d55', 'Imports\ImportUpdateDebtorController@import')->name('debtor.import'); require __DIR__ . '/company.php'; diff --git a/routes/web.php b/routes/web.php index f36e304b..ed2204e3 100644 --- a/routes/web.php +++ b/routes/web.php @@ -422,4 +422,5 @@ Route::get('billplz/bills/{bill_no}', function($bill_no){ return redirect(env('BILLPLZ_BASE_URL').'/bills/'.$bill_no); })->name('billplz.bill'); +Route::get('/export/null-debtor/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@nullDebtor')->name('newDebtor.export'); \ No newline at end of file From 97a568322cbf7bad5cf15f48d8fd2273f4b7fb3e Mon Sep 17 00:00:00 2001 From: edmondlang Date: Thu, 29 Sep 2022 20:53:00 +0800 Subject: [PATCH 019/104] edit billing address in payment and billing --- app/Http/Resources/CompanyModuleResource.php | 3 ++- .../elements/AdminPaymentsBillingComponent.vue | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Http/Resources/CompanyModuleResource.php b/app/Http/Resources/CompanyModuleResource.php index 22a0557d..0fdb2c46 100644 --- a/app/Http/Resources/CompanyModuleResource.php +++ b/app/Http/Resources/CompanyModuleResource.php @@ -4,6 +4,7 @@ namespace App\Http\Resources; use App\Classes\Modules\Companies\Services\FetchesCompanyServices; use App\Classes\ValueObjects\Constants\AddressType; +use App\Classes\ValueObjects\Constants\ApprovalStatus; use App\Classes\ValueObjects\Constants\BankAccountType; use App\Classes\ValueObjects\Constants\BusinessType; use App\Classes\ValueObjects\Constants\DocumentType; @@ -42,7 +43,7 @@ class CompanyModuleResource extends JsonResource 'name' => $this->name, 'reference' => $this->reference, 'address' => new AddressResource($defaultAddress), - 'billingAddress' => new AddressResource($this->addresses()->where('type', AddressType::BILLING)->first()), + 'billingAddress' => new AddressResource($this->addresses()->where('type', AddressType::BILLING)->where('status', ApprovalStatus::APPROVED)->first()), 'company' => new CompanyResource($this->whenLoaded('company')), 'remarks' => RemarkResource::collection($this->remarks), 'marking' => $marking, diff --git a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue index f2785e18..56732fb3 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue @@ -25,7 +25,10 @@
-

Address

+

Address

+ + +
{{ item.order.address.post_code_area}}
{{ item.order.address.district.name +' '+item.order.address.postcode+' '+item.order.address.state.name }}
From f28d0382b85a4a097be7a4f53e04dbdd82ece6ad Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Fri, 30 Sep 2022 15:35:57 +0800 Subject: [PATCH 020/104] show order reference on payment verification component --- app/Http/Resources/TransactionResource.php | 3 +++ .../elements/PaymentVerificationComponent.vue | 13 ++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/Http/Resources/TransactionResource.php b/app/Http/Resources/TransactionResource.php index 563eedf0..11520f17 100644 --- a/app/Http/Resources/TransactionResource.php +++ b/app/Http/Resources/TransactionResource.php @@ -5,6 +5,7 @@ namespace App\Http\Resources; use App\Classes\ValueObjects\Constants\ApprovalStatus; use App\Classes\ValueObjects\Constants\DocumentType; use App\Classes\ValueObjects\Constants\TransactionType; +use App\Models\Order; use Carbon\Carbon; use Illuminate\Http\Resources\Json\JsonResource; @@ -19,8 +20,10 @@ class TransactionResource extends JsonResource public function toArray($request) { + return [ 'id' => $this->id, + 'owner' => ($this->owner instanceof Order) ? new OrderResource($this->owner) : new TransactionResource($this->owner), // 'booking' => new BookingResource($this->booking), 'documents' => DocumentResource::collection($this->documents), 'type' => (int) $this->type, diff --git a/resources/assets/vue/components/paymentsBilling/elements/PaymentVerificationComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/PaymentVerificationComponent.vue index 4c499bcd..f9a1df97 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/PaymentVerificationComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/PaymentVerificationComponent.vue @@ -13,17 +13,16 @@ {{ item.updated_at }}
- - +
Amount
From 913f6f84e220169a72a5b9c511057156735c8374 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Fri, 30 Sep 2022 15:40:24 +0800 Subject: [PATCH 021/104] show order reference on payment verification component --- app/Http/Resources/TransactionResource.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/Http/Resources/TransactionResource.php b/app/Http/Resources/TransactionResource.php index 11520f17..38006503 100644 --- a/app/Http/Resources/TransactionResource.php +++ b/app/Http/Resources/TransactionResource.php @@ -23,8 +23,6 @@ class TransactionResource extends JsonResource return [ 'id' => $this->id, - 'owner' => ($this->owner instanceof Order) ? new OrderResource($this->owner) : new TransactionResource($this->owner), - // 'booking' => new BookingResource($this->booking), 'documents' => DocumentResource::collection($this->documents), 'type' => (int) $this->type, 'bill_no' => $this->bill_no, From fb849aa4cc0d6797f9dd8f18b1116fbb37325a77 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Fri, 30 Sep 2022 15:44:31 +0800 Subject: [PATCH 022/104] show order reference on payment verification component --- app/Http/Resources/TransactionResource.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Http/Resources/TransactionResource.php b/app/Http/Resources/TransactionResource.php index 38006503..72076185 100644 --- a/app/Http/Resources/TransactionResource.php +++ b/app/Http/Resources/TransactionResource.php @@ -6,6 +6,7 @@ use App\Classes\ValueObjects\Constants\ApprovalStatus; use App\Classes\ValueObjects\Constants\DocumentType; use App\Classes\ValueObjects\Constants\TransactionType; use App\Models\Order; +use App\Models\Transaction; use Carbon\Carbon; use Illuminate\Http\Resources\Json\JsonResource; @@ -23,6 +24,7 @@ class TransactionResource extends JsonResource return [ 'id' => $this->id, + 'owner' => ($this->owner instanceof Transaction) ? new TransactionResource($this->owner) : '', 'documents' => DocumentResource::collection($this->documents), 'type' => (int) $this->type, 'bill_no' => $this->bill_no, From 1debc8e2d5e0c0de67def838d4fe5bbfdb0cb85d Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Fri, 30 Sep 2022 15:46:21 +0800 Subject: [PATCH 023/104] show order reference on payment verification component --- app/Http/Resources/TransactionResource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Resources/TransactionResource.php b/app/Http/Resources/TransactionResource.php index 72076185..fcb992f9 100644 --- a/app/Http/Resources/TransactionResource.php +++ b/app/Http/Resources/TransactionResource.php @@ -40,7 +40,7 @@ class TransactionResource extends JsonResource 'currency_rate' => (double) $this->currency_rate, 'status' => (int) $this->status, 'details' => TransactionDetailResource::collection($this->transactionDetails), - 'transactions' => TransactionResource::collection($this->transactions), + 'transactions' => TransactionResource::collection($this->whenLoaded('transactions')), 'payment_attempts' => TransactionResource::collection( $this->transactions() ->payments()->where('status', ApprovalStatus::PENDING_SUBMISSION) From 2ea62bcfb9b1bdfe5753752e3ad9445b541b9aee Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Fri, 30 Sep 2022 15:48:46 +0800 Subject: [PATCH 024/104] show order reference on payment verification component --- app/Http/Resources/TransactionResource.php | 4 ++-- .../paymentsBilling/elements/PaymentVerificationComponent.vue | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Resources/TransactionResource.php b/app/Http/Resources/TransactionResource.php index fcb992f9..0449de0f 100644 --- a/app/Http/Resources/TransactionResource.php +++ b/app/Http/Resources/TransactionResource.php @@ -24,7 +24,7 @@ class TransactionResource extends JsonResource return [ 'id' => $this->id, - 'owner' => ($this->owner instanceof Transaction) ? new TransactionResource($this->owner) : '', + 'order' => ($this->owner instanceof Transaction) ? new OrderResource($this->owner->owner) : new OrderResource($this->owner), 'documents' => DocumentResource::collection($this->documents), 'type' => (int) $this->type, 'bill_no' => $this->bill_no, @@ -40,7 +40,7 @@ class TransactionResource extends JsonResource 'currency_rate' => (double) $this->currency_rate, 'status' => (int) $this->status, 'details' => TransactionDetailResource::collection($this->transactionDetails), - 'transactions' => TransactionResource::collection($this->whenLoaded('transactions')), + 'transactions' => TransactionResource::collection($this->transactions), 'payment_attempts' => TransactionResource::collection( $this->transactions() ->payments()->where('status', ApprovalStatus::PENDING_SUBMISSION) diff --git a/resources/assets/vue/components/paymentsBilling/elements/PaymentVerificationComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/PaymentVerificationComponent.vue index f9a1df97..baa09799 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/PaymentVerificationComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/PaymentVerificationComponent.vue @@ -15,7 +15,7 @@
Marking
From 6268cdd21f9c017cff121555948a2a4d25534039 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Fri, 30 Sep 2022 15:50:30 +0800 Subject: [PATCH 025/104] show order reference on payment verification component --- app/Http/Resources/OrderResource.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Http/Resources/OrderResource.php b/app/Http/Resources/OrderResource.php index cbdaeccb..50bf14d7 100644 --- a/app/Http/Resources/OrderResource.php +++ b/app/Http/Resources/OrderResource.php @@ -46,7 +46,9 @@ class OrderResource extends JsonResource 'received_packages' => PackingListResource::collection($this->packingLists()->where('type', PackingListType::WAREHOUSE_RECEIVE_LIST)->whereHas('packages')->get()), ]; }), - 'invoices' => TransactionResource::collection($this->transactions()->whereNotIn('transactions.status', [0, 1])->get()), + 'invoices' => $this->whenLoaded('packingLists', function() { + return TransactionResource::collection($this->transactions()->whereNotIn('transactions.status', [0, 1])->get()); + }), 'remarks' => RemarkResource::collection($this->remarks), 'created_at' => $this->created_at->format('d-m-Y') ]; From 17edf59b5700c17a30523eb024ef1411b3b9eda5 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Fri, 30 Sep 2022 15:52:21 +0800 Subject: [PATCH 026/104] show order reference on payment verification component --- app/Http/Resources/TransactionResource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Resources/TransactionResource.php b/app/Http/Resources/TransactionResource.php index 0449de0f..863557f8 100644 --- a/app/Http/Resources/TransactionResource.php +++ b/app/Http/Resources/TransactionResource.php @@ -20,7 +20,7 @@ class TransactionResource extends JsonResource */ public function toArray($request) { - + dd( ($this->owner instanceof Transaction) ? $this->owner->owner : $this->owner); return [ 'id' => $this->id, From 71ae2437a4c89328cd5d6f436724135cf8210906 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Fri, 30 Sep 2022 15:54:06 +0800 Subject: [PATCH 027/104] show order reference on payment verification component --- app/Http/Resources/TransactionResource.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/Http/Resources/TransactionResource.php b/app/Http/Resources/TransactionResource.php index 863557f8..b620005b 100644 --- a/app/Http/Resources/TransactionResource.php +++ b/app/Http/Resources/TransactionResource.php @@ -20,11 +20,9 @@ class TransactionResource extends JsonResource */ public function toArray($request) { - dd( ($this->owner instanceof Transaction) ? $this->owner->owner : $this->owner); - return [ 'id' => $this->id, - 'order' => ($this->owner instanceof Transaction) ? new OrderResource($this->owner->owner) : new OrderResource($this->owner), + 'order' => ($this->owner instanceof Transaction) ? new OrderResource($this->owner->owner->owner) : new OrderResource($this->owner->owner), 'documents' => DocumentResource::collection($this->documents), 'type' => (int) $this->type, 'bill_no' => $this->bill_no, From 650d232ab078e1eb90a575f112d6f6ed23e9b525 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Fri, 30 Sep 2022 15:57:26 +0800 Subject: [PATCH 028/104] show order reference on payment verification component --- .../elements/PaymentVerificationComponent.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/assets/vue/components/paymentsBilling/elements/PaymentVerificationComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/PaymentVerificationComponent.vue index baa09799..ea86babf 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/PaymentVerificationComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/PaymentVerificationComponent.vue @@ -15,12 +15,12 @@
From e59934fa7b79b2625ec5ea506ea2ba785186c421 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Fri, 30 Sep 2022 15:59:25 +0800 Subject: [PATCH 029/104] show order reference on payment verification component --- .../paymentsBilling/elements/PaymentVerificationComponent.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/assets/vue/components/paymentsBilling/elements/PaymentVerificationComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/PaymentVerificationComponent.vue index ea86babf..045d726a 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/PaymentVerificationComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/PaymentVerificationComponent.vue @@ -15,7 +15,7 @@
Customer
From ff159730e03f3656af787799c5c13f7d00e720b8 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Fri, 30 Sep 2022 16:07:06 +0800 Subject: [PATCH 030/104] hide payment button for floating amount --- app/Http/Resources/TransactionResource.php | 1 + .../elements/CustomerPaymentsBillingComponent.vue | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Http/Resources/TransactionResource.php b/app/Http/Resources/TransactionResource.php index b620005b..668b0947 100644 --- a/app/Http/Resources/TransactionResource.php +++ b/app/Http/Resources/TransactionResource.php @@ -30,6 +30,7 @@ class TransactionResource extends JsonResource 'payment_method' => (int) $this->payment_method, 'payment_reference' => $this->payment_reference, 'outstanding' => (double) $this->amount - ($this->transactions()->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->sum('amount')), + 'floating' => (double) $this->amount - ($this->transactions()->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::PENDING_SUBMISSION, ApprovalStatus::PENDING_VERIFICATION])->sum('amount')), 'service_charge' => (double) $this->service_charge, 'tax' => (double) $this->tax, 'original_amount' => (double) $this->original_amount, diff --git a/resources/assets/vue/components/paymentsBilling/elements/CustomerPaymentsBillingComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/CustomerPaymentsBillingComponent.vue index 25e29424..55cca436 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/CustomerPaymentsBillingComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/CustomerPaymentsBillingComponent.vue @@ -3,7 +3,7 @@
-
+

Invoice Date

{{ item.updated_at }}
@@ -56,7 +56,7 @@
-
+
-
+
Make Payment
From d1cf06d7005dc653c0e6aaec6e6a49e60c16f55a Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Fri, 30 Sep 2022 16:09:05 +0800 Subject: [PATCH 031/104] hide payment button for floating amount --- app/Http/Resources/TransactionResource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Resources/TransactionResource.php b/app/Http/Resources/TransactionResource.php index 668b0947..631f2d8b 100644 --- a/app/Http/Resources/TransactionResource.php +++ b/app/Http/Resources/TransactionResource.php @@ -29,7 +29,7 @@ class TransactionResource extends JsonResource 'amount' => (double) $this->amount, 'payment_method' => (int) $this->payment_method, 'payment_reference' => $this->payment_reference, - 'outstanding' => (double) $this->amount - ($this->transactions()->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->sum('amount')), + 'outstanding' => (double) ($this->transactions()->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->sum('amount')), 'floating' => (double) $this->amount - ($this->transactions()->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::PENDING_SUBMISSION, ApprovalStatus::PENDING_VERIFICATION])->sum('amount')), 'service_charge' => (double) $this->service_charge, 'tax' => (double) $this->tax, From fbaa1238cba82a691f6f937786c44c83dd737212 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Fri, 30 Sep 2022 16:10:17 +0800 Subject: [PATCH 032/104] hide payment button for floating amount --- app/Http/Resources/TransactionResource.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Resources/TransactionResource.php b/app/Http/Resources/TransactionResource.php index 631f2d8b..f68fe54a 100644 --- a/app/Http/Resources/TransactionResource.php +++ b/app/Http/Resources/TransactionResource.php @@ -29,8 +29,8 @@ class TransactionResource extends JsonResource 'amount' => (double) $this->amount, 'payment_method' => (int) $this->payment_method, 'payment_reference' => $this->payment_reference, - 'outstanding' => (double) ($this->transactions()->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->sum('amount')), - 'floating' => (double) $this->amount - ($this->transactions()->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::PENDING_SUBMISSION, ApprovalStatus::PENDING_VERIFICATION])->sum('amount')), + 'outstanding' => (double) $this->amount - ($this->transactions()->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->sum('amount')), + 'floating' => (double) $this->transactions()->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::PENDING_SUBMISSION, ApprovalStatus::PENDING_VERIFICATION])->sum('amount'), 'service_charge' => (double) $this->service_charge, 'tax' => (double) $this->tax, 'original_amount' => (double) $this->original_amount, From c089b5f0726e9963d519ba84595eb47ae18dea68 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Fri, 30 Sep 2022 16:12:15 +0800 Subject: [PATCH 033/104] hide payment button for floating amount --- .../elements/CustomerPaymentsBillingComponent.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/assets/vue/components/paymentsBilling/elements/CustomerPaymentsBillingComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/CustomerPaymentsBillingComponent.vue index 55cca436..0012a2ff 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/CustomerPaymentsBillingComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/CustomerPaymentsBillingComponent.vue @@ -124,7 +124,7 @@
Paid Total:
- +
MYR {{(Math.round((item.amount - item.outstanding + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}
Paid Total
@@ -133,7 +133,7 @@
Floating Amount:
- +
MYR {{(Math.round((item.floating + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}
Floating Amount
From 2bd30492c59abc638244f9eadddd77f1d1dba7cd Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Fri, 30 Sep 2022 16:13:15 +0800 Subject: [PATCH 034/104] hide payment button for floating amount --- .../elements/CustomerPaymentsBillingComponent.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/resources/assets/vue/components/paymentsBilling/elements/CustomerPaymentsBillingComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/CustomerPaymentsBillingComponent.vue index 0012a2ff..0b37c44a 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/CustomerPaymentsBillingComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/CustomerPaymentsBillingComponent.vue @@ -125,7 +125,6 @@
MYR {{(Math.round((item.amount - item.outstanding + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}
-
Paid Total
@@ -134,7 +133,6 @@
MYR {{(Math.round((item.floating + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}
-
Floating Amount
From 975e3d49e7e85ef10c944e3d7bd7361b58c4ec39 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Fri, 30 Sep 2022 16:20:54 +0800 Subject: [PATCH 035/104] hide payment button for floating amount --- .../forms/DeletePaymentAttemptFormComponent.vue | 4 ++-- .../components/paymentsBilling/forms/PaymentFormComponent.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/assets/vue/components/paymentsBilling/forms/DeletePaymentAttemptFormComponent.vue b/resources/assets/vue/components/paymentsBilling/forms/DeletePaymentAttemptFormComponent.vue index ba371bd4..07171b50 100644 --- a/resources/assets/vue/components/paymentsBilling/forms/DeletePaymentAttemptFormComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/forms/DeletePaymentAttemptFormComponent.vue @@ -15,7 +15,7 @@
Cancel
-
Delete
+
Delete
@@ -30,4 +30,4 @@ mixins: [componentHandler, ModalFormHandler] } - \ No newline at end of file + diff --git a/resources/assets/vue/components/paymentsBilling/forms/PaymentFormComponent.vue b/resources/assets/vue/components/paymentsBilling/forms/PaymentFormComponent.vue index 8f02c823..0446da11 100644 --- a/resources/assets/vue/components/paymentsBilling/forms/PaymentFormComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/forms/PaymentFormComponent.vue @@ -99,7 +99,7 @@ methods:{ submitForm(){ this.parameters.payment_method = this.paymentMethod.id === 'payment_gateway' ? 5 : ''; - this.submit(this.route('api.transaction.payment.create'), 'post', this.section, true, true); + this.submit(this.route('api.transaction.payment.create'), 'post', 'orderProfileSection', true, true); }, updatePaymentType(payment){ this.paymentMethod = { @@ -120,4 +120,4 @@ mixins: [formHandler] } - \ No newline at end of file + From 6ecfa8e031a4177ba60b90839e8b0786f560fc72 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Mon, 10 Oct 2022 17:43:32 +0800 Subject: [PATCH 036/104] fix invoice date --- app/Http/Resources/PackingListResource.php | 6 +-- app/Http/Resources/TransactionResource.php | 2 +- .../AdminPaymentsBillingComponent.vue | 54 +++++++++---------- .../DeleteShippingInvoiceFormComponent.vue | 4 +- 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/app/Http/Resources/PackingListResource.php b/app/Http/Resources/PackingListResource.php index 7dcd6a68..462e4cdd 100644 --- a/app/Http/Resources/PackingListResource.php +++ b/app/Http/Resources/PackingListResource.php @@ -35,9 +35,9 @@ class PackingListResource extends JsonResource $this->mergeWhen($this->owner instanceof Order, [ 'order' => New OrderResource($this->owner) ]), - 'shippng_transaction' => new TransactionResource($this->transactions()->where('type', TransactionType::SHIPPING_INVOICE)->whereNotIn('status', [ApprovalStatus::SUSPENDED, ApprovalStatus::EXPIRED])->first()), - '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()), + 'shipping_transaction' => new TransactionResource($this->transactions()->where('type', TransactionType::SHIPPING_INVOICE)->whereNotIn('status', [ApprovalStatus::SUSPENDED, ApprovalStatus::EXPIRED])->first()), + '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/app/Http/Resources/TransactionResource.php b/app/Http/Resources/TransactionResource.php index f68fe54a..26d3ab86 100644 --- a/app/Http/Resources/TransactionResource.php +++ b/app/Http/Resources/TransactionResource.php @@ -53,7 +53,7 @@ class TransactionResource extends JsonResource ), 'remarks' => RemarkResource::collection($this->remarks), 'expires_on' => Carbon::parse($this->expires_on)->format('d-m-Y h:s:i'), - 'updated_at' => Carbon::parse($this->update_at)->format('d-m-Y') + 'updated_at' => Carbon::parse($this->updated_at)->format('d-m-Y') ]; } } diff --git a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue index f2785e18..0d430ccd 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue @@ -20,8 +20,8 @@

Invoice Date

-
n/a
-
{{ item.shippng_transaction.updated_at }}
+
n/a
+
{{ item.shipping_transaction.updated_at }}
@@ -37,13 +37,13 @@

Amount

-
n/a
-
MYR {{ item.shippng_transaction.amount.toFixed(2) }}
+
n/a
+
MYR {{ item.shipping_transaction.amount.toFixed(2) }}
-
-
-
+
+
+
From 66bbf9934c1889db3387116c130f71b7a512c971 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Thu, 13 Oct 2022 01:44:48 +0800 Subject: [PATCH 051/104] fix payment ui & reload issue --- .../paymentsBilling/forms/DeletePaymentAttemptFormComponent.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/assets/vue/components/paymentsBilling/forms/DeletePaymentAttemptFormComponent.vue b/resources/assets/vue/components/paymentsBilling/forms/DeletePaymentAttemptFormComponent.vue index 07171b50..f3248ed8 100644 --- a/resources/assets/vue/components/paymentsBilling/forms/DeletePaymentAttemptFormComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/forms/DeletePaymentAttemptFormComponent.vue @@ -15,7 +15,7 @@
Cancel
-
Delete
+
Delete
From 5ea4044e3fe9ecfb5fbd5470272317801ea803b9 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Thu, 13 Oct 2022 15:54:56 +0800 Subject: [PATCH 052/104] debug callback url for billplz --- .../Billplzs/ControllersLogic/CallbackBillplzLogic.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Classes/Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php b/app/Classes/Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php index 69381d4d..4b6aab57 100644 --- a/app/Classes/Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php +++ b/app/Classes/Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php @@ -88,6 +88,8 @@ class CallbackBillplzLogic $packingList = $invoice->owner; $order = $packingList->owner; + $status = ApprovalStatus::PENDING_VERIFICATION; + if($billPlz->state === 'paid') { $status = ApprovalStatus::APPROVED; } @@ -118,4 +120,4 @@ class CallbackBillplzLogic return $request->method() === 'POST' ? true : view('pages.payments_redirect', ['marking' => $order->reference, 'transaction' => $transaction, 'status' => $status]); } -} \ No newline at end of file +} From d8386601c33d783ee0ddec7754436aa07d5854a1 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Mon, 17 Oct 2022 13:29:52 +0800 Subject: [PATCH 053/104] 1. Import Debtor 2. export payments --- .../Exports/Services/ExportsNullDebtors.php | 18 ++- .../Services/ExportsPaymentTransactions.php | 110 ++++++++++++++++++ .../Imports/Services/ImportsDebtor.php | 7 +- .../ExportCustomersToExcelController.php | 8 ++ routes/web.php | 2 +- 5 files changed, 133 insertions(+), 12 deletions(-) create mode 100644 app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php diff --git a/app/Classes/Modules/Exports/Services/ExportsNullDebtors.php b/app/Classes/Modules/Exports/Services/ExportsNullDebtors.php index 80283914..166b4005 100644 --- a/app/Classes/Modules/Exports/Services/ExportsNullDebtors.php +++ b/app/Classes/Modules/Exports/Services/ExportsNullDebtors.php @@ -55,13 +55,9 @@ class ExportsNullDebtors implements FromQuery, WithHeadings, WithHeadingRow, Wit { return Company::where(function($query){ $query->whereNull('debtor')->orWhere('debtor', ''); - })->whereNotIn('id', [2207, 2248, 2029])->where('business_type', BusinessType::IMPORTER)->where('status', ApprovalStatus::APPROVED)->where(function($query){ - $query->whereHas('transactions', function($query){ - return $query->whereIn('type', [TransactionType::PAYMENT])->whereIn('transactions.status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED, ApprovalStatus::PENDING_VERIFICATION]); - })->orWhereHas('wallets', function($query){ - return $query->whereHas('transactions'); - }); - }); + })->whereHas('companyModules', function($query){ + $query->where('type', BusinessType::IMPORTER); + })->whereHas('parcels')->where('status', ApprovalStatus::APPROVED); } /** @@ -71,12 +67,14 @@ class ExportsNullDebtors implements FromQuery, WithHeadings, WithHeadingRow, Wit */ public function map($company): array { + $marking = $company->companyModules()->where('type', BusinessType::IMPORTER)->first()->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference; + return [ '<>', '300-0000', '300-0000', - $company->name.' (PURCHASE)', - $company->reference, + $company->name.' (Shipping)', + $marking, '', 'PIA', 'MYR', @@ -96,4 +94,4 @@ class ExportsNullDebtors implements FromQuery, WithHeadings, WithHeadingRow, Wit '' ]; } -} \ No newline at end of file +} diff --git a/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php b/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php new file mode 100644 index 00000000..a48025c7 --- /dev/null +++ b/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php @@ -0,0 +1,110 @@ +request = $request; + } + + public function headings(): array + { + return [ + 'DocNo', + 'DocDate', + 'DebtorCode', + 'DebtorName', + 'CurrencyCode', + 'ShipInfo', + 'ItemCode', + 'DetailDescription', + 'FurtherDescription', + 'Qty', + 'UnitPrice', + 'AccNo', + 'DeptNo' + ]; + } + + /** + * @return \Illuminate\Support\Collection|mixed + */ + public function query() + { + $start_date = $this->request->input('startDate', null); + if ($start_date) { + $start_date = Carbon::parse($this->request->input('startDate'))->format('Y-m-d'); + } + + $end_date = $this->request->input('endDate', null); + if ($end_date) { + $end_date = Carbon::parse($this->request->input('endDate'))->format('Y-m-d'); + } + + $query = Transaction::query(); + + $query->where('type', TransactionType::SHIPPING_INVOICE)->whereIn('status', [ApprovalStatus::COMPLETED]); + + if($start_date && $end_date) { + $query->whereBetween('created_at', [ + Carbon::parse($start_date)->format('Y-m-d 0:00:00'), + Carbon::parse($end_date)->format('Y-m-d 23:59:59') + ]); + } + elseif($start_date && !$end_date) { + $query->where('created_at', '>=', Carbon::parse($start_date)->format('Y-m-d 0:00:00')); + } + elseif(!$start_date && $end_date) { + $query->where('created_at', '<=', Carbon::parse($end_date)->format('Y-m-d 23:59:59')); + } + + return $query; + } + + /** + * @param Transaction $transaction + * + * @return array + */ + public function map(Transaction $transaction): array + { + $container = $transaction->owner->containers()->first(); + $order = $transaction->owner->owner; + $company = $order->company; + + return [ + '<>', + $transaction->updated_at->format('m/d/Y H:m'), + $company->debtor, + '', + 'MYR', + $container->reference, + '', + 'PLEASE REFER TO THE ATTACHED APPENDIX REF ' . $order->reference, + '', + 1, + round($transaction->amount, 2), + 'UNKNOWN', + 'CIEF' + ]; + } +} diff --git a/app/Classes/Modules/Imports/Services/ImportsDebtor.php b/app/Classes/Modules/Imports/Services/ImportsDebtor.php index 5e0bdadc..66a292a0 100644 --- a/app/Classes/Modules/Imports/Services/ImportsDebtor.php +++ b/app/Classes/Modules/Imports/Services/ImportsDebtor.php @@ -2,6 +2,7 @@ namespace App\Classes\Modules\Imports\Services; +use App\Classes\ValueObjects\Constants\BusinessType; use App\Models\Company; use Maatwebsite\Excel\Concerns\ToModel; @@ -23,7 +24,11 @@ class ImportsDebtor implements ToModel, WithHeadingRow, WithBatchInserts, WithVa foreach ($matches[0] as $match){ $reference = $match; $debtor = $row['code']; - $company = Company::where('reference', $reference)->whereNull('debtor')->first(); + $company = Company::whereNull('debtor')->whereHas('companyModules', function($query) use ($debtor) { + $query->whereHas('connections', function($query) use ($debtor) { + $query->where('invitee_reference', $debtor); + }); + })->first(); if ($company) { $company->debtor = $debtor; diff --git a/app/Http/Controllers/Exports/ExportCustomersToExcelController.php b/app/Http/Controllers/Exports/ExportCustomersToExcelController.php index 071824a5..bbc96a8c 100644 --- a/app/Http/Controllers/Exports/ExportCustomersToExcelController.php +++ b/app/Http/Controllers/Exports/ExportCustomersToExcelController.php @@ -4,6 +4,7 @@ namespace App\Http\Controllers\Exports; use App\Classes\Modules\Exports\Services\ExportsCustomersOrderLatestDate; +use App\Classes\Modules\Exports\Services\ExportsPaymentTransactions; use App\Models\User; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; @@ -23,4 +24,11 @@ class ExportCustomersToExcelController ob_end_clean(); return $response; } + + public function paymentTransactions(Request $request){ + $exportsTransactions = new ExportsPaymentTransactions($request); + $response = $exportsTransactions->download('payment-transactions.xls', Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']); + ob_end_clean(); + return $response; + } } diff --git a/routes/web.php b/routes/web.php index fe65efcd..42e442ce 100644 --- a/routes/web.php +++ b/routes/web.php @@ -424,4 +424,4 @@ Route::get('billplz/bills/{bill_no}', function($bill_no){ })->name('billplz.bill'); Route::get('/export/null-debtor/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@nullDebtor')->name('newDebtor.export'); - \ No newline at end of file +Route::get('/export/payment-transactions/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@paymentTransactions')->name('paymentTransactions.export'); From 96948c96b5715b6d884a5e5a4f8cfdf49cc3ae2a Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Mon, 17 Oct 2022 13:39:03 +0800 Subject: [PATCH 054/104] edit billing address --- .../AdminPaymentsBillingComponent.vue | 81 +++++++++++-------- 1 file changed, 47 insertions(+), 34 deletions(-) diff --git a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue index cc9f8b63..32872db5 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue @@ -25,10 +25,7 @@
-

Address

- - - +

Address

{{ item.order.address.post_code_area}}
{{ item.order.address.district.name +' '+item.order.address.postcode+' '+item.order.address.state.name }}
@@ -64,41 +61,57 @@
-
- -
-
-
-
-
Add Billing Address
- - - +
+
+
+
-
-
Define Location
- - - +
+
+
+
Add Billing Address
+ + + +
+
+
Define Location
+ + + +
+
Generate Invoice
+
+
+ +
-
Generate Invoice
-
-
- +
+ +
+
+ +
+ + + + + +
-
- +
+
+ Edit billing Address +
+ +
+
+ +
+
+
-
- -
- - - - - -
From 8396e8dab3e5a5691b30e60d849ea19650e9069c Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Mon, 17 Oct 2022 13:43:26 +0800 Subject: [PATCH 055/104] export payments --- .../Exports/Services/ExportsPaymentTransactions.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php b/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php index a48025c7..6f93da28 100644 --- a/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php @@ -80,12 +80,7 @@ class ExportsPaymentTransactions implements FromQuery, WithHeadings, WithHeading return $query; } - /** - * @param Transaction $transaction - * - * @return array - */ - public function map(Transaction $transaction): array + public function map($transaction): array { $container = $transaction->owner->containers()->first(); $order = $transaction->owner->owner; From 086b262fca655ef769418edcfa0ca0689537ab36 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Mon, 17 Oct 2022 13:44:32 +0800 Subject: [PATCH 056/104] fix edit billing address ui --- .../elements/AdminPaymentsBillingComponent.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue index 32872db5..8dbabd64 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue @@ -100,8 +100,8 @@
-
-
+
+
Edit billing Address
From b79bcdbbb398808c885bfbe6acd54a214ed4e4da Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Mon, 17 Oct 2022 13:48:22 +0800 Subject: [PATCH 057/104] export payment debug --- .../Modules/Exports/Services/ExportsPaymentTransactions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php b/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php index 6f93da28..7b2f528a 100644 --- a/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php @@ -84,6 +84,7 @@ class ExportsPaymentTransactions implements FromQuery, WithHeadings, WithHeading { $container = $transaction->owner->containers()->first(); $order = $transaction->owner->owner; + dd($order); $company = $order->company; return [ From 6f86702df0ac2e415fb200494c9719918d63ea01 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Mon, 17 Oct 2022 13:49:06 +0800 Subject: [PATCH 058/104] export payment debug --- .../Modules/Exports/Services/ExportsPaymentTransactions.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php b/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php index 7b2f528a..58a6d7d4 100644 --- a/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php @@ -84,8 +84,7 @@ class ExportsPaymentTransactions implements FromQuery, WithHeadings, WithHeading { $container = $transaction->owner->containers()->first(); $order = $transaction->owner->owner; - dd($order); - $company = $order->company; + $company = $order->company->companyModule->company; return [ '<>', From 910fa1386722795433fd5a342917c4f7748e0395 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Mon, 17 Oct 2022 13:49:48 +0800 Subject: [PATCH 059/104] export payment debug --- .../Modules/Exports/Services/ExportsPaymentTransactions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php b/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php index 58a6d7d4..6d7ec746 100644 --- a/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php @@ -84,7 +84,7 @@ class ExportsPaymentTransactions implements FromQuery, WithHeadings, WithHeading { $container = $transaction->owner->containers()->first(); $order = $transaction->owner->owner; - $company = $order->company->companyModule->company; + $company = $order->companyModule->company; return [ '<>', From 39a9e45fc4107eb3ad49df15f2fd7651f4fd2b1b Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Mon, 17 Oct 2022 13:53:53 +0800 Subject: [PATCH 060/104] export payment UI --- .../DownloadBillingWithDatesComponent.vue | 83 +++++++++++++++++++ .../AdminPaymentsBillingSectionComponent.vue | 7 +- 2 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 resources/assets/vue/components/paymentsBilling/forms/DownloadBillingWithDatesComponent.vue diff --git a/resources/assets/vue/components/paymentsBilling/forms/DownloadBillingWithDatesComponent.vue b/resources/assets/vue/components/paymentsBilling/forms/DownloadBillingWithDatesComponent.vue new file mode 100644 index 00000000..99be4562 --- /dev/null +++ b/resources/assets/vue/components/paymentsBilling/forms/DownloadBillingWithDatesComponent.vue @@ -0,0 +1,83 @@ + + + diff --git a/resources/assets/vue/components/paymentsBilling/sections/AdminPaymentsBillingSectionComponent.vue b/resources/assets/vue/components/paymentsBilling/sections/AdminPaymentsBillingSectionComponent.vue index 840c2009..8c200a60 100644 --- a/resources/assets/vue/components/paymentsBilling/sections/AdminPaymentsBillingSectionComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/sections/AdminPaymentsBillingSectionComponent.vue @@ -129,6 +129,11 @@
+
+
+ +
+