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

This commit is contained in:
azumiru
2022-03-06 13:55:10 +08:00
11 changed files with 30 additions and 10 deletions
@@ -0,0 +1,20 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use Illuminate\Database\Eloquent\Builder;
class PaymentMethodNotIn implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return Builder|mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->whereNotIn('payment_method', $value);
}
}
@@ -121,7 +121,7 @@ class CreateBookingPaymentLogic extends AbstractControllerLogic
/** @var Wallet $wallet */
$wallet = $booking->company->wallets()->first();
if($wallet->amount < $amount){
if($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)->addDays($booking->service_id === 1 ? 1 : 2);
$days = Carbon::parse($this->created_at->format('d-m-Y'))->addDays($booking->service_id === 1 ? 2 : 3);
return [
'id' => $this->id,
@@ -42,7 +42,7 @@
<div class="font-heading fs-10 muted all-caps">Payable Amount</div>
<div class="font-heading text-success bold">{{this.item.amount}} {{this.item.fixed_currency.short_code}}</div>
</div>
<div class="col-auto" v-if="$store.getters.isCustomer">
<div class="col-auto hide" v-if="$store.getters.isCustomer">
<div class="font-heading fs-10 muted all-caps">status</div>
<div class="font-heading all-caps text-master btn-rounded p-l-10 p-r-10 lh-15 mt-1" :class="[{'bg-warning': item.status !== 3}, {'bg-success': item.status === 3} ]">
{{item.status === 3 ? 'Complete' : 'In Progress'}}
@@ -4,7 +4,7 @@
<p>{{item.documents ? item.documents.created_at : item.updated_at}}</p>
</td>
<td class="v-align-middle ">
<p v-if="item.booking.bank.bank_name.includes('浙江网商银行')">1688.com</p>
<p v-if="item.booking.bank.bank_name.includes('浙江网商银行')">1688.com, </p>{{item.interval.value}} {{item.interval.duration}} days
</td>
<td class="v-align-middle ">
<p>{{item.booking.marking}}</p>
@@ -529,7 +529,7 @@
computed: {
walletOutstanding(){
let walletBalance = this.data.company.wallet ? this.data.company.wallet.amount : 0;
return walletBalance - this.calculation.total;
return (walletBalance - this.calculation.total).toFixed(2);
}
},
methods: {
@@ -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, 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], service_type_id_in: [selectedService.id]}">
<template slot="list" slot-scope="{data}">
<supplier-pending-order-component :data="data" v-on:input="updateOrder($event)"></supplier-pending-order-component>
</template>
@@ -47,7 +47,7 @@
},
methods: {
fetchList(Page = 1){
this.submit(route('api.transaction.list') + '?page='+ Page +'&filters=' + JSON.stringify({status: 2, type: 1, per_page: 50, order_by: {
this.submit(route('api.transaction.list') + '?page='+ Page +'&filters=' + JSON.stringify({status: 2, type: 1, owner_type: 'App\\Models\\Booking', per_page: 50, order_by: {
column: 'created_at',
DESC: true
}}), 'get', 'urgentListSection', false, true)
@@ -10,7 +10,7 @@
<div class="col text-center">
<div class="row m-b-50">
<div class="col bg-white padding-15">
<h5 class="text-center text-success bold">Congratulation! You've earned and achievement</h5>
<h5 class="text-center text-success bold">Congratulation! You've earned an achievement</h5>
</div>
</div>
<div class="row justify-content-center">
@@ -119,7 +119,7 @@
parameters: {
amount: {
required,
minValue: minValue(this.minValue),
minValue: 0,
},
reference: {
required: requiredIf(function () { return this.parameters.transaction_type !== 0 })
+1 -1
View File
@@ -11,7 +11,7 @@
</div>
<div class="row">
<div class="col">
<list-component key="2" section="paymentVerificationSection" :endpoint="route('api.transaction.list')" :options="{'type': 1, 'status': 3}">
<list-component key="2" section="paymentVerificationSection" :endpoint="route('api.transaction.list')" :options="{'type': 1, 'status': 3, 'payment_method_not_in': [4]}">
<template slot="list" slot-scope="{data}">
<payment-verification-component section="paymentVerificationSection" :data="data" :no_action="true"></payment-verification-component>
</template>