diff --git a/app/Http/Resources/TransactionResource.php b/app/Http/Resources/TransactionResource.php index f8620f05..595ce443 100644 --- a/app/Http/Resources/TransactionResource.php +++ b/app/Http/Resources/TransactionResource.php @@ -23,11 +23,11 @@ class TransactionResource extends JsonResource $bank = null; if(in_array((int)$this->type, [TransactionType::BILL, TransactionType::REFUND, TransactionType::SUPPLIER_REFUND])){ $booking = $this->owner->owner; - $bank = $this->owner->bank; + $bank = $this->owner->bank ?? $booking->bank; } else{ $booking = $this->owner; - $bank = $this->bank; + $bank = $this->bank ?? $booking->bank; } $days = $this->created_at->endOfDay()->addWeekdays($booking->service_id === 3 ? 3 : 1); diff --git a/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue b/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue index cbbb60c4..3e026cbb 100644 --- a/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue +++ b/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue @@ -33,6 +33,12 @@
{{ item.status === 2 ? 'Received' : item.status === 4 ? 'Rejected' : 'Submitted'}} On: {{item.updated_at}}
+
+
+
Payment Method: {{ convertPaymentMethod(item.payment_method) }}
+
Payment Date: {{ item.created_at }}
+
+
Bill Number: {{ item.bill_no }}
@@ -470,6 +476,15 @@ trackShipment(){ window.open(route('booking.track_shipping_order', this.data.booking.marking) + '?token=' + this.$store.getters.getAccessToken, '_blank'); }, + convertPaymentMethod(paymentMethod){ + var paymentMethodArray = []; + paymentMethodArray[1] = 'Cash'; + paymentMethodArray[2] = 'Cheque'; + paymentMethodArray[3] = 'ba'; + paymentMethodArray[4] = 'Wallet'; + paymentMethodArray[5] = 'Payment Gateway'; + return paymentMethodArray[paymentMethod]; + }, }, mixins: [componentHandler] } diff --git a/routes/web.php b/routes/web.php index f02efac6..e2317150 100644 --- a/routes/web.php +++ b/routes/web.php @@ -407,9 +407,25 @@ Route::get('/pending_orders', function(){ }) ->orderBy('updated_at', 'desc') ->get(); - - echo ''; + echo '
'; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo ''; $i = 0; foreach ($payments as $payment){ $booking = $payment->owner; @@ -429,15 +445,13 @@ Route::get('/pending_orders', function(){ echo ''; echo ''; - echo ''; echo ''; + echo ''; echo ''; echo ''; echo ''; - echo ''; echo ''; echo ''; - echo ''; echo ''; echo ''; echo '';
Client Booking DatePayment TypeMarkingCustomer Payment CurrencyCustomer Payment AmountReference No.Booking Amount CurrencyCNYServiceDaysCust Supplier Acc TypeCust Supplier Acc Name
'.$payment->updated_at->format('d-M-y').''.$booking->marking.''.\App\Classes\ValueObjects\Constants\PaymentMethodType::PAYMENT_METHODS_ID[$payment->payment_method].''.$booking->marking.''.$payment->currency->short_code.''.number_format(bcsub($payment->amount, $refunds, 7), 5, '.', '').''.$booking->company->reference.''.$payment->original_currency->short_code.''.number_format(bcsub($payment->original_amount, $original_refunds, 7), 5, '.', '').''.$booking->service->name.''.$payment->updated_at->diffForHumans().''.$bankType.'