From f825ae1ec563c98bc34a33f9178e0da19b66f16b Mon Sep 17 00:00:00 2001 From: edmondlang Date: Wed, 15 Feb 2023 11:54:38 +0800 Subject: [PATCH 01/11] fix bug - upload payment proof at booking page --- .../components/bookings/elements/PaymentHistoryComponent.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue b/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue index b87ac20e..cbe96c4f 100644 --- a/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue +++ b/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue @@ -219,7 +219,7 @@ -
+
From 57b6f19092e60189f469e9b334ac8f64573ecfbf Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Wed, 15 Feb 2023 15:27:55 +0800 Subject: [PATCH 02/11] update customer's account --- app/Http/Resources/BookingResource.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Http/Resources/BookingResource.php b/app/Http/Resources/BookingResource.php index 015a86ee..5e392be3 100644 --- a/app/Http/Resources/BookingResource.php +++ b/app/Http/Resources/BookingResource.php @@ -11,6 +11,7 @@ use App\Classes\ValueObjects\Constants\TransactionType; use App\Classes\ValueObjects\Constants\DocumentType; use Carbon\Carbon; use Illuminate\Http\Resources\Json\JsonResource; +use Illuminate\Support\Facades\Log; class BookingResource extends JsonResource { @@ -24,6 +25,7 @@ class BookingResource extends JsonResource */ public function toArray($request) { + Log::info($this); return [ 'id' => $this->id, 'company' => new CompanyResource($this->company), From f885ccc9e0fecff0e516e8cd48941dd6a6af4e24 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Wed, 15 Feb 2023 15:29:50 +0800 Subject: [PATCH 03/11] update customer's account --- app/Http/Resources/BookingResource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Resources/BookingResource.php b/app/Http/Resources/BookingResource.php index 5e392be3..1f8399bf 100644 --- a/app/Http/Resources/BookingResource.php +++ b/app/Http/Resources/BookingResource.php @@ -25,7 +25,7 @@ class BookingResource extends JsonResource */ public function toArray($request) { - Log::info($this); + Log::info(json_encode($this)); return [ 'id' => $this->id, 'company' => new CompanyResource($this->company), From 1359b929822e6b1c9ea1b0cf842b720b629b83be Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Wed, 15 Feb 2023 15:32:55 +0800 Subject: [PATCH 04/11] update customer's account --- app/Http/Resources/BookingResource.php | 1 - app/Http/Resources/WalletTransactionResource.php | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Resources/BookingResource.php b/app/Http/Resources/BookingResource.php index 1f8399bf..f3a7881d 100644 --- a/app/Http/Resources/BookingResource.php +++ b/app/Http/Resources/BookingResource.php @@ -25,7 +25,6 @@ class BookingResource extends JsonResource */ public function toArray($request) { - Log::info(json_encode($this)); return [ 'id' => $this->id, 'company' => new CompanyResource($this->company), diff --git a/app/Http/Resources/WalletTransactionResource.php b/app/Http/Resources/WalletTransactionResource.php index cfc8ab10..a2b28a34 100644 --- a/app/Http/Resources/WalletTransactionResource.php +++ b/app/Http/Resources/WalletTransactionResource.php @@ -7,6 +7,7 @@ use App\Classes\ValueObjects\Constants\TransactionType; use App\Models\Transaction; use Carbon\Carbon; use Illuminate\Http\Resources\Json\JsonResource; +use Illuminate\Support\Facades\Log; class WalletTransactionResource extends JsonResource { @@ -27,6 +28,7 @@ class WalletTransactionResource extends JsonResource $description = 'Credit Voucher for '.$this->payment_reference; break; case 1: + Log::info($marking = Transaction::where('payment_reference', $this->bill_no)->first()); $marking = Transaction::where('payment_reference', $this->bill_no)->first()->owner->marking; $description = 'Payment For booking refs.'.''.$marking.''; break; From a33584961a27df1c9880e7be7724dc2a7826ef0b Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Wed, 15 Feb 2023 15:36:46 +0800 Subject: [PATCH 05/11] update customer's account --- app/Http/Resources/WalletTransactionResource.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Resources/WalletTransactionResource.php b/app/Http/Resources/WalletTransactionResource.php index a2b28a34..a498392a 100644 --- a/app/Http/Resources/WalletTransactionResource.php +++ b/app/Http/Resources/WalletTransactionResource.php @@ -28,7 +28,8 @@ class WalletTransactionResource extends JsonResource $description = 'Credit Voucher for '.$this->payment_reference; break; case 1: - Log::info($marking = Transaction::where('payment_reference', $this->bill_no)->first()); + $booking = Transaction::where('payment_reference', $this->bill_no)->first()->owner; + if (!$booking) Log::info(Transaction::where('payment_reference', $this->bill_no)->first()); $marking = Transaction::where('payment_reference', $this->bill_no)->first()->owner->marking; $description = 'Payment For booking refs.'.''.$marking.''; break; From e70fa3d5c28e01ab43b3815f6bd053bd2f3dc681 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Wed, 15 Feb 2023 15:40:59 +0800 Subject: [PATCH 06/11] update customer's account --- app/Http/Resources/WalletTransactionResource.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Resources/WalletTransactionResource.php b/app/Http/Resources/WalletTransactionResource.php index a498392a..ba4dab81 100644 --- a/app/Http/Resources/WalletTransactionResource.php +++ b/app/Http/Resources/WalletTransactionResource.php @@ -29,8 +29,8 @@ class WalletTransactionResource extends JsonResource break; case 1: $booking = Transaction::where('payment_reference', $this->bill_no)->first()->owner; - if (!$booking) Log::info(Transaction::where('payment_reference', $this->bill_no)->first()); - $marking = Transaction::where('payment_reference', $this->bill_no)->first()->owner->marking; + $marking = $booking ? $booking->marking : null; + $description = 'Payment For booking refs.'.''.$marking.''; break; case 11: From 51a19629e2e35601e341500b80548459dbd3e059 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Wed, 15 Feb 2023 15:42:47 +0800 Subject: [PATCH 07/11] update customer's account --- app/Http/Resources/WalletTransactionResource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Resources/WalletTransactionResource.php b/app/Http/Resources/WalletTransactionResource.php index ba4dab81..fe112f9d 100644 --- a/app/Http/Resources/WalletTransactionResource.php +++ b/app/Http/Resources/WalletTransactionResource.php @@ -31,7 +31,7 @@ class WalletTransactionResource extends JsonResource $booking = Transaction::where('payment_reference', $this->bill_no)->first()->owner; $marking = $booking ? $booking->marking : null; - $description = 'Payment For booking refs.'.''.$marking.''; + $description = 'Payment For booking refs.'. $booking ? ''.$marking.'' : 'Please ask Tech Support'; break; case 11: $description = 'Debit Voucher for '.$this->payment_reference; From 30fe0d29e04c846f98163e19c6ee9e6be8674abd Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Wed, 15 Feb 2023 15:43:37 +0800 Subject: [PATCH 08/11] update customer's account --- app/Http/Resources/WalletTransactionResource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Resources/WalletTransactionResource.php b/app/Http/Resources/WalletTransactionResource.php index fe112f9d..95db6492 100644 --- a/app/Http/Resources/WalletTransactionResource.php +++ b/app/Http/Resources/WalletTransactionResource.php @@ -31,7 +31,7 @@ class WalletTransactionResource extends JsonResource $booking = Transaction::where('payment_reference', $this->bill_no)->first()->owner; $marking = $booking ? $booking->marking : null; - $description = 'Payment For booking refs.'. $booking ? ''.$marking.'' : 'Please ask Tech Support'; + $description = 'Payment For booking refs.'. $marking ? ''.$marking.'' : 'Please ask Tech Support'; break; case 11: $description = 'Debit Voucher for '.$this->payment_reference; From fa4e16a7211df6e1f9dd85508bf82b93a1d6b9a7 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Wed, 15 Feb 2023 15:46:01 +0800 Subject: [PATCH 09/11] update customer's account --- app/Http/Resources/WalletTransactionResource.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Http/Resources/WalletTransactionResource.php b/app/Http/Resources/WalletTransactionResource.php index 95db6492..53f18364 100644 --- a/app/Http/Resources/WalletTransactionResource.php +++ b/app/Http/Resources/WalletTransactionResource.php @@ -29,9 +29,14 @@ class WalletTransactionResource extends JsonResource break; case 1: $booking = Transaction::where('payment_reference', $this->bill_no)->first()->owner; - $marking = $booking ? $booking->marking : null; - $description = 'Payment For booking refs.'. $marking ? ''.$marking.'' : 'Please ask Tech Support'; + if(!$booking) { + $description = 'Payment for unknown booking, please contact tech support.'; + break; + } + + $marking = $booking->marking; + $description = 'Payment For booking refs.'.''.$marking.''; break; case 11: $description = 'Debit Voucher for '.$this->payment_reference; From 61c02c0806872478cc34a37b0929564a8a5e9281 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Wed, 15 Feb 2023 16:05:11 +0800 Subject: [PATCH 10/11] update customer's account --- routes/web.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/routes/web.php b/routes/web.php index 411a0e71..702e98ac 100644 --- a/routes/web.php +++ b/routes/web.php @@ -457,18 +457,18 @@ Route::get('/1688/fix/{reference}', function($reference){ Route::get('/po/manual/fix', function(){ - $bookings = Booking::whereIn('company_id', [199, 510])->whereHas('documents', function($query){ - return $query->where('document_type', DocumentType::ECOMMERCE_PURCHASE_ORDER); - })->get(); - - foreach ($bookings as $booking){ - $booking->status = ApprovalStatus::APPROVED; - $booking->save(); - - $booking->documents()->whereIn('document_type', [DocumentType::PURCHASE_ORDER, DocumentType::DELIVER_ORDER, DocumentType::INVOICE, DocumentType::SUPPLIER_DELIVER_ORDER])->delete(); - $booking->transactions()->where('type', TransactionType::PURCHASE_ORDER)->update(['status' => ApprovalStatus::PENDING_SUBMISSION]); - - } +// $bookings = Booking::whereIn('company_id', [199, 510])->whereHas('documents', function($query){ +// return $query->where('document_type', DocumentType::ECOMMERCE_PURCHASE_ORDER); +// })->get(); +// +// foreach ($bookings as $booking){ +// $booking->status = ApprovalStatus::APPROVED; +// $booking->save(); +// +// $booking->documents()->whereIn('document_type', [DocumentType::PURCHASE_ORDER, DocumentType::DELIVER_ORDER, DocumentType::INVOICE, DocumentType::SUPPLIER_DELIVER_ORDER])->delete(); +// $booking->transactions()->where('type', TransactionType::PURCHASE_ORDER)->update(['status' => ApprovalStatus::PENDING_SUBMISSION]); +// +// } })->name('ecommerce.fix'); From 1d8c4c3ffffec1ec7e9fce17f1791d0d11e6e903 Mon Sep 17 00:00:00 2001 From: edmondlang Date: Wed, 15 Feb 2023 22:57:07 +0800 Subject: [PATCH 11/11] delete payment proof --- .../bookings/elements/PaymentHistoryComponent.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue b/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue index cbe96c4f..702745c7 100644 --- a/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue +++ b/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue @@ -200,6 +200,14 @@
+
+
+ +
+ + + +