Merge branch 'development' of gitlab.com:CIEFWorldwideSdnBhd/exchange-2.0 into refund-ui-tab

This commit is contained in:
edmondlang
2022-03-10 22:19:58 +08:00
5 changed files with 5 additions and 5 deletions
@@ -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);
@@ -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.');
}
+1 -1
View File
@@ -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,
@@ -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
}
},
@@ -114,7 +114,7 @@
</div>
<div class="row">
<div class="col">
<list-component ref="pendingOrdersList" section="pendingOrdersSection" :endpoint="route('api.transaction.list')" :options="{per_page: 10000, status: 2, owner_type: 'App\\Models\\Booking', type: 1, original_currency_id_in: [selectedCurrency.id], service_type_id_in: [selectedService.id]}">
<list-component ref="pendingOrdersList" section="pendingOrdersSection" :endpoint="route('api.transaction.list')" :options="{per_page: 10000, status: 2, owner_type: 'App\\Models\\Booking', type: 1, original_currency_id_in: [selectedCurrency.id], transaction_service_id: selectedService.id}">
<template slot="list" slot-scope="{data}">
<supplier-pending-order-component :data="data" v-on:input="updateOrder($event)"></supplier-pending-order-component>
</template>