From 86288079f10f8419d726b4efd8dbd3fe55d3a1d8 Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Wed, 16 Oct 2024 16:56:03 +0800 Subject: [PATCH 01/17] Laravel Vapor - Image assets 404 error --- .../forms/EditPaymentRecipientBankDetailsComponent.vue | 4 ++-- .../bookings/forms/RecipientBankDetailsComponent.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/assets/vue/components/bookings/forms/EditPaymentRecipientBankDetailsComponent.vue b/resources/assets/vue/components/bookings/forms/EditPaymentRecipientBankDetailsComponent.vue index 857548cf..4a9b81b6 100644 --- a/resources/assets/vue/components/bookings/forms/EditPaymentRecipientBankDetailsComponent.vue +++ b/resources/assets/vue/components/bookings/forms/EditPaymentRecipientBankDetailsComponent.vue @@ -18,8 +18,8 @@
- - + +
- - + +
Date: Thu, 24 Oct 2024 02:44:46 +0800 Subject: [PATCH 02/17] Laravel Vapor - Fix inconsistency of download triggers which suppose to open in a new tab instead of current --- .../vue/components/bookings/elements/BillingComponent.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/assets/vue/components/bookings/elements/BillingComponent.vue b/resources/assets/vue/components/bookings/elements/BillingComponent.vue index ba1ce85c..c1700e32 100644 --- a/resources/assets/vue/components/bookings/elements/BillingComponent.vue +++ b/resources/assets/vue/components/bookings/elements/BillingComponent.vue @@ -126,7 +126,9 @@ export default { successHandler(response) { if(window.LARAVEL_VAPOR_ENABLED){ if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + console.log('download'); + window.open(response.src, '_blank'); } } }, From e83db6a57f09bdec909fd92c050e748632c9e99b Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Thu, 24 Oct 2024 03:09:12 +0800 Subject: [PATCH 03/17] Laravel Vapor - Fix inconsistency of download triggers which suppose to open in a new tab instead of current --- .../accounting/elements/HistoryImportedInvoices.vue | 4 +++- .../vue/components/bookings/elements/BillingComponent.vue | 1 - .../bookings/elements/UploadDebtorExcelComponent.vue | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/resources/assets/vue/components/accounting/elements/HistoryImportedInvoices.vue b/resources/assets/vue/components/accounting/elements/HistoryImportedInvoices.vue index d0dd1e93..23a8e1b4 100644 --- a/resources/assets/vue/components/accounting/elements/HistoryImportedInvoices.vue +++ b/resources/assets/vue/components/accounting/elements/HistoryImportedInvoices.vue @@ -41,7 +41,9 @@ successHandler(response) { if(window.LARAVEL_VAPOR_ENABLED){ if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + console.log('download'); + window.open(response.src, '_blank'); } } }, diff --git a/resources/assets/vue/components/bookings/elements/BillingComponent.vue b/resources/assets/vue/components/bookings/elements/BillingComponent.vue index c1700e32..3f8df642 100644 --- a/resources/assets/vue/components/bookings/elements/BillingComponent.vue +++ b/resources/assets/vue/components/bookings/elements/BillingComponent.vue @@ -127,7 +127,6 @@ export default { if(window.LARAVEL_VAPOR_ENABLED){ if (response.src) { // window.location.href = response.src; - console.log('download'); window.open(response.src, '_blank'); } } diff --git a/resources/assets/vue/components/bookings/elements/UploadDebtorExcelComponent.vue b/resources/assets/vue/components/bookings/elements/UploadDebtorExcelComponent.vue index 85db0263..2aa32607 100644 --- a/resources/assets/vue/components/bookings/elements/UploadDebtorExcelComponent.vue +++ b/resources/assets/vue/components/bookings/elements/UploadDebtorExcelComponent.vue @@ -81,7 +81,9 @@ response.json().then(response => { if(!success){return;} if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + console.log('download'); + window.open(response.src, '_blank'); } }); } From 18f071af50eefcea78fbe53447388f58b6bb80dd Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Thu, 24 Oct 2024 03:19:06 +0800 Subject: [PATCH 04/17] Laravel Vapor - Fix inconsistency of download triggers which suppose to open in a new tab instead of current --- .../elements/CustomerTransactionHistorySectionComponent.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/assets/vue/components/bookings/elements/CustomerTransactionHistorySectionComponent.vue b/resources/assets/vue/components/bookings/elements/CustomerTransactionHistorySectionComponent.vue index 0a0b06bf..b0643368 100644 --- a/resources/assets/vue/components/bookings/elements/CustomerTransactionHistorySectionComponent.vue +++ b/resources/assets/vue/components/bookings/elements/CustomerTransactionHistorySectionComponent.vue @@ -130,7 +130,9 @@ export default { response.json().then(response => { if(!success){return;} if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + console.log('download'); + window.open(response.src, '_blank'); } }); } From be7387a16fdff45f2039252c9786873f7c4b012d Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Thu, 24 Oct 2024 03:24:31 +0800 Subject: [PATCH 05/17] Laravel Vapor - Fix inconsistency of download triggers which suppose to open in a new tab instead of current --- .../accounting/elements/HistoryImportedReceipts.vue | 3 ++- .../accounting/sections/ImportedInvoiceMappedComponent.vue | 3 ++- .../accounting/sections/ImportedReceiptMappedComponent.vue | 3 ++- .../accounting/sections/TransactionsMappingComponent.vue | 6 ++++-- .../bookings/elements/DownloadBillingWithDatesComponent.vue | 3 ++- .../elements/DownloadSupplierWhiteFormComponent.vue | 3 ++- .../forms/ExportBookingTransactionFormComponent.vue | 3 ++- .../companies/elements/BulkDownloadInvoiceComponent.vue | 3 ++- .../elements/CustomerTransactionSectionComponent.vue | 3 ++- .../wallets/elements/CustomerWalletTransactionComponent.vue | 3 ++- 10 files changed, 22 insertions(+), 11 deletions(-) diff --git a/resources/assets/vue/components/accounting/elements/HistoryImportedReceipts.vue b/resources/assets/vue/components/accounting/elements/HistoryImportedReceipts.vue index 385e37b9..1b37b8ef 100644 --- a/resources/assets/vue/components/accounting/elements/HistoryImportedReceipts.vue +++ b/resources/assets/vue/components/accounting/elements/HistoryImportedReceipts.vue @@ -41,7 +41,8 @@ successHandler(response) { if(window.LARAVEL_VAPOR_ENABLED){ if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + window.open(response.src, '_blank'); } } }, diff --git a/resources/assets/vue/components/accounting/sections/ImportedInvoiceMappedComponent.vue b/resources/assets/vue/components/accounting/sections/ImportedInvoiceMappedComponent.vue index 01194163..9047cc76 100644 --- a/resources/assets/vue/components/accounting/sections/ImportedInvoiceMappedComponent.vue +++ b/resources/assets/vue/components/accounting/sections/ImportedInvoiceMappedComponent.vue @@ -135,7 +135,8 @@ response.json().then(response => { if(!success){return;} if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + window.open(response.src, '_blank'); } }); } diff --git a/resources/assets/vue/components/accounting/sections/ImportedReceiptMappedComponent.vue b/resources/assets/vue/components/accounting/sections/ImportedReceiptMappedComponent.vue index c81532c8..2e595ede 100644 --- a/resources/assets/vue/components/accounting/sections/ImportedReceiptMappedComponent.vue +++ b/resources/assets/vue/components/accounting/sections/ImportedReceiptMappedComponent.vue @@ -139,7 +139,8 @@ response.json().then(response => { if(!success){return;} if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + window.open(response.src, '_blank'); } }); } diff --git a/resources/assets/vue/components/accounting/sections/TransactionsMappingComponent.vue b/resources/assets/vue/components/accounting/sections/TransactionsMappingComponent.vue index b94148ad..0217ed9b 100644 --- a/resources/assets/vue/components/accounting/sections/TransactionsMappingComponent.vue +++ b/resources/assets/vue/components/accounting/sections/TransactionsMappingComponent.vue @@ -281,7 +281,8 @@ export default { response.json().then(response => { if(!success){return;} if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + window.open(response.src, '_blank'); } }); } @@ -309,7 +310,8 @@ export default { response.json().then(response => { if(!success){return;} if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + window.open(response.src, '_blank'); } }); } diff --git a/resources/assets/vue/components/bookings/elements/DownloadBillingWithDatesComponent.vue b/resources/assets/vue/components/bookings/elements/DownloadBillingWithDatesComponent.vue index 195fc7dd..867ee932 100644 --- a/resources/assets/vue/components/bookings/elements/DownloadBillingWithDatesComponent.vue +++ b/resources/assets/vue/components/bookings/elements/DownloadBillingWithDatesComponent.vue @@ -109,7 +109,8 @@ export default { successHandler(response) { if(window.LARAVEL_VAPOR_ENABLED){ if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + window.open(response.src, '_blank'); } } }, diff --git a/resources/assets/vue/components/bookings/elements/DownloadSupplierWhiteFormComponent.vue b/resources/assets/vue/components/bookings/elements/DownloadSupplierWhiteFormComponent.vue index b12e98ba..732770e5 100644 --- a/resources/assets/vue/components/bookings/elements/DownloadSupplierWhiteFormComponent.vue +++ b/resources/assets/vue/components/bookings/elements/DownloadSupplierWhiteFormComponent.vue @@ -93,7 +93,8 @@ export default { this.returnData = null; if(window.LARAVEL_VAPOR_ENABLED){ if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + window.open(response.src, '_blank'); } } } diff --git a/resources/assets/vue/components/bookings/forms/ExportBookingTransactionFormComponent.vue b/resources/assets/vue/components/bookings/forms/ExportBookingTransactionFormComponent.vue index eeb6bf62..d53dce7e 100644 --- a/resources/assets/vue/components/bookings/forms/ExportBookingTransactionFormComponent.vue +++ b/resources/assets/vue/components/bookings/forms/ExportBookingTransactionFormComponent.vue @@ -99,7 +99,8 @@ export default { successHandler(response) { if(window.LARAVEL_VAPOR_ENABLED){ if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + window.open(response.src, '_blank'); } } }, diff --git a/resources/assets/vue/components/companies/elements/BulkDownloadInvoiceComponent.vue b/resources/assets/vue/components/companies/elements/BulkDownloadInvoiceComponent.vue index 88cd0d9c..fa49c53e 100644 --- a/resources/assets/vue/components/companies/elements/BulkDownloadInvoiceComponent.vue +++ b/resources/assets/vue/components/companies/elements/BulkDownloadInvoiceComponent.vue @@ -95,7 +95,8 @@ this.returnData = null; if(window.LARAVEL_VAPOR_ENABLED){ if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + window.open(response.src, '_blank'); } } } diff --git a/resources/assets/vue/components/wallets/elements/CustomerTransactionSectionComponent.vue b/resources/assets/vue/components/wallets/elements/CustomerTransactionSectionComponent.vue index 41bd4175..3f1b0b37 100644 --- a/resources/assets/vue/components/wallets/elements/CustomerTransactionSectionComponent.vue +++ b/resources/assets/vue/components/wallets/elements/CustomerTransactionSectionComponent.vue @@ -133,7 +133,8 @@ export default { response.json().then(response => { if(!success){return;} if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + window.open(response.src, '_blank'); } }); } diff --git a/resources/assets/vue/components/wallets/elements/CustomerWalletTransactionComponent.vue b/resources/assets/vue/components/wallets/elements/CustomerWalletTransactionComponent.vue index f9f8498e..ad5ccb07 100644 --- a/resources/assets/vue/components/wallets/elements/CustomerWalletTransactionComponent.vue +++ b/resources/assets/vue/components/wallets/elements/CustomerWalletTransactionComponent.vue @@ -39,7 +39,8 @@ response.json().then(response => { if(!success){return;} if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + window.open(response.src, '_blank'); } }); } From efed8b639d2d4feff3000a683bdf9857fa3a7ddf Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Thu, 24 Oct 2024 03:38:53 +0800 Subject: [PATCH 06/17] Laravel Vapor - Fix inconsistency of download triggers which suppose to open in a new tab instead of current --- .../components/accounting/elements/HistoryImportedInvoices.vue | 1 - .../elements/CustomerTransactionHistorySectionComponent.vue | 1 - .../components/bookings/elements/UploadDebtorExcelComponent.vue | 1 - .../bookings/forms/SupplierPlaceOrderFormComponent.vue | 2 +- 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/resources/assets/vue/components/accounting/elements/HistoryImportedInvoices.vue b/resources/assets/vue/components/accounting/elements/HistoryImportedInvoices.vue index 23a8e1b4..b10721ee 100644 --- a/resources/assets/vue/components/accounting/elements/HistoryImportedInvoices.vue +++ b/resources/assets/vue/components/accounting/elements/HistoryImportedInvoices.vue @@ -42,7 +42,6 @@ if(window.LARAVEL_VAPOR_ENABLED){ if (response.src) { // window.location.href = response.src; - console.log('download'); window.open(response.src, '_blank'); } } diff --git a/resources/assets/vue/components/bookings/elements/CustomerTransactionHistorySectionComponent.vue b/resources/assets/vue/components/bookings/elements/CustomerTransactionHistorySectionComponent.vue index b0643368..76d9d509 100644 --- a/resources/assets/vue/components/bookings/elements/CustomerTransactionHistorySectionComponent.vue +++ b/resources/assets/vue/components/bookings/elements/CustomerTransactionHistorySectionComponent.vue @@ -131,7 +131,6 @@ export default { if(!success){return;} if (response.src) { // window.location.href = response.src; - console.log('download'); window.open(response.src, '_blank'); } }); diff --git a/resources/assets/vue/components/bookings/elements/UploadDebtorExcelComponent.vue b/resources/assets/vue/components/bookings/elements/UploadDebtorExcelComponent.vue index 2aa32607..c999b81a 100644 --- a/resources/assets/vue/components/bookings/elements/UploadDebtorExcelComponent.vue +++ b/resources/assets/vue/components/bookings/elements/UploadDebtorExcelComponent.vue @@ -82,7 +82,6 @@ if(!success){return;} if (response.src) { // window.location.href = response.src; - console.log('download'); window.open(response.src, '_blank'); } }); diff --git a/resources/assets/vue/components/bookings/forms/SupplierPlaceOrderFormComponent.vue b/resources/assets/vue/components/bookings/forms/SupplierPlaceOrderFormComponent.vue index 8fdd1ce4..2607388b 100644 --- a/resources/assets/vue/components/bookings/forms/SupplierPlaceOrderFormComponent.vue +++ b/resources/assets/vue/components/bookings/forms/SupplierPlaceOrderFormComponent.vue @@ -159,7 +159,7 @@ response.json().then(response => { if(!success){return;} if (response.src) { - window.location.href = response.src; + window.open(response.src, '_blank'); } }); } From 153338704bad86c5507c72bcb1fe50d05993dbeb Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Sat, 26 Oct 2024 03:15:07 +0800 Subject: [PATCH 07/17] Laravel Vapor - New UI and date filter for long qeury report download --- .../Services/ExportsV2Transactions.php | 104 +++++++++++++++ .../ExportCustomersToExcelController.php | 35 ++++++ .../DownloadTransactionsReportComponent.vue | 110 ++++++++++++++++ .../ShowWhiteFormTransactionsComponent.vue | 118 ++++++++++++++++++ .../forms/DatePickerLimitRangeComponent.vue | 47 +++++++ .../views/pages/downloads/index.blade.php | 13 +- routes/web.php | 1 + 7 files changed, 426 insertions(+), 2 deletions(-) create mode 100644 app/Classes/Modules/Exports/Services/ExportsV2Transactions.php create mode 100644 resources/assets/vue/components/bookings/elements/DownloadTransactionsReportComponent.vue create mode 100644 resources/assets/vue/components/bookings/elements/ShowWhiteFormTransactionsComponent.vue create mode 100644 resources/assets/vue/components/general/forms/DatePickerLimitRangeComponent.vue diff --git a/app/Classes/Modules/Exports/Services/ExportsV2Transactions.php b/app/Classes/Modules/Exports/Services/ExportsV2Transactions.php new file mode 100644 index 00000000..007293c2 --- /dev/null +++ b/app/Classes/Modules/Exports/Services/ExportsV2Transactions.php @@ -0,0 +1,104 @@ +startDate = $startDate ? Carbon::parse($startDate)->startOfDay() : Carbon::now()->subMonths(1); + $this->endDate = $endDate ? Carbon::parse($endDate)->endOfDay() : Carbon::now(); + } + + /** + * @return \Illuminate\Support\Collection|mixed + */ + public function query() + { + return Transaction::whereBetween('created_at', [$this->startDate, $this->endDate]) //Limit, 'expensive' query; + ->whereIn('type', [TransactionType::PAYMENT, TransactionType::BILL]) + ->where('owner_type', '!=', Wallet::class); + } + + /** + * @param $transaction + * @return array + */ + public function map($transaction): array + { + $transactionTypes = [ + 0 => 'PAYMENT_ATTEMPT', + 1 => 'PAYMENT', + 2 => 'INVOICE', + 3 => 'BILL', + 4 => 'PROFORMA', + 5 => 'TOP_UP', + 6 => 'REFUND', + 7 => 'PURCHASE_ORDER', + 8 => 'SUPPLIER_DELIVER', + 9 => 'CREDIT_NOTE', + 10 => 'WITHDRAW', + 11 => 'DEBIT_NOTE', + 12 => 'TRANSFER_FEE' + ]; + + $transactionStatus = [ + 0 => 'PENDING_SUBMISSION', + 1 => 'PENDING_VERIFICATION', + 2 => 'APPROVED', + 3 => 'COMPLETED', + 4 => 'REJECTED', + 5 => 'SUSPENDED', + 6 => 'EXPIRED' + ]; + + + $booking = $transaction->owner; + if(!($booking instanceof Booking)){ + $booking = $booking->owner; + } + + $company = $booking->company; + + if(!$company instanceof Company) dd($transaction); + + return [ + $company->reference, + $booking ? $booking->marking : '', + $transaction->bill_no, + $transaction->owner_id, + $transaction->owner_type, + $transactionTypes[$transaction->type], + $transaction->issuerCompany->name, + $transaction->reciver, + $transaction->currency->short_code, + $transaction->amount, + $transaction->original_currency->short_code, + $transaction->original_amount, + $transaction->currency_rate, + $transaction->tax, + $transaction->service_charge, + isset($transactionStatus[$transaction->status]) ? $transactionStatus[$transaction->status] : 'Unknown Status', + \PhpOffice\PhpSpreadsheet\Shared\Date::dateTimeToExcel($transaction->created_at), + \PhpOffice\PhpSpreadsheet\Shared\Date::dateTimeToExcel($transaction->updated_at), + ]; + } +} diff --git a/app/Http/Controllers/Exports/ExportCustomersToExcelController.php b/app/Http/Controllers/Exports/ExportCustomersToExcelController.php index 91ace417..b693f326 100644 --- a/app/Http/Controllers/Exports/ExportCustomersToExcelController.php +++ b/app/Http/Controllers/Exports/ExportCustomersToExcelController.php @@ -6,6 +6,7 @@ namespace App\Http\Controllers\Exports; use App\Classes\Modules\Exports\Services\ExportCurrencyVendorOrder; use App\Classes\Modules\Exports\Services\ExportsCustomers; use App\Classes\Modules\Exports\Services\ExportsTransactions; +use App\Classes\Modules\Exports\Services\ExportsV2Transactions; use App\Classes\Modules\Exports\Services\ExportsBookingTransactions; use App\Classes\Modules\Exports\Services\ExportsLeadsTransactions; use App\Classes\Modules\Exports\Services\ExportsNullDebtors; @@ -23,6 +24,7 @@ use App\Classes\Modules\Exports\Services\ExportsImportedReceiptMappeds; use App\Classes\Modules\Exports\Services\ExportsWhiteFormTransactions; use Illuminate\Support\Facades\Storage; use App\Classes\General\AWSS3Helper; +use Illuminate\Support\Carbon; class ExportCustomersToExcelController { @@ -72,6 +74,39 @@ class ExportCustomersToExcelController } } + public function v2transactions(Request $request){ + + $validated = $request->validate([ + 'startDate' => 'nullable|date_format:d-m-Y', + 'endDate' => 'nullable|date_format:d-m-Y|after_or_equal:startDate', + ]); + + $startDate = null; + $endDate = null; + + if (isset($validated['startDate']) && $validated['startDate']) { + $startDate = Carbon::createFromFormat('d-m-Y', $validated['startDate'])->startOfDay(); + } else { + $startDate = Carbon::now()->subMonths(1)->startOfDay(); + } + + if (isset($validated['endDate']) && $validated['endDate']) { + $endDate = Carbon::createFromFormat('d-m-Y', $validated['endDate'])->endOfDay(); + } else { + $endDate = Carbon::now()->endOfDay(); + } + + $exportsTransactions = new ExportsV2Transactions($startDate, $endDate); + $exportFileName = 'transactions.csv'; + $filesystemDriver = Storage::getDefaultDriver(); + + if ($filesystemDriver === 's3') { + return response(['src' => AWSS3Helper::S3Exportable($exportFileName, $exportsTransactions)]); + } else { + return $exportsTransactions->download($exportFileName, Excel::CSV, ['Content-Type' => 'text/csv']); + } + } + public function nullDebtor(ExportsNullDebtors $exportsNullDebtors, Request $request){ $exportFileName = 'nullDebtor.xls'; $filesystemDriver = Storage::getDefaultDriver(); diff --git a/resources/assets/vue/components/bookings/elements/DownloadTransactionsReportComponent.vue b/resources/assets/vue/components/bookings/elements/DownloadTransactionsReportComponent.vue new file mode 100644 index 00000000..1d08a452 --- /dev/null +++ b/resources/assets/vue/components/bookings/elements/DownloadTransactionsReportComponent.vue @@ -0,0 +1,110 @@ +
+
+
+
+
+
+ +
+
+
+
+ + +
+
+ + +
+
+
+
+ +
+
+ transactions.csv +

(default: last 1 month)

+
+ + Download + +
+ +
+ + +
+
+
+
+
+ + + + + + diff --git a/resources/assets/vue/components/bookings/elements/ShowWhiteFormTransactionsComponent.vue b/resources/assets/vue/components/bookings/elements/ShowWhiteFormTransactionsComponent.vue new file mode 100644 index 00000000..560f415f --- /dev/null +++ b/resources/assets/vue/components/bookings/elements/ShowWhiteFormTransactionsComponent.vue @@ -0,0 +1,118 @@ + + + + + diff --git a/resources/assets/vue/components/general/forms/DatePickerLimitRangeComponent.vue b/resources/assets/vue/components/general/forms/DatePickerLimitRangeComponent.vue new file mode 100644 index 00000000..d65b8b50 --- /dev/null +++ b/resources/assets/vue/components/general/forms/DatePickerLimitRangeComponent.vue @@ -0,0 +1,47 @@ + + + diff --git a/resources/views/pages/downloads/index.blade.php b/resources/views/pages/downloads/index.blade.php index 1cf3a36b..bb03689d 100644 --- a/resources/views/pages/downloads/index.blade.php +++ b/resources/views/pages/downloads/index.blade.php @@ -21,7 +21,8 @@
-
+ +
@@ -60,6 +61,14 @@
+
+
+ +
+
+
+
+
diff --git a/routes/web.php b/routes/web.php index 90711eaf..3e8f3d64 100644 --- a/routes/web.php +++ b/routes/web.php @@ -291,6 +291,7 @@ Route::get('billplz/bills/{bill_no}', function($bill_no){ Route::get('/export/customers/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@export')->name('customers.export'); Route::get('/export/transactions/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@transactions')->name('transactions.export'); +Route::get('/export/transactions/v2/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@v2transactions')->name('transactions.v2.export'); Route::get('/export/null-debtor/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@nullDebtor')->name('newDebtor.export'); Route::get('/export/payment-transactions/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@paymentTransactions')->name('paymentTransactions.export'); Route::get('/export/white-form-transactions/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@whiteFormTransactions')->name('whiteFormTransactions.export'); From d7ddd47ef1fe9f09c7fc870580e776033fe7f37f Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Sat, 26 Oct 2024 04:32:17 +0800 Subject: [PATCH 08/17] Laravel Vapor - New UI and date filter for long qeury report download --- .../bookings/elements/ShowWhiteFormTransactionsComponent.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/assets/vue/components/bookings/elements/ShowWhiteFormTransactionsComponent.vue b/resources/assets/vue/components/bookings/elements/ShowWhiteFormTransactionsComponent.vue index 560f415f..a163dab1 100644 --- a/resources/assets/vue/components/bookings/elements/ShowWhiteFormTransactionsComponent.vue +++ b/resources/assets/vue/components/bookings/elements/ShowWhiteFormTransactionsComponent.vue @@ -109,7 +109,7 @@ export default { if (this.validateDateRange()) { const formattedStartDate = this.formatDate(new Date(this.startDate.split('-').reverse().join('-'))); const formattedEndDate = this.formatDate(new Date(this.endDate.split('-').reverse().join('-'))); - const url = `https://exchange.cief-malaysia.com/show-white-form-transactions-in-date-range/${formattedStartDate}/${formattedEndDate}`; + const url = `/show-white-form-transactions-in-date-range/${formattedStartDate}/${formattedEndDate}`; window.open(url, '_blank'); } } From e86d3a075fbfaa1a65d5d355a48a3d44e81ae83a Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Sat, 26 Oct 2024 05:01:48 +0800 Subject: [PATCH 09/17] Laravel Vapor - New UI and date filter for long qeury report download --- .../bookings/elements/DownloadTransactionsReportComponent.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/assets/vue/components/bookings/elements/DownloadTransactionsReportComponent.vue b/resources/assets/vue/components/bookings/elements/DownloadTransactionsReportComponent.vue index 1d08a452..a5b78afe 100644 --- a/resources/assets/vue/components/bookings/elements/DownloadTransactionsReportComponent.vue +++ b/resources/assets/vue/components/bookings/elements/DownloadTransactionsReportComponent.vue @@ -17,7 +17,7 @@
- +
From 4784c704c2492acfb6f464a8bcb3548ad27869f4 Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Mon, 28 Oct 2024 15:46:11 +0800 Subject: [PATCH 10/17] Laravel Vapor - Fix a front end display inaccurate on user UI when editing recipient bank details --- app/Http/Resources/TransactionResource.php | 4 ++++ .../bookings/forms/BookingPaymentQuotationComponent.vue | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Http/Resources/TransactionResource.php b/app/Http/Resources/TransactionResource.php index e14c32c0..a7297ac1 100644 --- a/app/Http/Resources/TransactionResource.php +++ b/app/Http/Resources/TransactionResource.php @@ -22,13 +22,16 @@ class TransactionResource extends JsonResource $booking = null; //cief todo: 66 $bank = null; //Check if Transaction of type PAYMENT has an override for recipient bank - starts + $isEditedBankRecipient = false; if(in_array((int)$this->type, [TransactionType::BILL, TransactionType::REFUND, TransactionType::SUPPLIER_REFUND])){ $booking = $this->owner->owner; $bank = $this->owner->bank ?? $booking->bank; + $isEditedBankRecipient = $this->owner->bank ? true : false; } else{ $booking = $this->owner; $bank = $this->bank ?? $booking->bank; + $isEditedBankRecipient = $this->bank ? true : false; } //Check if Transaction of type PAYMENT has an override for recipient bank - ends $days = $this->created_at->endOfDay()->addWeekdays($booking->service_id === 3 ? 3 : 1); @@ -66,6 +69,7 @@ class TransactionResource extends JsonResource 'remarks' => RemarkResource::collection($this->remarks), 'redemption' => new VoucherRedemptionResource($this->voucherRedemption), 'bank' => ((int) $this->type === TransactionType::PAYMENT) ? new BankResource($bank) : null, //When a transaction (of type payment) has an override recipient bank details on booking, this is NOT null + 'bank_recipient_edited' => $isEditedBankRecipient ]; } } diff --git a/resources/assets/vue/components/bookings/forms/BookingPaymentQuotationComponent.vue b/resources/assets/vue/components/bookings/forms/BookingPaymentQuotationComponent.vue index 5a03999c..9208852c 100644 --- a/resources/assets/vue/components/bookings/forms/BookingPaymentQuotationComponent.vue +++ b/resources/assets/vue/components/bookings/forms/BookingPaymentQuotationComponent.vue @@ -614,7 +614,7 @@ bookingId: this.data.id }, isEditRecipientBankDetailsCollapsed: false, - isAnyPaymentRecipientBankEdited: this.data.payment_history.some(payment => payment.bank !== null), + isAnyPaymentRecipientBankEdited: this.data.payment_history.some(payment => payment.bank_recipient_edited !== null && payment.bank_recipient_edited), } }, validations () { From bb0bc7a04e710cbe2f723d9eb8c33e3440139162 Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Mon, 28 Oct 2024 16:34:21 +0800 Subject: [PATCH 11/17] Laravel Vapor - Fix a front end display inaccurate on user UI when editing recipient bank details --- app/Http/Resources/TransactionResource.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Http/Resources/TransactionResource.php b/app/Http/Resources/TransactionResource.php index a7297ac1..8f2f1e66 100644 --- a/app/Http/Resources/TransactionResource.php +++ b/app/Http/Resources/TransactionResource.php @@ -21,6 +21,7 @@ class TransactionResource extends JsonResource { $booking = null; //cief todo: 66 $bank = null; + //Check if Transaction of type PAYMENT has an override for recipient bank - starts $isEditedBankRecipient = false; if(in_array((int)$this->type, [TransactionType::BILL, TransactionType::REFUND, TransactionType::SUPPLIER_REFUND])){ From 2e8771fead8b5fdb0d0a5b8f6c033e1ed53fdf2d Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Mon, 28 Oct 2024 16:54:58 +0800 Subject: [PATCH 12/17] Laravel Vapor - Fix a front end display inaccurate on user UI when editing recipient bank details --- 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 8f2f1e66..c2d20a85 100644 --- a/app/Http/Resources/TransactionResource.php +++ b/app/Http/Resources/TransactionResource.php @@ -35,8 +35,8 @@ class TransactionResource extends JsonResource $isEditedBankRecipient = $this->bank ? true : false; } //Check if Transaction of type PAYMENT has an override for recipient bank - ends - $days = $this->created_at->endOfDay()->addWeekdays($booking->service_id === 3 ? 3 : 1); + $days = $this->created_at->endOfDay()->addWeekdays($booking->service_id === 3 ? 3 : 1); return [ 'id' => $this->id, 'booking' => new BookingResource($booking), From 2ec7cc2212eea96a833de44b371ecb9580ed0df1 Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Mon, 28 Oct 2024 18:56:40 +0800 Subject: [PATCH 13/17] Laravel Vapor - Debug uploading issue encountered on 20241016 --- .../components/general/forms/FileUploadComponent.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/assets/vue/components/general/forms/FileUploadComponent.vue b/resources/assets/vue/components/general/forms/FileUploadComponent.vue index 3807ff01..e964ac4b 100644 --- a/resources/assets/vue/components/general/forms/FileUploadComponent.vue +++ b/resources/assets/vue/components/general/forms/FileUploadComponent.vue @@ -97,16 +97,16 @@ vm.isLoading = true; - const pdfIconUrl = "https://assets.izyim.com/public/images/icons/pdf.png"; - const xlsIconUrl = "https://assets.izyim.com/public/images/icons/xlsx.png"; + // const pdfIconUrl = "https://assets.izyim.com/public/images/icons/pdf.png"; + // const xlsIconUrl = "https://assets.izyim.com/public/images/icons/xlsx.png"; if(file.name.split('.').pop() === 'pdf'){ - // $(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", asset("images/icons/pdf.png")); - $(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", pdfIconUrl); + $(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", asset("images/icons/pdf.png")); + //$(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", pdfIconUrl); } if(file.name.split('.').pop().indexOf("xls") !== -1){ - // $(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", asset("images/icons/xlsx.png")); - $(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", xlsIconUrl); + $(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", asset("images/icons/xlsx.png")); + //$(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", xlsIconUrl); } Promise.all(dropzone.files.map(function(file){ From 6c47ee36d1624cbdc5cb07adc08de141eca1d1ba Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Mon, 28 Oct 2024 19:13:44 +0800 Subject: [PATCH 14/17] Laravel Vapor - Debug uploading issue encountered on 20241016 --- .../vue/components/general/forms/FileUploadComponent.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/assets/vue/components/general/forms/FileUploadComponent.vue b/resources/assets/vue/components/general/forms/FileUploadComponent.vue index e964ac4b..d5faa064 100644 --- a/resources/assets/vue/components/general/forms/FileUploadComponent.vue +++ b/resources/assets/vue/components/general/forms/FileUploadComponent.vue @@ -101,11 +101,11 @@ // const xlsIconUrl = "https://assets.izyim.com/public/images/icons/xlsx.png"; if(file.name.split('.').pop() === 'pdf'){ - $(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", asset("images/icons/pdf.png")); + $(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", Vapor.asset("images/icons/pdf.png")); //$(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", pdfIconUrl); } if(file.name.split('.').pop().indexOf("xls") !== -1){ - $(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", asset("images/icons/xlsx.png")); + $(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", Vapor.asset("images/icons/xlsx.png")); //$(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", xlsIconUrl); } From 2f78e9a481fb62d5b85514146c5c9ae3528df974 Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Mon, 28 Oct 2024 19:31:42 +0800 Subject: [PATCH 15/17] Laravel Vapor - Debug uploading issue encountered on 20241016 --- .../assets/vue/components/general/forms/FileUploadComponent.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/assets/vue/components/general/forms/FileUploadComponent.vue b/resources/assets/vue/components/general/forms/FileUploadComponent.vue index d5faa064..844e16f2 100644 --- a/resources/assets/vue/components/general/forms/FileUploadComponent.vue +++ b/resources/assets/vue/components/general/forms/FileUploadComponent.vue @@ -102,10 +102,12 @@ if(file.name.split('.').pop() === 'pdf'){ $(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", Vapor.asset("images/icons/pdf.png")); + console.log('pdf.png: ', Vapor.asset("images/icons/pdf.png")); //$(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", pdfIconUrl); } if(file.name.split('.').pop().indexOf("xls") !== -1){ $(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", Vapor.asset("images/icons/xlsx.png")); + console.log('xlsx.png: ', Vapor.asset("images/icons/xlsx.png")); //$(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", xlsIconUrl); } From 0d8ff49b7db53260aeb0ab6c6086e12499605a69 Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Mon, 28 Oct 2024 19:53:28 +0800 Subject: [PATCH 16/17] Laravel Vapor - Debug uploading issue encountered on 20241016 --- .../general/forms/FileUploadComponent.vue | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/resources/assets/vue/components/general/forms/FileUploadComponent.vue b/resources/assets/vue/components/general/forms/FileUploadComponent.vue index 844e16f2..5cf0d302 100644 --- a/resources/assets/vue/components/general/forms/FileUploadComponent.vue +++ b/resources/assets/vue/components/general/forms/FileUploadComponent.vue @@ -101,12 +101,22 @@ // const xlsIconUrl = "https://assets.izyim.com/public/images/icons/xlsx.png"; if(file.name.split('.').pop() === 'pdf'){ - $(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", Vapor.asset("images/icons/pdf.png")); + //$(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", Vapor.asset("images/icons/pdf.png")); + const thumbnailElement = file.previewElement.querySelector("[data-dz-thumbnail]"); + if (thumbnailElement) { + thumbnailElement.src = Vapor.asset("images/icons/pdf.png"); // Set the PDF icon as the thumbnail + } + console.log('pdf.png: ', $(file.previewElement).closest("img[data-dz-thumbnail]")); console.log('pdf.png: ', Vapor.asset("images/icons/pdf.png")); //$(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", pdfIconUrl); } if(file.name.split('.').pop().indexOf("xls") !== -1){ - $(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", Vapor.asset("images/icons/xlsx.png")); + // $(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", Vapor.asset("images/icons/xlsx.png")); + const thumbnailElement = file.previewElement.querySelector("[data-dz-thumbnail]"); + if (thumbnailElement) { + thumbnailElement.src = Vapor.asset("images/icons/xlsx.png"); // Set the PDF icon as the thumbnail + } + console.log('xlsx.png: ', $(file.previewElement).closest("img[data-dz-thumbnail]")); console.log('xlsx.png: ', Vapor.asset("images/icons/xlsx.png")); //$(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", xlsIconUrl); } From 64ae7097ad49405049e015243ab6cdd110280c61 Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Mon, 28 Oct 2024 20:00:22 +0800 Subject: [PATCH 17/17] Laravel Vapor - Debug uploading issue encountered on 20241016 --- .../general/forms/FileUploadComponent.vue | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/resources/assets/vue/components/general/forms/FileUploadComponent.vue b/resources/assets/vue/components/general/forms/FileUploadComponent.vue index 5cf0d302..fbe235fe 100644 --- a/resources/assets/vue/components/general/forms/FileUploadComponent.vue +++ b/resources/assets/vue/components/general/forms/FileUploadComponent.vue @@ -102,23 +102,19 @@ if(file.name.split('.').pop() === 'pdf'){ //$(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", Vapor.asset("images/icons/pdf.png")); + //$(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", pdfIconUrl); const thumbnailElement = file.previewElement.querySelector("[data-dz-thumbnail]"); if (thumbnailElement) { - thumbnailElement.src = Vapor.asset("images/icons/pdf.png"); // Set the PDF icon as the thumbnail + thumbnailElement.src = Vapor.asset("images/icons/pdf.png"); } - console.log('pdf.png: ', $(file.previewElement).closest("img[data-dz-thumbnail]")); - console.log('pdf.png: ', Vapor.asset("images/icons/pdf.png")); - //$(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", pdfIconUrl); } if(file.name.split('.').pop().indexOf("xls") !== -1){ - // $(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", Vapor.asset("images/icons/xlsx.png")); + //$(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", Vapor.asset("images/icons/xlsx.png")); + //$(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", xlsIconUrl); const thumbnailElement = file.previewElement.querySelector("[data-dz-thumbnail]"); if (thumbnailElement) { - thumbnailElement.src = Vapor.asset("images/icons/xlsx.png"); // Set the PDF icon as the thumbnail + thumbnailElement.src = Vapor.asset("images/icons/xlsx.png"); } - console.log('xlsx.png: ', $(file.previewElement).closest("img[data-dz-thumbnail]")); - console.log('xlsx.png: ', Vapor.asset("images/icons/xlsx.png")); - //$(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", xlsIconUrl); } Promise.all(dropzone.files.map(function(file){