From 1526f36e9230cebcf9e05b3a69e52431f2633dc8 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Fri, 6 May 2022 13:53:47 +0800 Subject: [PATCH 01/30] remove raya announcement --- .../companies/sections/CustomerDashboardSectionComponent.vue | 5 ----- 1 file changed, 5 deletions(-) diff --git a/resources/assets/vue/components/companies/sections/CustomerDashboardSectionComponent.vue b/resources/assets/vue/components/companies/sections/CustomerDashboardSectionComponent.vue index bcfafad5..9d11ecd0 100644 --- a/resources/assets/vue/components/companies/sections/CustomerDashboardSectionComponent.vue +++ b/resources/assets/vue/components/companies/sections/CustomerDashboardSectionComponent.vue @@ -3,11 +3,6 @@
-
-
- -
-
From 74279d6dda17f1e8fb4510dab333d216118632f7 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 10 May 2022 11:27:33 +0800 Subject: [PATCH 02/30] fix transaction export --- .../Modules/Exports/Services/ExportsTransactions.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsTransactions.php b/app/Classes/Modules/Exports/Services/ExportsTransactions.php index 910fb79b..869114fb 100644 --- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php @@ -25,7 +25,7 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping */ public function query() { - return Transaction::where('type', TransactionType::BILL); + return Transaction::query(); } /** @@ -60,7 +60,12 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping 6 => 'EXPIRED' ]; + $booking = $transaction->owner->owner; + if($transaction->owner !== Booking::class){ + dump($transaction); + } + return [ $booking ? $booking->company->reference : '', $booking ? $booking->marking : '', From c856fff2034a8745be5b8df1b34b5fa86c0fd6b2 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 10 May 2022 11:30:10 +0800 Subject: [PATCH 03/30] fix transaction export --- app/Classes/Modules/Exports/Services/ExportsTransactions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsTransactions.php b/app/Classes/Modules/Exports/Services/ExportsTransactions.php index 869114fb..297fc019 100644 --- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php @@ -62,7 +62,7 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping $booking = $transaction->owner->owner; - if($transaction->owner !== Booking::class){ + if($transaction->owner instanceof Booking){ dump($transaction); } From 293bd1ffc011daa9715c62e996adc79810b8d2d2 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 10 May 2022 11:32:14 +0800 Subject: [PATCH 04/30] fix transaction export --- app/Classes/Modules/Exports/Services/ExportsTransactions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsTransactions.php b/app/Classes/Modules/Exports/Services/ExportsTransactions.php index 297fc019..c0605d55 100644 --- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php @@ -63,7 +63,7 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping $booking = $transaction->owner->owner; if($transaction->owner instanceof Booking){ - dump($transaction); + dump($transaction->owner); } return [ From 505398f9c592d5c27974e50298d34ea6b177d9c0 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 10 May 2022 11:33:16 +0800 Subject: [PATCH 05/30] fix transaction export --- app/Classes/Modules/Exports/Services/ExportsTransactions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsTransactions.php b/app/Classes/Modules/Exports/Services/ExportsTransactions.php index c0605d55..1b74c447 100644 --- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php @@ -62,7 +62,7 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping $booking = $transaction->owner->owner; - if($transaction->owner instanceof Booking){ + if(!($transaction->owner instanceof Booking)){ dump($transaction->owner); } From 4bf5c4081dc31e7ef44cc09f3b87ceef87d62a17 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 10 May 2022 11:35:01 +0800 Subject: [PATCH 06/30] fix transaction export --- app/Classes/Modules/Exports/Services/ExportsTransactions.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsTransactions.php b/app/Classes/Modules/Exports/Services/ExportsTransactions.php index 1b74c447..81b97eb8 100644 --- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php @@ -63,7 +63,9 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping $booking = $transaction->owner->owner; if(!($transaction->owner instanceof Booking)){ - dump($transaction->owner); + if(!($transaction->owner->owner instanceof Booking)){ + dump($transaction->owner); + } } return [ From da22d17b7a203017adb8c06f2fb8c7ad2d5fa3e2 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 10 May 2022 14:47:34 +0800 Subject: [PATCH 07/30] fix transaction export --- .../Exports/Services/ExportsTransactions.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsTransactions.php b/app/Classes/Modules/Exports/Services/ExportsTransactions.php index 81b97eb8..64a98a5a 100644 --- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php @@ -61,15 +61,24 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping ]; - $booking = $transaction->owner->owner; - if(!($transaction->owner instanceof Booking)){ - if(!($transaction->owner->owner instanceof Booking)){ - dump($transaction->owner); + $booking = $transaction->owner; + $company = $booking->owner; + + if(!($booking instanceof Booking)){ + $booking = $transaction->owner->owner; + + + if($booking instanceof Company){ + $company = $booking; + $booking = null; + } else { + $company = $booking->owner; } } + return [ - $booking ? $booking->company->reference : '', + $company->reference, $booking ? $booking->marking : '', $transaction->bill_no, $transaction->owner_id, From f6090732d1008f281a39cb2c0ecdeee06239dffe Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 10 May 2022 14:48:31 +0800 Subject: [PATCH 08/30] fix transaction export --- app/Classes/Modules/Exports/Services/ExportsTransactions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsTransactions.php b/app/Classes/Modules/Exports/Services/ExportsTransactions.php index 64a98a5a..7215e83a 100644 --- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php @@ -76,7 +76,7 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping } } - +dump($booking, $company); return [ $company->reference, $booking ? $booking->marking : '', From ea9ca284f202d104911eef5eec2b71a88bd0ee1f Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 10 May 2022 14:49:46 +0800 Subject: [PATCH 09/30] fix transaction export --- app/Classes/Modules/Exports/Services/ExportsTransactions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsTransactions.php b/app/Classes/Modules/Exports/Services/ExportsTransactions.php index 7215e83a..b79cef5d 100644 --- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php @@ -63,7 +63,7 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping $booking = $transaction->owner; $company = $booking->owner; - + dump($booking, $company); if(!($booking instanceof Booking)){ $booking = $transaction->owner->owner; @@ -76,7 +76,7 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping } } -dump($booking, $company); + return [ $company->reference, $booking ? $booking->marking : '', From 9e7216d545430af3e8526770f2276944480e5fe2 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 10 May 2022 14:50:37 +0800 Subject: [PATCH 10/30] fix transaction export --- .../Modules/Exports/Services/ExportsTransactions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsTransactions.php b/app/Classes/Modules/Exports/Services/ExportsTransactions.php index b79cef5d..c7a569ca 100644 --- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php @@ -62,8 +62,8 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping $booking = $transaction->owner; - $company = $booking->owner; - dump($booking, $company); + $company = $booking->company; + if(!($booking instanceof Booking)){ $booking = $transaction->owner->owner; @@ -72,7 +72,7 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping $company = $booking; $booking = null; } else { - $company = $booking->owner; + $company = $booking->company; } } From 6bbfa1b24f6c35020236709379704d12528a367d Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 10 May 2022 15:05:51 +0800 Subject: [PATCH 11/30] fix transaction export --- app/Classes/Modules/Exports/Services/ExportsTransactions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Classes/Modules/Exports/Services/ExportsTransactions.php b/app/Classes/Modules/Exports/Services/ExportsTransactions.php index c7a569ca..2e9508c6 100644 --- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php @@ -76,6 +76,7 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping } } + if((!($company instanceof Company) || !($booking instanceof Booking)) && $booking !== null ) dd($company, $booking); return [ $company->reference, From bb39831c9a63d1dcf9abc97c04f6be4ea07b8c62 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 10 May 2022 15:35:56 +0800 Subject: [PATCH 12/30] fix transaction export --- app/Classes/Modules/Exports/Services/ExportsTransactions.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Classes/Modules/Exports/Services/ExportsTransactions.php b/app/Classes/Modules/Exports/Services/ExportsTransactions.php index 2e9508c6..2d3c270a 100644 --- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php @@ -67,6 +67,9 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping if(!($booking instanceof Booking)){ $booking = $transaction->owner->owner; + if($booking instanceof Transaction){ + $booking = $booking->owner; + } if($booking instanceof Company){ $company = $booking; From 1e782e9e49845f1449346b0e197309c6282122c1 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 10 May 2022 15:48:48 +0800 Subject: [PATCH 13/30] fix transaction export --- .../Modules/Exports/Services/ExportsTransactions.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsTransactions.php b/app/Classes/Modules/Exports/Services/ExportsTransactions.php index 2d3c270a..581d6152 100644 --- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php @@ -62,8 +62,7 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping $booking = $transaction->owner; - $company = $booking->company; - + $company = ''; if(!($booking instanceof Booking)){ $booking = $transaction->owner->owner; @@ -77,6 +76,9 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping } else { $company = $booking->company; } + + } else { + $company = $booking->company; } if((!($company instanceof Company) || !($booking instanceof Booking)) && $booking !== null ) dd($company, $booking); From fb59937a8d715849c0b3505a7967edd6ba9bf4d2 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 10 May 2022 16:07:59 +0800 Subject: [PATCH 14/30] fix transaction export --- .../Exports/Services/ExportsTransactions.php | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsTransactions.php b/app/Classes/Modules/Exports/Services/ExportsTransactions.php index 581d6152..fef7a111 100644 --- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php @@ -25,7 +25,7 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping */ public function query() { - return Transaction::query(); + return Transaction::whereIn([TransactionType::PAYMENT, TransactionType::BILL]); } /** @@ -62,26 +62,11 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping $booking = $transaction->owner; - $company = ''; if(!($booking instanceof Booking)){ - $booking = $transaction->owner->owner; - - if($booking instanceof Transaction){ - $booking = $booking->owner; - } - - if($booking instanceof Company){ - $company = $booking; - $booking = null; - } else { - $company = $booking->company; - } - - } else { - $company = $booking->company; + $booking = $booking->owner; } - if((!($company instanceof Company) || !($booking instanceof Booking)) && $booking !== null ) dd($company, $booking); + $company = $booking->company; return [ $company->reference, From 71fde21bd5106d1d56a51f40886be75be3251113 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 10 May 2022 16:15:07 +0800 Subject: [PATCH 15/30] fix transaction 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 fef7a111..0fa7a515 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 $booking = $transaction->owner; if(!($booking instanceof Booking)){ + dump($booking); + $booking = $booking->owner; } From 28122890af6297de10ae8680684beb52717d25f2 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 10 May 2022 16:24:52 +0800 Subject: [PATCH 16/30] fix transaction export --- app/Classes/Modules/Exports/Services/ExportsTransactions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsTransactions.php b/app/Classes/Modules/Exports/Services/ExportsTransactions.php index 0fa7a515..b82c888f 100644 --- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php @@ -25,7 +25,7 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping */ public function query() { - return Transaction::whereIn([TransactionType::PAYMENT, TransactionType::BILL]); + return Transaction::whereIn('type', [TransactionType::PAYMENT, TransactionType::BILL]); } /** From bea34174baef229286d1f9057a1bd671641c7007 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 10 May 2022 16:25:04 +0800 Subject: [PATCH 17/30] fix transaction export --- app/Classes/Modules/Exports/Services/ExportsTransactions.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsTransactions.php b/app/Classes/Modules/Exports/Services/ExportsTransactions.php index b82c888f..66678ea2 100644 --- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php @@ -63,8 +63,6 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping $booking = $transaction->owner; if(!($booking instanceof Booking)){ - dump($booking); - $booking = $booking->owner; } From da7a259000b0ef3e271babeb970e5072853ab018 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 10 May 2022 16:28:12 +0800 Subject: [PATCH 18/30] fix transaction export --- app/Classes/Modules/Exports/Services/ExportsTransactions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsTransactions.php b/app/Classes/Modules/Exports/Services/ExportsTransactions.php index 66678ea2..0bb47ab6 100644 --- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php @@ -67,7 +67,7 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping } $company = $booking->company; - +dump($company); return [ $company->reference, $booking ? $booking->marking : '', From 2c4804a2a0b74716162afc3723d6cde0b67ff862 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 10 May 2022 16:36:34 +0800 Subject: [PATCH 19/30] fix transaction export --- app/Classes/Modules/Exports/Services/ExportsTransactions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsTransactions.php b/app/Classes/Modules/Exports/Services/ExportsTransactions.php index 0bb47ab6..66678ea2 100644 --- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php @@ -67,7 +67,7 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping } $company = $booking->company; -dump($company); + return [ $company->reference, $booking ? $booking->marking : '', From 2ff84186b8c4f7aa7650bca0c1b3220af1557170 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 10 May 2022 16:40:41 +0800 Subject: [PATCH 20/30] fix transaction 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 66678ea2..d5b45be7 100644 --- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php @@ -68,6 +68,8 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping $company = $booking->company; + if(!$company instanceof Company) dd($company); + return [ $company->reference, $booking ? $booking->marking : '', From 2bb93d97438893f06e28b78b4ea64239ba2dd84e Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 10 May 2022 18:59:53 +0800 Subject: [PATCH 21/30] fix transaction export --- app/Classes/Modules/Exports/Services/ExportsTransactions.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsTransactions.php b/app/Classes/Modules/Exports/Services/ExportsTransactions.php index d5b45be7..adef7293 100644 --- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php @@ -25,7 +25,7 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping */ public function query() { - return Transaction::whereIn('type', [TransactionType::PAYMENT, TransactionType::BILL]); + return Transaction::whereMonth('created_at', 4)->whereIn('type', [TransactionType::PAYMENT, TransactionType::BILL]); } /** @@ -68,8 +68,6 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping $company = $booking->company; - if(!$company instanceof Company) dd($company); - return [ $company->reference, $booking ? $booking->marking : '', From 0da50ebae6f4705909d9d0c7751b7d9182adb5e4 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 10 May 2022 19:00:46 +0800 Subject: [PATCH 22/30] fix transaction export --- app/Classes/Modules/Exports/Services/ExportsTransactions.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsTransactions.php b/app/Classes/Modules/Exports/Services/ExportsTransactions.php index adef7293..6092f6a6 100644 --- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php @@ -25,7 +25,7 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping */ public function query() { - return Transaction::whereMonth('created_at', 4)->whereIn('type', [TransactionType::PAYMENT, TransactionType::BILL]); + return Transaction::whereIn('type', [TransactionType::PAYMENT, TransactionType::BILL]); } /** @@ -68,6 +68,8 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping $company = $booking->company; + if(!$company instanceof Company) dd($transaction); + return [ $company->reference, $booking ? $booking->marking : '', From bb5a2b8259818082e1d82d2dd16060666d33321b Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 10 May 2022 19:06:52 +0800 Subject: [PATCH 23/30] fix transaction export --- app/Classes/Modules/Exports/Services/ExportsTransactions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsTransactions.php b/app/Classes/Modules/Exports/Services/ExportsTransactions.php index 6092f6a6..f660af96 100644 --- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php @@ -25,7 +25,7 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping */ public function query() { - return Transaction::whereIn('type', [TransactionType::PAYMENT, TransactionType::BILL]); + return Transaction::whereIn('type', [TransactionType::PAYMENT, TransactionType::BILL])->whereNot('owner_type', Wallet::class); } /** From 5fc2f76bc69587114c11d95978ea50ca67c248c0 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 10 May 2022 19:08:11 +0800 Subject: [PATCH 24/30] fix transaction export --- app/Classes/Modules/Exports/Services/ExportsTransactions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsTransactions.php b/app/Classes/Modules/Exports/Services/ExportsTransactions.php index f660af96..89a765e5 100644 --- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php @@ -25,7 +25,7 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping */ public function query() { - return Transaction::whereIn('type', [TransactionType::PAYMENT, TransactionType::BILL])->whereNot('owner_type', Wallet::class); + return Transaction::whereIn('type', [TransactionType::PAYMENT, TransactionType::BILL])->where('owner_type', '!=',Wallet::class); } /** From 60936ffadf84c2142c0875b1719330533889f2e9 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Wed, 11 May 2022 13:15:06 +0800 Subject: [PATCH 25/30] update po day limit notice --- .../bookings/forms/PurchaseOrderFormComponent.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/resources/assets/vue/components/bookings/forms/PurchaseOrderFormComponent.vue b/resources/assets/vue/components/bookings/forms/PurchaseOrderFormComponent.vue index cde4d84d..fdb07c35 100644 --- a/resources/assets/vue/components/bookings/forms/PurchaseOrderFormComponent.vue +++ b/resources/assets/vue/components/bookings/forms/PurchaseOrderFormComponent.vue @@ -7,7 +7,14 @@
2
Purchase Order
-

In order for us to process your order, you will need to provide us with your purchase order information.

+

In order for us to process your order, you will need to provide us with your purchase order information.

+
+
+
+
+
+

Any Purchase Orders that aren't submitted within 60 days will be closed for editing.

+
From 4b12ea3fc548c0cc275c2c0fecc3d78503f5ea5b Mon Sep 17 00:00:00 2001 From: omair saleh Date: Wed, 11 May 2022 13:25:54 +0800 Subject: [PATCH 26/30] update po day limit notice --- .../components/bookings/forms/PurchaseOrderFormComponent.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/assets/vue/components/bookings/forms/PurchaseOrderFormComponent.vue b/resources/assets/vue/components/bookings/forms/PurchaseOrderFormComponent.vue index fdb07c35..76a202a1 100644 --- a/resources/assets/vue/components/bookings/forms/PurchaseOrderFormComponent.vue +++ b/resources/assets/vue/components/bookings/forms/PurchaseOrderFormComponent.vue @@ -10,10 +10,10 @@

In order for us to process your order, you will need to provide us with your purchase order information.

-
+
-

Any Purchase Orders that aren't submitted within 60 days will be closed for editing.

+

Any Purchase Orders that aren't submitted within 60 days will be closed for editing.

From fe5756efc29d3fca09e71f392945045ff09c8b48 Mon Sep 17 00:00:00 2001 From: edmondlang Date: Sat, 14 May 2022 15:02:17 +0800 Subject: [PATCH 27/30] export billing analaytic data --- .../ExportsAnalyticBillingTransactions.php | 87 +++++++++++++++++++ .../ValueObjects/Constants/CompanyType.php | 5 ++ .../ExportAnalyticToExcelController.php | 7 ++ routes/web.php | 1 + 4 files changed, 100 insertions(+) create mode 100644 app/Classes/Modules/Exports/Services/ExportsAnalyticBillingTransactions.php diff --git a/app/Classes/Modules/Exports/Services/ExportsAnalyticBillingTransactions.php b/app/Classes/Modules/Exports/Services/ExportsAnalyticBillingTransactions.php new file mode 100644 index 00000000..11fafa15 --- /dev/null +++ b/app/Classes/Modules/Exports/Services/ExportsAnalyticBillingTransactions.php @@ -0,0 +1,87 @@ +request = $request; + } + + public function headings(): array + { + return [ + 'Booking Id', + 'Service Type', + 'Payment Method', + 'Company Id', + 'Customer Segment', + 'Company Create Date', + 'Company Type', + 'Supplier Id', + 'Customer Payment', + 'Customer Rate', + 'Customer Service Charge', + 'Customer Payment Date', + 'Original Amount', + 'Supplier Payment', + 'Supplier Rate', + 'Supplier Sevice Charge', + 'Supplier Payment Date' + ]; + } + + /** + * @return \Illuminate\Support\Collection|mixed + */ + public function query() + { + return Transaction::where('type', 3); + } + + /** + * @param $transaction + * @return array + */ + public function map($transaction): array + { + dd($transaction->owner->owner->company); + + $paymentmethondArray = PaymentMethodType::PAYMENT_METHODS_ID; + $paymentMethod = $paymentmethondArray[$transaction->payment_method]; + + $companyTypeArray = CompanyType::COMPANY_TYPE_ID; + $companyType = $companyTypeArray[$transaction->owner->owner->company->business_type]; + + return [ + $transaction->id, + $transaction->booking->service->name, + $paymentMethod, + $transaction->owner->owner->company->id, + $transaction->owner->owner->company->segments->first()->name, + $transaction->owner->owner->company->created_at, + + ]; + } +} \ No newline at end of file diff --git a/app/Classes/ValueObjects/Constants/CompanyType.php b/app/Classes/ValueObjects/Constants/CompanyType.php index 61918925..135aa700 100644 --- a/app/Classes/ValueObjects/Constants/CompanyType.php +++ b/app/Classes/ValueObjects/Constants/CompanyType.php @@ -8,4 +8,9 @@ final class CompanyType { public const COMPANY_BUSINESS = 1; + public const COMPANY_TYPE_ID = [ + self::PERSONAL_BUSINESS => 'PERSONAL_BUSINESS', + self::COMPANY_BUSINESS => 'COMPANY_BUSINESS', + ]; + } diff --git a/app/Http/Controllers/Exports/ExportAnalyticToExcelController.php b/app/Http/Controllers/Exports/ExportAnalyticToExcelController.php index 135e570d..2a93a991 100644 --- a/app/Http/Controllers/Exports/ExportAnalyticToExcelController.php +++ b/app/Http/Controllers/Exports/ExportAnalyticToExcelController.php @@ -4,6 +4,7 @@ namespace App\Http\Controllers\Exports; use App\Classes\Modules\Exports\Services\ExportsAnalyticBookingTransactions; +use App\Classes\Modules\Exports\Services\ExportsAnalyticBillingTransactions; use App\Models\User; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; @@ -27,4 +28,10 @@ class ExportAnalyticToExcelController ob_end_clean(); return $response; } + + public function billingData(ExportsAnalyticBillingTransactions $exportsAnalyticBillingTransactions, Request $request){ + $response = $exportsAnalyticBillingTransactions->download('billingData.csv', Excel::CSV, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']); + ob_end_clean(); + return $response; + } } \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 5628c585..50a64e90 100644 --- a/routes/web.php +++ b/routes/web.php @@ -97,6 +97,7 @@ Route::get('/online_payment/redirect', 'Billplz\CallbackBillplzController@callba Route::get('/export/customers/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@export'); Route::get('/export/transactions/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@transactions'); Route::get('/export/analytic/booking', 'Exports\ExportAnalyticToExcelController@bookingData'); +Route::get('/export/analytic/bills', 'Exports\ExportAnalyticToExcelController@billingData'); Route::get('/products', function (\App\Classes\Modules\Exports\Services\ExportsProducts $exportsProducts) { return $exportsProducts->download('products.csv', Excel::CSV, ['Content-Type' => 'text/csv']); From 29ab59bbf77eb9cfc95588b36ac85704798c42c1 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Sat, 14 May 2022 20:17:28 +0800 Subject: [PATCH 28/30] update export bill data --- .../ExportsAnalyticBillingTransactions.php | 52 ++++++++++--------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsAnalyticBillingTransactions.php b/app/Classes/Modules/Exports/Services/ExportsAnalyticBillingTransactions.php index 11fafa15..1798af4f 100644 --- a/app/Classes/Modules/Exports/Services/ExportsAnalyticBillingTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsAnalyticBillingTransactions.php @@ -2,23 +2,17 @@ namespace App\Classes\Modules\Exports\Services; -use App\Classes\General\Eloquent\Filters\ServiceType; -use App\Classes\ValueObjects\Constants\CompanyType; use App\Classes\ValueObjects\Constants\PaymentMethodType; -use App\Models\Booking; -use App\Models\Company; use App\Models\Transaction; use Maatwebsite\Excel\Concerns\Exportable; -use Maatwebsite\Excel\Concerns\FromQuery; +use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\WithHeadingRow; use Maatwebsite\Excel\Concerns\WithMapping; use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\ShouldAutoSize; use Illuminate\Http\Request; -use Illuminate\Support\Facades\DB; -use Carbon\Carbon; -class ExportsAnalyticBillingTransactions implements FromQuery, WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize +class ExportsAnalyticBillingTransactions implements FromCollection, WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize { use Exportable; @@ -47,7 +41,7 @@ class ExportsAnalyticBillingTransactions implements FromQuery, WithHeadings, Wit 'Original Amount', 'Supplier Payment', 'Supplier Rate', - 'Supplier Sevice Charge', + 'Supplier Service Charge', 'Supplier Payment Date' ]; } @@ -55,9 +49,9 @@ class ExportsAnalyticBillingTransactions implements FromQuery, WithHeadings, Wit /** * @return \Illuminate\Support\Collection|mixed */ - public function query() - { - return Transaction::where('type', 3); + public function collection() + { + return Transaction::where('type', 3)->get(); } /** @@ -66,22 +60,30 @@ class ExportsAnalyticBillingTransactions implements FromQuery, WithHeadings, Wit */ public function map($transaction): array { - dd($transaction->owner->owner->company); - - $paymentmethondArray = PaymentMethodType::PAYMENT_METHODS_ID; - $paymentMethod = $paymentmethondArray[$transaction->payment_method]; - $companyTypeArray = CompanyType::COMPANY_TYPE_ID; - $companyType = $companyTypeArray[$transaction->owner->owner->company->business_type]; + $bill = $transaction; + $payment = $transaction->owner; + $booking = $payment->owner; + $company = $booking->company; return [ - $transaction->id, - $transaction->booking->service->name, - $paymentMethod, - $transaction->owner->owner->company->id, - $transaction->owner->owner->company->segments->first()->name, - $transaction->owner->owner->company->created_at, - + $booking->id, + $booking->service->name, + PaymentMethodType::PAYMENT_METHODS_ID[$payment->payment_method], + $company->id, + $company->segments->implode('name', ', '), + $company->created_at, + $company->type === 0 ? 'Personal' : 'Company', + $bill->issuerCompany->name, + $payment->amount, + $payment->currency_rate, + $payment->service_charge, + $payment->created_at, + $payment->original_amount, + $bill->amount, + $bill->currency_rate, + $bill->service_charge, + $bill->created_at ]; } } \ No newline at end of file From f39601c5ef286e393d1fc5ca24e5e35fa012779d Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 17 May 2022 14:46:00 +0800 Subject: [PATCH 29/30] hide create order for lingesh --- .../bookings/forms/SupplierPlaceOrderFormComponent.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/assets/vue/components/bookings/forms/SupplierPlaceOrderFormComponent.vue b/resources/assets/vue/components/bookings/forms/SupplierPlaceOrderFormComponent.vue index 4ec71edd..c3b1a6de 100644 --- a/resources/assets/vue/components/bookings/forms/SupplierPlaceOrderFormComponent.vue +++ b/resources/assets/vue/components/bookings/forms/SupplierPlaceOrderFormComponent.vue @@ -47,7 +47,7 @@
- +
From 94cc136462f8e110947fc44f24c114fa6d2961dc Mon Sep 17 00:00:00 2001 From: omair saleh Date: Sat, 21 May 2022 13:48:06 +0800 Subject: [PATCH 30/30] add chromatic --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index ced333fa..5d4b92bf 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ }, "devDependencies": { "axios": "^0.21.0", + "chromatic": "^6.5.4", "cross-env": "^7.0.2", "del": "^6.0.0", "fancy-log": "^1.3.0",