diff --git a/app/Classes/Modules/Bookings/ControllersLogic/AutoPurchaseOrderFillLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/AutoPurchaseOrderFillLogic.php index 161b57f5..6ed08994 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/AutoPurchaseOrderFillLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/AutoPurchaseOrderFillLogic.php @@ -64,7 +64,7 @@ class AutoPurchaseOrderFillLogic extends AbstractControllerLogic */ public function logic(Request $request) : JsonResponse { - $bookings = Booking::whereMonth('created_at', 8) + $bookings = Booking::whereMonth('created_at', 9) ->whereYear('created_at', 2021) ->whereDoesntHave('transactions', function($q){ $q->where('type', TransactionType::PURCHASE_ORDER); diff --git a/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingPaymentLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingPaymentLogic.php index 87e6866f..ecb6a87c 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingPaymentLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingPaymentLogic.php @@ -121,7 +121,7 @@ class CreateBookingPaymentLogic extends AbstractControllerLogic /** @var Wallet $wallet */ $wallet = $booking->company->wallets()->first(); - if($wallet->amount < round($amount, 2)){ + if(round($wallet->amount) < round($amount, 2)){ throw new MalformedRequestException('Insufficient wallet balance. Please Top up your wallet.'); } diff --git a/app/Http/Resources/TransactionResource.php b/app/Http/Resources/TransactionResource.php index 26b1590f..58f17072 100644 --- a/app/Http/Resources/TransactionResource.php +++ b/app/Http/Resources/TransactionResource.php @@ -17,7 +17,7 @@ class TransactionResource extends JsonResource public function toArray($request) { $booking = (int)$this->type === TransactionType::BILL ? $this->owner->owner : $this->booking; - $days = Carbon::parse($this->created_at->format('d-m-Y'))->addWeekdays($booking->service_id === 1 ? 2 : 3); + $days = $this->updated_at->endOfDay()->addWeekdays($booking->service_id === 1 ? 1 : 3); return [ 'id' => $this->id, diff --git a/resources/assets/vue/components/bookings/elements/BillingComponent.vue b/resources/assets/vue/components/bookings/elements/BillingComponent.vue index 6e03c040..83a2cb78 100644 --- a/resources/assets/vue/components/bookings/elements/BillingComponent.vue +++ b/resources/assets/vue/components/bookings/elements/BillingComponent.vue @@ -77,7 +77,7 @@ export default { endDate: '', type: 'INVOICE', }, - documents: ['INVOICE', 'PURCHASE_ORDER', 'DELIVERY_ORDER', 'SUPPLIER_DELIVERY_ORDER'], + documents: ['INVOICE', 'PURCHASE_ORDER', 'DELIVER_ORDER', 'SUPPLIER_DELIVER_ORDER'], selectedDocumentStatus: false } }, diff --git a/resources/assets/vue/components/bookings/sections/SupplierPendingOrdersSectionComponent.vue b/resources/assets/vue/components/bookings/sections/SupplierPendingOrdersSectionComponent.vue index 897ab360..07b1eda0 100644 --- a/resources/assets/vue/components/bookings/sections/SupplierPendingOrdersSectionComponent.vue +++ b/resources/assets/vue/components/bookings/sections/SupplierPendingOrdersSectionComponent.vue @@ -114,7 +114,7 @@
- +