From 72e645c4268e80441ae4c71ff2be9e99f160bee7 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Thu, 31 Mar 2022 13:09:02 +0800 Subject: [PATCH 01/74] add supplier filter to exchange --- .../General/Eloquent/Filters/PendingPurchaseOrder.php | 2 -- .../ControllersLogic/DownloadBookingDocumentLogic.php | 7 ++++++- .../Bookings/DownloadBookingDocumentController.php | 2 +- .../components/address/forms/AddressFormComponent.vue | 2 +- .../forms/AssignAnnouncementToSegmentFormComponent.vue | 2 +- .../banks/forms/BankAccountFormComponent.vue | 2 +- .../components/bookings/elements/BillingComponent.vue | 10 +++++++++- .../companies/forms/AssignSegmentFormComponent.vue | 2 +- .../components/general/forms/SelectableComponent.vue | 7 ++++++- .../general/forms/ValidationWrapperComponent.vue | 4 ++-- .../settings/forms/AddCurrencyFormComponent.vue | 2 +- .../settings/forms/SegmentServiceFormComponent.vue | 4 ++-- .../components/settings/forms/ServiceFormComponent.vue | 2 +- 13 files changed, 32 insertions(+), 16 deletions(-) diff --git a/app/Classes/General/Eloquent/Filters/PendingPurchaseOrder.php b/app/Classes/General/Eloquent/Filters/PendingPurchaseOrder.php index 4097cbe0..d3fa28f9 100644 --- a/app/Classes/General/Eloquent/Filters/PendingPurchaseOrder.php +++ b/app/Classes/General/Eloquent/Filters/PendingPurchaseOrder.php @@ -23,8 +23,6 @@ class PendingPurchaseOrder implements Filter }); })->whereDoesntHave('transactions', function($transaction){ return $transaction->where('type', TransactionType::PURCHASE_ORDER)->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED]); - })->whereHas('transactions', function($transaction){ - return $transaction->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED]); }); } diff --git a/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php index 514c32cd..d8fdb0df 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php @@ -3,6 +3,7 @@ namespace App\Classes\Modules\Bookings\ControllersLogic; +use App\Classes\ValueObjects\Constants\TransactionType; use Illuminate\Support\Facades\File; use ZipArchive; use Carbon\Carbon; @@ -35,7 +36,11 @@ class DownloadBookingDocumentLogic $bookings = Booking::where('status', ApprovalStatus::COMPLETED) ->whereDate('created_at', '>=', Carbon::parse($request->input('startDate'))) - ->whereDate('created_at', '<=', Carbon::parse($request->input('endDate')))->get(); + ->whereDate('created_at', '<=', Carbon::parse($request->input('endDate')))->whereHas('transactions', function ($query) use ($request){ + return $query->where('type', TransactionType::PAYMENT)->whereHas('transactions', function ($query) use ($request){ + return $query->where('type', TransactionType::BILL)->where('issuer', $request->input('supplier')); + }); + })->get(); if (!count($bookings)) throw new MalformedRequestException('No available file to download'); diff --git a/app/Http/Controllers/Bookings/DownloadBookingDocumentController.php b/app/Http/Controllers/Bookings/DownloadBookingDocumentController.php index 95427363..d2a7d85c 100644 --- a/app/Http/Controllers/Bookings/DownloadBookingDocumentController.php +++ b/app/Http/Controllers/Bookings/DownloadBookingDocumentController.php @@ -15,7 +15,7 @@ class DownloadBookingDocumentController * @throws \App\Classes\Exceptions\MalformedRequestException */ public function download(Request $request, DownloadBookingDocumentLogic $logic) { - return $logic->execute($request); + $logic->execute($request); } } \ No newline at end of file diff --git a/resources/assets/vue/components/address/forms/AddressFormComponent.vue b/resources/assets/vue/components/address/forms/AddressFormComponent.vue index 94cd9c9a..2a6de3d1 100644 --- a/resources/assets/vue/components/address/forms/AddressFormComponent.vue +++ b/resources/assets/vue/components/address/forms/AddressFormComponent.vue @@ -23,7 +23,7 @@
- + diff --git a/resources/assets/vue/components/announcements/forms/AssignAnnouncementToSegmentFormComponent.vue b/resources/assets/vue/components/announcements/forms/AssignAnnouncementToSegmentFormComponent.vue index cc79b885..e03fb36c 100644 --- a/resources/assets/vue/components/announcements/forms/AssignAnnouncementToSegmentFormComponent.vue +++ b/resources/assets/vue/components/announcements/forms/AssignAnnouncementToSegmentFormComponent.vue @@ -17,7 +17,7 @@
- + diff --git a/resources/assets/vue/components/banks/forms/BankAccountFormComponent.vue b/resources/assets/vue/components/banks/forms/BankAccountFormComponent.vue index fe611b69..3bf7fa65 100644 --- a/resources/assets/vue/components/banks/forms/BankAccountFormComponent.vue +++ b/resources/assets/vue/components/banks/forms/BankAccountFormComponent.vue @@ -74,7 +74,7 @@
- + diff --git a/resources/assets/vue/components/bookings/elements/BillingComponent.vue b/resources/assets/vue/components/bookings/elements/BillingComponent.vue index 83a2cb78..13e0b7eb 100644 --- a/resources/assets/vue/components/bookings/elements/BillingComponent.vue +++ b/resources/assets/vue/components/bookings/elements/BillingComponent.vue @@ -42,6 +42,12 @@
+
+ + + + +
@@ -76,6 +82,7 @@ export default { startDate: '', endDate: '', type: 'INVOICE', + supplier: null }, documents: ['INVOICE', 'PURCHASE_ORDER', 'DELIVER_ORDER', 'SUPPLIER_DELIVER_ORDER'], selectedDocumentStatus: false @@ -92,12 +99,13 @@ export default { type: { required }, + supplier: {}, } }, methods: { submitSearch(){ if(!this.validate()){ return; } - window.open(route('documents.download')+'?type='+this.parameters.type+'&startDate='+this.parameters.startDate+'&endDate='+this.parameters.endDate, '_blank'); + window.open(route('documents.download')+'?type='+this.parameters.type+'&startDate='+this.parameters.startDate+'&endDate='+this.parameters.endDate+'&supplier='+this.parameters.supplier, '_blank'); }, updateDocumentType(documentType) { this.parameters.type = documentType; diff --git a/resources/assets/vue/components/companies/forms/AssignSegmentFormComponent.vue b/resources/assets/vue/components/companies/forms/AssignSegmentFormComponent.vue index c723631d..667bc76f 100644 --- a/resources/assets/vue/components/companies/forms/AssignSegmentFormComponent.vue +++ b/resources/assets/vue/components/companies/forms/AssignSegmentFormComponent.vue @@ -17,7 +17,7 @@
- + diff --git a/resources/assets/vue/components/general/forms/SelectableComponent.vue b/resources/assets/vue/components/general/forms/SelectableComponent.vue index 95db6af8..acf91b7a 100644 --- a/resources/assets/vue/components/general/forms/SelectableComponent.vue +++ b/resources/assets/vue/components/general/forms/SelectableComponent.vue @@ -23,12 +23,17 @@ valueColumn: { type: String, required: true + }, + options: { + default () { + return {} + } } }, created(){ if(!this.$store.getters.isInQueue(this.section)){ this.$store.dispatch('updateListQueue', {name: this.section}); - this.$store.dispatch('crudRequest', {endpoint: this.endpoint, method: 'get'}).then(response => { + this.$store.dispatch('crudRequest', {endpoint: this.endpoint+'?filters='+JSON.stringify(this.options), method: 'get'}).then(response => { let success = response.ok; response.json().then(response => { if(!success){return;} diff --git a/resources/assets/vue/components/general/forms/ValidationWrapperComponent.vue b/resources/assets/vue/components/general/forms/ValidationWrapperComponent.vue index d30fdbaf..285c19ff 100644 --- a/resources/assets/vue/components/general/forms/ValidationWrapperComponent.vue +++ b/resources/assets/vue/components/general/forms/ValidationWrapperComponent.vue @@ -2,7 +2,7 @@
-
+
@@ -21,7 +21,7 @@ validator: { required: true }, - selecatable: { + selectable: { type: Boolean, default: false } diff --git a/resources/assets/vue/components/settings/forms/AddCurrencyFormComponent.vue b/resources/assets/vue/components/settings/forms/AddCurrencyFormComponent.vue index 58ce0e64..380f96f9 100644 --- a/resources/assets/vue/components/settings/forms/AddCurrencyFormComponent.vue +++ b/resources/assets/vue/components/settings/forms/AddCurrencyFormComponent.vue @@ -17,7 +17,7 @@
- + diff --git a/resources/assets/vue/components/settings/forms/SegmentServiceFormComponent.vue b/resources/assets/vue/components/settings/forms/SegmentServiceFormComponent.vue index 5405ae6e..a3ece6fa 100644 --- a/resources/assets/vue/components/settings/forms/SegmentServiceFormComponent.vue +++ b/resources/assets/vue/components/settings/forms/SegmentServiceFormComponent.vue @@ -43,7 +43,7 @@
- + @@ -115,7 +115,7 @@
- +
diff --git a/resources/assets/vue/components/settings/forms/ServiceFormComponent.vue b/resources/assets/vue/components/settings/forms/ServiceFormComponent.vue index 002488cc..d92a8c84 100644 --- a/resources/assets/vue/components/settings/forms/ServiceFormComponent.vue +++ b/resources/assets/vue/components/settings/forms/ServiceFormComponent.vue @@ -97,7 +97,7 @@
- + From fb33635ad1d17ce8e1cd4bc1bc6ec7ebd3b04a50 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Thu, 31 Mar 2022 13:12:37 +0800 Subject: [PATCH 02/74] add supplier filter to exchange --- .../vue/components/bookings/elements/BillingComponent.vue | 2 +- .../vue/components/general/forms/SelectableComponent.vue | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/resources/assets/vue/components/bookings/elements/BillingComponent.vue b/resources/assets/vue/components/bookings/elements/BillingComponent.vue index 13e0b7eb..7dec68a1 100644 --- a/resources/assets/vue/components/bookings/elements/BillingComponent.vue +++ b/resources/assets/vue/components/bookings/elements/BillingComponent.vue @@ -45,7 +45,7 @@
- +
diff --git a/resources/assets/vue/components/general/forms/SelectableComponent.vue b/resources/assets/vue/components/general/forms/SelectableComponent.vue index acf91b7a..95db6af8 100644 --- a/resources/assets/vue/components/general/forms/SelectableComponent.vue +++ b/resources/assets/vue/components/general/forms/SelectableComponent.vue @@ -23,17 +23,12 @@ valueColumn: { type: String, required: true - }, - options: { - default () { - return {} - } } }, created(){ if(!this.$store.getters.isInQueue(this.section)){ this.$store.dispatch('updateListQueue', {name: this.section}); - this.$store.dispatch('crudRequest', {endpoint: this.endpoint+'?filters='+JSON.stringify(this.options), method: 'get'}).then(response => { + this.$store.dispatch('crudRequest', {endpoint: this.endpoint, method: 'get'}).then(response => { let success = response.ok; response.json().then(response => { if(!success){return;} From 086dd69197e2c0bf99a3223557376efa85ce0f3b Mon Sep 17 00:00:00 2001 From: omair saleh Date: Thu, 31 Mar 2022 13:15:47 +0800 Subject: [PATCH 03/74] add supplier filter to exchange --- .../vue/components/bookings/elements/BillingComponent.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/assets/vue/components/bookings/elements/BillingComponent.vue b/resources/assets/vue/components/bookings/elements/BillingComponent.vue index 7dec68a1..70f511ed 100644 --- a/resources/assets/vue/components/bookings/elements/BillingComponent.vue +++ b/resources/assets/vue/components/bookings/elements/BillingComponent.vue @@ -45,7 +45,7 @@
- +
From 55b5d01ce08dc36bad4bb9fbd57091e5e25ee96d Mon Sep 17 00:00:00 2001 From: omair saleh Date: Fri, 1 Apr 2022 16:07:31 +0800 Subject: [PATCH 04/74] fix transactions export --- app/Classes/Modules/Exports/Services/ExportsTransactions.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsTransactions.php b/app/Classes/Modules/Exports/Services/ExportsTransactions.php index a49d1f85..3a5289fa 100644 --- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php @@ -55,7 +55,8 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping return [ $transaction->bill_no, - $transaction->booking->marking, + $transaction->owner_id, + $transaction->owner_type, $transaction->booking->company->reference, $transactionTypes[$transaction->type], $transaction->currency_id === 1 ? 'MYR' : 'RMB', From aa76be8ef25c2b418547230576d6d6688990b0a8 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Fri, 1 Apr 2022 16:08:11 +0800 Subject: [PATCH 05/74] fix transactions export --- app/Classes/Modules/Exports/Services/ExportsTransactions.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsTransactions.php b/app/Classes/Modules/Exports/Services/ExportsTransactions.php index 3a5289fa..b31a0516 100644 --- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php @@ -57,7 +57,6 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping $transaction->bill_no, $transaction->owner_id, $transaction->owner_type, - $transaction->booking->company->reference, $transactionTypes[$transaction->type], $transaction->currency_id === 1 ? 'MYR' : 'RMB', $transaction->amount, From c1793dfe09c8682c86faefc11feb39293465ba3b Mon Sep 17 00:00:00 2001 From: omair saleh Date: Fri, 1 Apr 2022 16:10:52 +0800 Subject: [PATCH 06/74] fix transactions export --- app/Classes/Modules/Exports/Services/ExportsTransactions.php | 5 +++++ app/Classes/ValueObjects/Constants/TransactionType.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsTransactions.php b/app/Classes/Modules/Exports/Services/ExportsTransactions.php index b31a0516..943578ce 100644 --- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php @@ -4,6 +4,7 @@ namespace App\Classes\Modules\Exports\Services; use App\Classes\ValueObjects\Constants\BusinessType; use App\Classes\ValueObjects\Constants\CompanyType; +use App\Classes\ValueObjects\Constants\TransactionType; use App\Models\Company; use App\Models\Transaction; use Maatwebsite\Excel\Concerns\Exportable; @@ -41,6 +42,10 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping 6 => 'REFUND', 7 => 'PURCHASE_ORDER', 8 => 'SUPPLIER_DELIVER', + 9 => TransactionType::CREDIT_NOTE, + 10 => TransactionType::WITHDRAW, + 11 => TransactionType::DEBIT_NOTE, + 12 => TransactionType::TRANSFER_FEE ]; $transactionStatus = [ diff --git a/app/Classes/ValueObjects/Constants/TransactionType.php b/app/Classes/ValueObjects/Constants/TransactionType.php index 107f2049..4814ac04 100644 --- a/app/Classes/ValueObjects/Constants/TransactionType.php +++ b/app/Classes/ValueObjects/Constants/TransactionType.php @@ -28,5 +28,5 @@ final class TransactionType { public const WITHDRAW = 10; - public const TRANSFER_FEE = 11; + public const TRANSFER_FEE = 12; } From efc05ffc3f0992402b8be94b31d8a6420576e7b1 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Fri, 1 Apr 2022 16:14:11 +0800 Subject: [PATCH 07/74] fix transactions export --- .../Modules/Exports/Services/ExportsTransactions.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsTransactions.php b/app/Classes/Modules/Exports/Services/ExportsTransactions.php index 943578ce..b8ed70b7 100644 --- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php @@ -42,10 +42,10 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping 6 => 'REFUND', 7 => 'PURCHASE_ORDER', 8 => 'SUPPLIER_DELIVER', - 9 => TransactionType::CREDIT_NOTE, - 10 => TransactionType::WITHDRAW, - 11 => TransactionType::DEBIT_NOTE, - 12 => TransactionType::TRANSFER_FEE + 9 => 'CREDIT_NOTE', + 10 => 'WITHDRAW', + 11 => 'DEBIT_NOTE', + 12 => 'TRANSFER_FEE' ]; $transactionStatus = [ From 216f108b9e2c1a8d077d6cfd551b1e322496ff2d Mon Sep 17 00:00:00 2001 From: omair saleh Date: Fri, 1 Apr 2022 16:15:04 +0800 Subject: [PATCH 08/74] fix transactions export --- app/Classes/Modules/Exports/Services/ExportsTransactions.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Classes/Modules/Exports/Services/ExportsTransactions.php b/app/Classes/Modules/Exports/Services/ExportsTransactions.php index b8ed70b7..f9bbecaf 100644 --- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php @@ -63,6 +63,8 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping $transaction->owner_id, $transaction->owner_type, $transactionTypes[$transaction->type], + $transaction->issuer, + $transaction->reciver, $transaction->currency_id === 1 ? 'MYR' : 'RMB', $transaction->amount, $transaction->original_currency_id === 1 ? 'MYR' : 'RMB', From bfd3d879772a06fec0a0d7f0da786efb94b4f18d Mon Sep 17 00:00:00 2001 From: omair saleh Date: Mon, 4 Apr 2022 18:15:17 +0800 Subject: [PATCH 09/74] debug file type --- .../Modules/Documents/DataTransferObjects/FileObject.php | 1 + app/Classes/ValueObjects/Constants/FileType.php | 1 + .../Controllers/Exports/ExportCustomersToExcelController.php | 4 ++-- resources/views/pages/pdfs/deliver_order.blade.php | 2 +- resources/views/pages/pdfs/invoice.blade.php | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/Classes/Modules/Documents/DataTransferObjects/FileObject.php b/app/Classes/Modules/Documents/DataTransferObjects/FileObject.php index 736853fc..3cf0b59e 100644 --- a/app/Classes/Modules/Documents/DataTransferObjects/FileObject.php +++ b/app/Classes/Modules/Documents/DataTransferObjects/FileObject.php @@ -53,6 +53,7 @@ class FileObject implements DataTransferObject */ public function getExtension(): string { + dd($this->getMimeType()); if(array_key_exists($this->getMimeType(), FileType::EXTENSION)){ return FileType::EXTENSION[$this->getMimeType()]; } diff --git a/app/Classes/ValueObjects/Constants/FileType.php b/app/Classes/ValueObjects/Constants/FileType.php index 3ff989ca..22047c9a 100644 --- a/app/Classes/ValueObjects/Constants/FileType.php +++ b/app/Classes/ValueObjects/Constants/FileType.php @@ -22,6 +22,7 @@ class FileType 'image/jpeg' => 'jpeg', 'application/pdf' => 'pdf', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'excel', + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'excel', ]; } \ No newline at end of file diff --git a/app/Http/Controllers/Exports/ExportCustomersToExcelController.php b/app/Http/Controllers/Exports/ExportCustomersToExcelController.php index f1e14fde..39ea3dc5 100644 --- a/app/Http/Controllers/Exports/ExportCustomersToExcelController.php +++ b/app/Http/Controllers/Exports/ExportCustomersToExcelController.php @@ -43,14 +43,14 @@ class ExportCustomersToExcelController public function paymentTransactions(Request $request){ $exportsTransactions = new ExportsPaymentTransactions($request); - $response = $exportsTransactions->download('payment-transactions.xls', Excel::XLSX, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']); + $response = $exportsTransactions->download('payment-transactions.xls', Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']); ob_end_clean(); return $response; } public function walletTransactions(Request $request){ $exportsTransactions = new ExportsWalletTransactions($request); - $response = $exportsTransactions->download('wallet-transactions.xls', Excel::XLS, ['Content-Type' => 'application/vnd.ms-excel']); + $response = $exportsTransactions->download('wallet-transactions.xls', Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']); ob_end_clean(); return $response; } diff --git a/resources/views/pages/pdfs/deliver_order.blade.php b/resources/views/pages/pdfs/deliver_order.blade.php index 20afd278..8ad9004a 100644 --- a/resources/views/pages/pdfs/deliver_order.blade.php +++ b/resources/views/pages/pdfs/deliver_order.blade.php @@ -20,7 +20,7 @@ (1134596-M)
Malaysian Global Innovation & Creativity Center
Level 1 CWS, Block 3730, Persiaran APEC,
- 63000 Cyberjaya, Malaysian.
+ 63000 Cyberjaya, Malaysia.
Tel: 018-2909252 diff --git a/resources/views/pages/pdfs/invoice.blade.php b/resources/views/pages/pdfs/invoice.blade.php index 56d56afd..5d2cb5d1 100644 --- a/resources/views/pages/pdfs/invoice.blade.php +++ b/resources/views/pages/pdfs/invoice.blade.php @@ -19,7 +19,7 @@ (1134596-M)
Malaysian Global Innovation & Creativity Center
Level 1 CWS, Block 3730, Persiaran APEC,
- 63000 Cyberjaya, Malaysian.
+ 63000 Cyberjaya, Malaysia.
Tel: 018-2909252 From 18b2cd3f4b16eca9289766d3952d8e7655890c7a Mon Sep 17 00:00:00 2001 From: omair saleh Date: Mon, 4 Apr 2022 18:16:24 +0800 Subject: [PATCH 10/74] debug file type --- app/Classes/ValueObjects/Constants/FileType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/ValueObjects/Constants/FileType.php b/app/Classes/ValueObjects/Constants/FileType.php index 22047c9a..d5404e7a 100644 --- a/app/Classes/ValueObjects/Constants/FileType.php +++ b/app/Classes/ValueObjects/Constants/FileType.php @@ -22,7 +22,7 @@ class FileType 'image/jpeg' => 'jpeg', 'application/pdf' => 'pdf', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'excel', - 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'excel', + 'application/vnd.ms-excel' => 'excel', ]; } \ No newline at end of file From f25a1033cb4eb3c9ca04002cbd09065807dd58f7 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Mon, 4 Apr 2022 18:17:11 +0800 Subject: [PATCH 11/74] debug file type --- app/Classes/Modules/Documents/DataTransferObjects/FileObject.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Classes/Modules/Documents/DataTransferObjects/FileObject.php b/app/Classes/Modules/Documents/DataTransferObjects/FileObject.php index 3cf0b59e..736853fc 100644 --- a/app/Classes/Modules/Documents/DataTransferObjects/FileObject.php +++ b/app/Classes/Modules/Documents/DataTransferObjects/FileObject.php @@ -53,7 +53,6 @@ class FileObject implements DataTransferObject */ public function getExtension(): string { - dd($this->getMimeType()); if(array_key_exists($this->getMimeType(), FileType::EXTENSION)){ return FileType::EXTENSION[$this->getMimeType()]; } From 1b45965bc5d4ea1574d5c87d66becfb5340336a1 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 5 Apr 2022 12:14:52 +0800 Subject: [PATCH 12/74] fix destination account admin --- resources/views/pages/dashboards/account_admin.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/pages/dashboards/account_admin.blade.php b/resources/views/pages/dashboards/account_admin.blade.php index c6c76a86..d22d3637 100644 --- a/resources/views/pages/dashboards/account_admin.blade.php +++ b/resources/views/pages/dashboards/account_admin.blade.php @@ -2,14 +2,14 @@
- +
- + From 9efbda1d2a7046c428b6da5b92b44aab2b90e811 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 5 Apr 2022 16:05:58 +0800 Subject: [PATCH 13/74] update xpo for nov to feb --- .../ControllersLogic/AutoPurchaseOrderFillLogic.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/Classes/Modules/Bookings/ControllersLogic/AutoPurchaseOrderFillLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/AutoPurchaseOrderFillLogic.php index 9068862b..dca678a1 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/AutoPurchaseOrderFillLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/AutoPurchaseOrderFillLogic.php @@ -65,12 +65,8 @@ class AutoPurchaseOrderFillLogic extends AbstractControllerLogic public function logic(Request $request) : JsonResponse { $bookings = Booking::where(function($query){ - return $query->whereMonth('created_at', 10)->orWhere(function ($query){ - return $query->whereMonth('created_at', 10); - }); - }) - ->whereYear('created_at', 2021) - ->whereDoesntHave('transactions', function($q){ + return $query->whereMonth('created_at', 11)->orWhereMonth('created_at', 12)->orWhereMonth('created_at', 1)->orWhereMonth('created_at', 2); + })->whereDoesntHave('transactions', function($q){ $q->where('type', TransactionType::PURCHASE_ORDER); $q->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::APPROVED]); })->get(); From 800c723416f404e0af3dc2b89a1757e113d82d23 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 5 Apr 2022 16:07:13 +0800 Subject: [PATCH 14/74] update xpo for nov to feb --- .../Bookings/ControllersLogic/AutoPurchaseOrderFillLogic.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Classes/Modules/Bookings/ControllersLogic/AutoPurchaseOrderFillLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/AutoPurchaseOrderFillLogic.php index dca678a1..2670c307 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/AutoPurchaseOrderFillLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/AutoPurchaseOrderFillLogic.php @@ -70,6 +70,7 @@ class AutoPurchaseOrderFillLogic extends AbstractControllerLogic $q->where('type', TransactionType::PURCHASE_ORDER); $q->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::APPROVED]); })->get(); + dd($bookings); foreach ($bookings as $booking) { $po = Transaction::where('type', TransactionType::PURCHASE_ORDER) ->where('status', ApprovalStatus::APPROVED)->where('issuer', $booking->company_id) From be7d5bb95f46c5b4fe18364fd327ae1fe4ceecd8 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 5 Apr 2022 16:15:59 +0800 Subject: [PATCH 15/74] update xpo for nov to feb --- .../Bookings/ControllersLogic/AutoPurchaseOrderFillLogic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Modules/Bookings/ControllersLogic/AutoPurchaseOrderFillLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/AutoPurchaseOrderFillLogic.php index 2670c307..45f8ba78 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/AutoPurchaseOrderFillLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/AutoPurchaseOrderFillLogic.php @@ -65,7 +65,7 @@ class AutoPurchaseOrderFillLogic extends AbstractControllerLogic public function logic(Request $request) : JsonResponse { $bookings = Booking::where(function($query){ - return $query->whereMonth('created_at', 11)->orWhereMonth('created_at', 12)->orWhereMonth('created_at', 1)->orWhereMonth('created_at', 2); + return $query->whereMonth('created_at', 11)->orWhereMonth('created_at', 12); })->whereDoesntHave('transactions', function($q){ $q->where('type', TransactionType::PURCHASE_ORDER); $q->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::APPROVED]); From 51bde6eed7922ec71dc036ce8aec1783a36e07b7 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 5 Apr 2022 16:17:18 +0800 Subject: [PATCH 16/74] update xpo for nov to feb --- .../Bookings/ControllersLogic/AutoPurchaseOrderFillLogic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Modules/Bookings/ControllersLogic/AutoPurchaseOrderFillLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/AutoPurchaseOrderFillLogic.php index 45f8ba78..73751cfb 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/AutoPurchaseOrderFillLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/AutoPurchaseOrderFillLogic.php @@ -70,7 +70,7 @@ class AutoPurchaseOrderFillLogic extends AbstractControllerLogic $q->where('type', TransactionType::PURCHASE_ORDER); $q->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::APPROVED]); })->get(); - dd($bookings); + foreach ($bookings as $booking) { $po = Transaction::where('type', TransactionType::PURCHASE_ORDER) ->where('status', ApprovalStatus::APPROVED)->where('issuer', $booking->company_id) From 9d7f2cd96766044180ad729db07c54c3bb3686ba Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 5 Apr 2022 16:19:30 +0800 Subject: [PATCH 17/74] update xpo for nov to feb --- routes/web.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/routes/web.php b/routes/web.php index 571ce9fe..b6d6c696 100644 --- a/routes/web.php +++ b/routes/web.php @@ -6,6 +6,7 @@ use App\Classes\Modules\Documents\Services\CreatesFiles; use App\Classes\ValueObjects\Constants\ApprovalStatus; use App\Classes\ValueObjects\Constants\DocumentType; use App\Classes\ValueObjects\Constants\TransactionType; +use App\Models\Booking; use App\Models\Company; use App\Models\Transaction; use App\Models\User; @@ -148,6 +149,13 @@ Route::get('/export/payment-transactions/f614e339d7058904a831aad742e24d55', 'Exp Route::get('/export/wallet-transactions/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@walletTransactions'); Route::get('/products', function (\App\Classes\Modules\Exports\Services\ExportsProducts $exportsProducts) { + $bookings = Booking::where(function($query){ + return $query->whereMonth('created_at', 07); + })->whereDoesntHave('transactions', function($q){ + $q->where('type', TransactionType::PURCHASE_ORDER); + $q->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::APPROVED]); + })->get(); + dd($bookings->count()); return $exportsProducts->download('products.csv', Excel::CSV, ['Content-Type' => 'text/csv']); })->name('products.random'); From b67f0f308182dfe2b6601294a0ae40812a8c2f9c Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 5 Apr 2022 16:21:11 +0800 Subject: [PATCH 18/74] update xpo for nov to feb --- routes/web.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/web.php b/routes/web.php index b6d6c696..07c52253 100644 --- a/routes/web.php +++ b/routes/web.php @@ -150,7 +150,7 @@ Route::get('/export/wallet-transactions/f614e339d7058904a831aad742e24d55', 'Expo Route::get('/products', function (\App\Classes\Modules\Exports\Services\ExportsProducts $exportsProducts) { $bookings = Booking::where(function($query){ - return $query->whereMonth('created_at', 07); + return $query->whereMonth('created_at', 7)->whereMonth('created_at', 8)->whereMonth('created_at', 9)->whereMonth('created_at', 10)->whereMonth('created_at', 11)->whereMonth('created_at', 12); })->whereDoesntHave('transactions', function($q){ $q->where('type', TransactionType::PURCHASE_ORDER); $q->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::APPROVED]); From 114ec1350cb88813f28d197e4d0ce50e303b2eb3 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 5 Apr 2022 16:21:45 +0800 Subject: [PATCH 19/74] update xpo for nov to feb --- routes/web.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/web.php b/routes/web.php index 07c52253..f0d13b86 100644 --- a/routes/web.php +++ b/routes/web.php @@ -150,7 +150,7 @@ Route::get('/export/wallet-transactions/f614e339d7058904a831aad742e24d55', 'Expo Route::get('/products', function (\App\Classes\Modules\Exports\Services\ExportsProducts $exportsProducts) { $bookings = Booking::where(function($query){ - return $query->whereMonth('created_at', 7)->whereMonth('created_at', 8)->whereMonth('created_at', 9)->whereMonth('created_at', 10)->whereMonth('created_at', 11)->whereMonth('created_at', 12); + return $query->whereMonth('created_at', 7)->orWhereMonth('created_at', 8)->orWhereMonth('created_at', 9)->orWhereMonth('created_at', 10)->orWhereMonth('created_at', 11)->orWhereMonth('created_at', 12); })->whereDoesntHave('transactions', function($q){ $q->where('type', TransactionType::PURCHASE_ORDER); $q->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::APPROVED]); From 5b832177afb8dfb44642ce13e4a0d109fcb426ff Mon Sep 17 00:00:00 2001 From: omair saleh Date: Wed, 6 Apr 2022 10:40:04 +0800 Subject: [PATCH 20/74] fix debtors import --- app/Classes/Modules/Imports/Services/ImportsDebtor.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Classes/Modules/Imports/Services/ImportsDebtor.php b/app/Classes/Modules/Imports/Services/ImportsDebtor.php index b97aa263..5e0bdadc 100644 --- a/app/Classes/Modules/Imports/Services/ImportsDebtor.php +++ b/app/Classes/Modules/Imports/Services/ImportsDebtor.php @@ -18,7 +18,7 @@ class ImportsDebtor implements ToModel, WithHeadingRow, WithBatchInserts, WithVa public function model($row = []) { try { - preg_match_all('/([0-9]{3,4}[a-zA-Z]{3,4})/', $row['2nd_description'], $matches); + preg_match_all('/([0-9]{3,4}[a-zA-Z]{3,4})/', $row['desc2'], $matches); foreach ($matches[0] as $match){ $reference = $match; @@ -32,7 +32,9 @@ class ImportsDebtor implements ToModel, WithHeadingRow, WithBatchInserts, WithVa } - } catch (\Exception $exception){} + } catch (\Exception $exception){ + dd($exception); + } } public function batchSize(): int From 56dc37a8e5c882ee06dc2a2cd972ef5599cefce8 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Wed, 6 Apr 2022 10:53:43 +0800 Subject: [PATCH 21/74] fix debtors import --- .../Modules/Imports/Services/ImportsDebtor.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/Classes/Modules/Imports/Services/ImportsDebtor.php b/app/Classes/Modules/Imports/Services/ImportsDebtor.php index 5e0bdadc..bcddffca 100644 --- a/app/Classes/Modules/Imports/Services/ImportsDebtor.php +++ b/app/Classes/Modules/Imports/Services/ImportsDebtor.php @@ -24,11 +24,12 @@ class ImportsDebtor implements ToModel, WithHeadingRow, WithBatchInserts, WithVa $reference = $match; $debtor = $row['code']; $company = Company::where('reference', $reference)->whereNull('debtor')->first(); - - if ($company) { - $company->debtor = $debtor; - $company->update(); - } + dump($row['desc2'], $company); +// +// if ($company) { +// $company->debtor = $debtor; +// $company->update(); +// } } From f060eeef222bb6afbcfea0f65d2738e23475f4ae Mon Sep 17 00:00:00 2001 From: omair saleh Date: Wed, 6 Apr 2022 10:54:47 +0800 Subject: [PATCH 22/74] fix debtors import --- app/Classes/Modules/Imports/Services/ImportsDebtor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Modules/Imports/Services/ImportsDebtor.php b/app/Classes/Modules/Imports/Services/ImportsDebtor.php index bcddffca..94b09e95 100644 --- a/app/Classes/Modules/Imports/Services/ImportsDebtor.php +++ b/app/Classes/Modules/Imports/Services/ImportsDebtor.php @@ -23,7 +23,7 @@ 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::where('reference', $reference)->first(); dump($row['desc2'], $company); // // if ($company) { From 899da269ef86ed786282aa87a962806a9c15142c Mon Sep 17 00:00:00 2001 From: omair saleh Date: Wed, 6 Apr 2022 10:55:29 +0800 Subject: [PATCH 23/74] fix debtors import --- .../Modules/Imports/Services/ImportsDebtor.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/Classes/Modules/Imports/Services/ImportsDebtor.php b/app/Classes/Modules/Imports/Services/ImportsDebtor.php index 94b09e95..5e0bdadc 100644 --- a/app/Classes/Modules/Imports/Services/ImportsDebtor.php +++ b/app/Classes/Modules/Imports/Services/ImportsDebtor.php @@ -23,13 +23,12 @@ class ImportsDebtor implements ToModel, WithHeadingRow, WithBatchInserts, WithVa foreach ($matches[0] as $match){ $reference = $match; $debtor = $row['code']; - $company = Company::where('reference', $reference)->first(); - dump($row['desc2'], $company); -// -// if ($company) { -// $company->debtor = $debtor; -// $company->update(); -// } + $company = Company::where('reference', $reference)->whereNull('debtor')->first(); + + if ($company) { + $company->debtor = $debtor; + $company->update(); + } } From ac0b6b9e876ace728405286d1238405b15d97873 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Wed, 6 Apr 2022 11:55:31 +0800 Subject: [PATCH 24/74] fix debtors import --- app/Classes/Modules/Exports/Services/ExportsNullDebtors.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsNullDebtors.php b/app/Classes/Modules/Exports/Services/ExportsNullDebtors.php index 103797ed..223023ef 100644 --- a/app/Classes/Modules/Exports/Services/ExportsNullDebtors.php +++ b/app/Classes/Modules/Exports/Services/ExportsNullDebtors.php @@ -62,7 +62,7 @@ class ExportsNullDebtors implements FromQuery, WithHeadings, WithHeadingRow, Wit { return Company::where(function($query){ $query->whereNull('debtor')->orWhere('debtor', ''); - })->where('business_type', BusinessType::IMPORTER)->where('status', ApprovalStatus::APPROVED)->whereHas('transactions', function($query){ + })->whereNotIn('id', [2207, 2248, 2029])->where('business_type', BusinessType::IMPORTER)->where('status', ApprovalStatus::APPROVED)->whereHas('transactions', function($query){ return $query->whereIn('type', [TransactionType::PAYMENT, TransactionType::TOP_UP])->whereIn('transactions.status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED, ApprovalStatus::PENDING_VERIFICATION]); }); } From df6a96addd131caaf61587554d84adfb5081aac3 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Thu, 7 Apr 2022 22:59:14 +0800 Subject: [PATCH 25/74] update debtors export --- .../Exports/Services/ExportsNullDebtors.php | 68 ++++++++----------- 1 file changed, 28 insertions(+), 40 deletions(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsNullDebtors.php b/app/Classes/Modules/Exports/Services/ExportsNullDebtors.php index 223023ef..be216473 100644 --- a/app/Classes/Modules/Exports/Services/ExportsNullDebtors.php +++ b/app/Classes/Modules/Exports/Services/ExportsNullDebtors.php @@ -24,34 +24,28 @@ class ExportsNullDebtors implements FromQuery, WithHeadings, WithHeadingRow, Wit { return [ 'Code', + 'DebtorControlAcc', + 'ControlAccount', + 'AccNo', 'CompanyName', 'Desc2', - 'AreaCode', - 'SalesAgent', 'DebtorType', 'DisplayTerm', - 'AgingOn', - 'StatementType', 'CurrencyCode', 'RegisterNo', 'Address1', 'Address2', 'Address3', - 'Address4', 'PostCode', 'DeliverAddr1', 'DeliverAddr2', 'DeliverAddr3', - 'DeliverAddr4', 'DeliverPostCode', + 'EmailAddress', 'Attention', 'Phone1', 'Phone2', - 'Fax1', - 'Fax2', - 'ExemptNo', - 'ExpiryDate', - 'PriceCategory', + 'Fax1' ]; } @@ -75,35 +69,29 @@ class ExportsNullDebtors implements FromQuery, WithHeadings, WithHeadingRow, Wit public function map($company): array { return [ - '<>', //Code - $company->name.' (PURCHASE)', //CompanyName - $company->reference, //Desc2 - '', //AreaCode - '', //SalesAgent - '', //DebtorType - '', //DisplayTerm - '', //AgingOn - '', //StatementType - 'MYR', //CurrencyCode - '', //RegisterNo - '', //Address1 - '', //Address2 - '', //Address3 - '', //Address4 - '', //PostCode - '', //DeliverAddr1 - '', //DeliverAddr2 - '', //DeliverAddr3 - '', //DeliverAddr4 - '', //DeliverPostCode - '', //Attention - '', //Phone1 - '', //Phone2 - '', //Fax1 - '', //Fax2 - '', //ExemptNo - '', //ExpiryDate - '', //PriceCategory + '<>', + '300-0000', + '300-0000', + '300-0000', + $company->name.' (PURCHASE)', + $company->reference, + '', + 'PIA', + 'MYR', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '',//EmailAddress + '', + '', + '', + '' ]; } } \ No newline at end of file From 3b15aef71a0384bb086840352c2eb9af32cf0757 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Mon, 11 Apr 2022 11:39:24 +0800 Subject: [PATCH 26/74] update deptno for transactions export --- .../Exports/Services/ExportsPaymentTransactions.php | 6 ++++-- .../Exports/Services/ExportsWalletTransactions.php | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php b/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php index 0ca1d730..57dba200 100644 --- a/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php @@ -39,7 +39,8 @@ class ExportsPaymentTransactions implements FromQuery, WithHeadings, WithHeading 'DetailDescription', 'Qty', 'UnitPrice', - 'AccNo' + 'AccNo', + 'DeptNo' ]; } @@ -100,7 +101,8 @@ class ExportsPaymentTransactions implements FromQuery, WithHeadings, WithHeading 'PLEASE REFER TO THE ATTACHED APPENDIX REF ' . $booking->marking, 1, $transaction->amount, - '500-0000' + '500-0000', + 'CIEF' ]; } } \ No newline at end of file diff --git a/app/Classes/Modules/Exports/Services/ExportsWalletTransactions.php b/app/Classes/Modules/Exports/Services/ExportsWalletTransactions.php index af4d2d07..29c1728c 100644 --- a/app/Classes/Modules/Exports/Services/ExportsWalletTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsWalletTransactions.php @@ -39,7 +39,8 @@ class ExportsWalletTransactions implements FromQuery, WithHeadings, WithHeadingR 'DetailDescription', 'Qty', 'UnitPrice', - 'AccNo' + 'AccNo', + 'DeptNo' ]; } @@ -80,7 +81,7 @@ class ExportsWalletTransactions implements FromQuery, WithHeadings, WithHeadingR } /** - * @param Company $transaction + * @param Transaction $transaction * * @return array */ @@ -99,7 +100,8 @@ class ExportsWalletTransactions implements FromQuery, WithHeadings, WithHeadingR 'CREDIT SALES', 1, $transaction->amount, - '500-0000' + '500-0000', + 'WALLET' ]; } } \ No newline at end of file From ed2f38610139fb551c1301b3cab087e04a29b7fe Mon Sep 17 00:00:00 2001 From: omair saleh Date: Mon, 11 Apr 2022 14:18:35 +0800 Subject: [PATCH 27/74] show top up transactions for null debtors --- .../Modules/Exports/Services/ExportsNullDebtors.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsNullDebtors.php b/app/Classes/Modules/Exports/Services/ExportsNullDebtors.php index be216473..0d676eb1 100644 --- a/app/Classes/Modules/Exports/Services/ExportsNullDebtors.php +++ b/app/Classes/Modules/Exports/Services/ExportsNullDebtors.php @@ -56,8 +56,12 @@ 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)->whereHas('transactions', function($query){ - return $query->whereIn('type', [TransactionType::PAYMENT, TransactionType::TOP_UP])->whereIn('transactions.status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED, ApprovalStatus::PENDING_VERIFICATION]); + })->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, TransactionType::TOP_UP])->whereIn('transactions.status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED, ApprovalStatus::PENDING_VERIFICATION]); + })->orWhereHas('wallets', function($query){ + return $query->whereHas('transactions'); + }); }); } From 55cd573aeeb8a8c68d3b6dc15d12b98b70db9200 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 12 Apr 2022 11:08:33 +0800 Subject: [PATCH 28/74] update transfer fee formula --- .../Processors/CreateSupplierTransactionProcessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Modules/Transactions/Processors/CreateSupplierTransactionProcessor.php b/app/Classes/Modules/Transactions/Processors/CreateSupplierTransactionProcessor.php index 75516fdf..fe0e7a12 100644 --- a/app/Classes/Modules/Transactions/Processors/CreateSupplierTransactionProcessor.php +++ b/app/Classes/Modules/Transactions/Processors/CreateSupplierTransactionProcessor.php @@ -97,7 +97,7 @@ class CreateSupplierTransactionProcessor $this->pushBill($billTransaction); $transferFeeNumber = $this->generatesTransactionBillNumber->execute('TRFR-'); - $transferFee = $this->calculatesTransactionTransferFee->execute($payment->original_amount, $constant); + $transferFee = $this->calculatesTransactionTransferFee->execute($payment->amount, $constant); $object = new TransactionObject($transferFeeNumber, TransactionType::TRANSFER_FEE, 1, $supplier->id, $supplier->banks()->where('default', true)->first()->id, PaymentMethodType::CASH, $payment->original_amount, $payment->original_amount, $payment->original_currency_id, $payment->original_currency_id, From 41c46c1af1c25cc829ddb0a090a3aa974cd928f3 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 12 Apr 2022 11:12:33 +0800 Subject: [PATCH 29/74] update transfer fee formula --- .../Processors/CreateSupplierTransactionProcessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Modules/Transactions/Processors/CreateSupplierTransactionProcessor.php b/app/Classes/Modules/Transactions/Processors/CreateSupplierTransactionProcessor.php index fe0e7a12..f8d6b20a 100644 --- a/app/Classes/Modules/Transactions/Processors/CreateSupplierTransactionProcessor.php +++ b/app/Classes/Modules/Transactions/Processors/CreateSupplierTransactionProcessor.php @@ -97,7 +97,7 @@ class CreateSupplierTransactionProcessor $this->pushBill($billTransaction); $transferFeeNumber = $this->generatesTransactionBillNumber->execute('TRFR-'); - $transferFee = $this->calculatesTransactionTransferFee->execute($payment->amount, $constant); + $transferFee = $this->calculatesTransactionTransferFee->execute(($payment->original_amount * ( 1 / $payment->currency_rate)), $constant); $object = new TransactionObject($transferFeeNumber, TransactionType::TRANSFER_FEE, 1, $supplier->id, $supplier->banks()->where('default', true)->first()->id, PaymentMethodType::CASH, $payment->original_amount, $payment->original_amount, $payment->original_currency_id, $payment->original_currency_id, From bad6a99efa9cab14fe7ac734af57a77be80ad31a Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 12 Apr 2022 11:13:52 +0800 Subject: [PATCH 30/74] update transfer fee formula --- .../Processors/CreateSupplierTransactionProcessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Modules/Transactions/Processors/CreateSupplierTransactionProcessor.php b/app/Classes/Modules/Transactions/Processors/CreateSupplierTransactionProcessor.php index f8d6b20a..58a37ed1 100644 --- a/app/Classes/Modules/Transactions/Processors/CreateSupplierTransactionProcessor.php +++ b/app/Classes/Modules/Transactions/Processors/CreateSupplierTransactionProcessor.php @@ -97,7 +97,7 @@ class CreateSupplierTransactionProcessor $this->pushBill($billTransaction); $transferFeeNumber = $this->generatesTransactionBillNumber->execute('TRFR-'); - $transferFee = $this->calculatesTransactionTransferFee->execute(($payment->original_amount * ( 1 / $payment->currency_rate)), $constant); + $transferFee = $this->calculatesTransactionTransferFee->execute(($payment->amount - $payment->service_charge - $payment->tax), $constant); $object = new TransactionObject($transferFeeNumber, TransactionType::TRANSFER_FEE, 1, $supplier->id, $supplier->banks()->where('default', true)->first()->id, PaymentMethodType::CASH, $payment->original_amount, $payment->original_amount, $payment->original_currency_id, $payment->original_currency_id, From 13b136b4c43390a4af471c1f32d951fa58b44ebe Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 12 Apr 2022 11:15:11 +0800 Subject: [PATCH 31/74] update transfer fee formula --- .../Processors/CreateSupplierTransactionProcessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Modules/Transactions/Processors/CreateSupplierTransactionProcessor.php b/app/Classes/Modules/Transactions/Processors/CreateSupplierTransactionProcessor.php index 58a37ed1..db443184 100644 --- a/app/Classes/Modules/Transactions/Processors/CreateSupplierTransactionProcessor.php +++ b/app/Classes/Modules/Transactions/Processors/CreateSupplierTransactionProcessor.php @@ -97,7 +97,7 @@ class CreateSupplierTransactionProcessor $this->pushBill($billTransaction); $transferFeeNumber = $this->generatesTransactionBillNumber->execute('TRFR-'); - $transferFee = $this->calculatesTransactionTransferFee->execute(($payment->amount - $payment->service_charge - $payment->tax), $constant); + $transferFee = $this->calculatesTransactionTransferFee->execute($billTransaction->amount, $constant); $object = new TransactionObject($transferFeeNumber, TransactionType::TRANSFER_FEE, 1, $supplier->id, $supplier->banks()->where('default', true)->first()->id, PaymentMethodType::CASH, $payment->original_amount, $payment->original_amount, $payment->original_currency_id, $payment->original_currency_id, From f7de7d290af8b2642a5a6c0385b530314394af11 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 12 Apr 2022 11:19:57 +0800 Subject: [PATCH 32/74] update transfer fee formula --- .../Services/CalculatesTransactionServiceCharge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Modules/Transactions/Services/CalculatesTransactionServiceCharge.php b/app/Classes/Modules/Transactions/Services/CalculatesTransactionServiceCharge.php index e04edee2..29751d80 100644 --- a/app/Classes/Modules/Transactions/Services/CalculatesTransactionServiceCharge.php +++ b/app/Classes/Modules/Transactions/Services/CalculatesTransactionServiceCharge.php @@ -31,7 +31,7 @@ class CalculatesTransactionServiceCharge return 0; } - $transfer_fee = $this->calculatesTransactionTransferFee->execute($amount, $service_charge); + $transfer_fee = $this->calculatesTransactionTransferFee->execute(($amount * (1 / $rate)), $service_charge); return $service_charge->detail->amount->type === 'percentage' ? (($amount + $transfer_fee) * ( (float) $service_charge->detail->amount->value /100) * (1/$rate)) : (float) $service_charge->detail->amount->value; } From 8aa853c7c4f2af722a8a021fb88166e720c32710 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Wed, 13 Apr 2022 12:38:37 +0800 Subject: [PATCH 33/74] add border to payment proof --- .../vue/components/bookings/elements/PaymentProofComponent.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/assets/vue/components/bookings/elements/PaymentProofComponent.vue b/resources/assets/vue/components/bookings/elements/PaymentProofComponent.vue index 5af5548c..ff8452a5 100644 --- a/resources/assets/vue/components/bookings/elements/PaymentProofComponent.vue +++ b/resources/assets/vue/components/bookings/elements/PaymentProofComponent.vue @@ -1,5 +1,5 @@