Merge remote-tracking branch 'origin/master'

This commit is contained in:
Omair Saleh
2022-11-15 19:55:19 +08:00
4 changed files with 27 additions and 7 deletions
@@ -0,0 +1,20 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use Illuminate\Database\Eloquent\Builder;
class CompanyIdNotIn implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return Builder|mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->whereNotIn('company_id', $value);
}
}
@@ -129,7 +129,7 @@ class CreateBookingPaymentLogic extends AbstractControllerLogic
/** @var Wallet $wallet */
$wallet = $booking->company->wallets()->first();
if(round($wallet->amount) < round($amount, 2)){
if((float) number_format(($wallet->amount - $amount),2) < 0){
throw new MalformedRequestException('Insufficient wallet balance. Please Top up your wallet.');
}
@@ -161,4 +161,4 @@ class CreateBookingPaymentLogic extends AbstractControllerLogic
}
}
}
@@ -93,28 +93,28 @@
<div class="row no-margin">
<div class="col bg-white padding-25">
<div class="row tabsContainer tabContent m-l-0 m-r-0" tab-name="no-submission">
<list-component key="2" section="all" :endpoint="route('api.booking.list')" :options="{per_page: 10, ServiceId: 4, status_in:[2], has_payment_status_in: [1, 2, 3], does_not_have_purchase_order_status_in: [0, 1, 2, 3]}">
<list-component key="2" section="all" :endpoint="route('api.booking.list')" :options="{per_page: 10, ServiceId: 4, status_in:[2], company_id_not_in: [199, 510], has_payment_status_in: [1, 2, 3], does_not_have_purchase_order_status_in: [0, 1, 2, 3]}">
<template slot="list" slot-scope="{data}">
<booking-component :data="data"></booking-component>
</template>
</list-component>
</div>
<div class="row tabsContainer tabContent m-l-0 m-r-0 hide" tab-name="incomplete-submission">
<list-component key="2" section="poPendingSubmissionSection" :endpoint="route('api.booking.list')" :options="{per_page: 10, ServiceId: 4, status_in:[2], has_payment_status_in: [2, 3], has_purchase_order_status_in: [0]}">
<list-component key="2" section="poPendingSubmissionSection" :endpoint="route('api.booking.list')" :options="{per_page: 10, ServiceId: 4, status_in:[2], company_id_not_in: [199, 510], has_payment_status_in: [2, 3], has_purchase_order_status_in: [0]}">
<template slot="list" slot-scope="{data}">
<booking-component :data="data"></booking-component>
</template>
</list-component>
</div>
<div class="row tabsContainer tabContent m-l-0 m-r-0 hide" tab-name="pending-review">
<list-component key="2" section="poPendingReviewSection" :endpoint="route('api.booking.list')" :options="{per_page: 10, ServiceId: 4, status_in:[2], has_payment_status_in: [1, 2, 3], has_purchase_order_status_in: [1]}">
<list-component key="2" section="poPendingReviewSection" :endpoint="route('api.booking.list')" :options="{per_page: 10, ServiceId: 4, status_in:[2], company_id_not_in: [199, 510], has_payment_status_in: [1, 2, 3], has_purchase_order_status_in: [1]}">
<template slot="list" slot-scope="{data}">
<booking-component :data="data"></booking-component>
</template>
</list-component>
</div>
<div class="row tabsContainer tabContent m-l-0 m-r-0 hide" tab-name="approved">
<list-component key="2" section="poApprovedSection" :endpoint="route('api.booking.list')" :options="{per_page: 10, ServiceId: 4, status_in:[3], has_purchase_order_status_in: [2]}">
<list-component key="2" section="poApprovedSection" :endpoint="route('api.booking.list')" :options="{per_page: 10, ServiceId: 4, status_in:[3], company_id_not_in: [199, 510], has_purchase_order_status_in: [2]}">
<template slot="list" slot-scope="{data}">
<booking-component :data="data"></booking-component>
</template>
+1 -1
View File
@@ -349,7 +349,7 @@ Route::get('/wallet/audit', function (Request $request) {
if((int) $transaction->type === TransactionType::PAYMENT) $payments += (float) $transaction->amount;
if((int) $transaction->type === TransactionType::DEBIT_NOTE) $debit += (float) $transaction->amount;
}
if(round((float) $wallet->amount - (($topups + $credit) - ($payments + $debit)), 2) == 0) continue;
if((round((float) $wallet->amount - (($topups + $credit) - ($payments + $debit)), 2) == 0) AND $wallet->amount > -0.01) continue;
$i++;