diff --git a/app/Classes/General/Eloquent/Filters/CompanyIdNotIn.php b/app/Classes/General/Eloquent/Filters/CompanyIdNotIn.php new file mode 100644 index 00000000..bde6e0ea --- /dev/null +++ b/app/Classes/General/Eloquent/Filters/CompanyIdNotIn.php @@ -0,0 +1,20 @@ +whereNotIn('company_id', $value); + } + +} diff --git a/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingPaymentLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingPaymentLogic.php index d4ba9807..1140ecd9 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingPaymentLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingPaymentLogic.php @@ -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 } -} \ No newline at end of file +} diff --git a/resources/views/pages/purchase_orders.blade.php b/resources/views/pages/purchase_orders.blade.php index c8786537..c3783022 100644 --- a/resources/views/pages/purchase_orders.blade.php +++ b/resources/views/pages/purchase_orders.blade.php @@ -93,28 +93,28 @@
- +
- +
- +
- + diff --git a/routes/web.php b/routes/web.php index 38a61cec..a8ad44ba 100644 --- a/routes/web.php +++ b/routes/web.php @@ -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++;