Compare commits

...

3 Commits

Author SHA1 Message Date
edmondlang 864bbc70b6 update invoice search function 2023-02-21 23:40:02 +08:00
edmondlang c439bb5d61 invoice search function 2023-02-21 23:31:20 +08:00
edmondlang 82b99a40cf update admin payments billing section component 2023-02-21 19:57:08 +08:00
4 changed files with 95 additions and 21 deletions
@@ -0,0 +1,21 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use App\Models\Order;
use Illuminate\Database\Eloquent\Builder;
class OrderMarkingIn implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->whereHas('owner', function($query) use ($value) {
$query->where('reference', 'LIKE', '%' . $value . '%');
});
}
}
@@ -120,7 +120,7 @@
<modal-component class="animate__animated animate__fast animate__fadeIn" size="extra-large" styleType="fill-in" type="editBillingAddress">
<div class="row">
<div class="col bg-white">
<address-form-component :data="item.order.company_module.billingAddress" section="editBillingAddress"></address-form-component>
<address-form-component :id="item.order.company_module.id" :data="item.order.company_module.billingAddress" section="editBillingAddress"></address-form-component>
</div>
</div>
</modal-component>
@@ -0,0 +1,69 @@
<template>
<div class="row">
<div class="col">
<div class="row m-b-15">
<div class="col-md-6 col-7 p-r-0">
<div class="row">
<div class="col p-r-0">
<div class="form-group no-margin form-group-default b-rad-none">
<label class="text-primary">Order Number Like</label>
<input type="text" class="form-control" v-model="marking" />
</div>
</div>
</div>
</div>
<div class="col-auto p-l-0 p-r-0">
<div class="btn btn-primary b-rad-none" @click="search">
<i class="fa fa-search lh-40"></i>
</div>
</div>
<div class="col-auto p-l-0">
<div class="btn btn-secondary b-rad-none" @click="reset">
<i class="fa fa-remove lh-40"></i>
</div>
</div>
</div>
<list-component :key="currentKey" :section="section" :endpoint="route('api.packing_list.list')" :options="options">
<template slot="list" slot-scope="{data}">
<admin-payments-billing-component :data="data" :invoice_status="invoice_status" :section="section" ></admin-payments-billing-component>
</template>
</list-component>
</div>
</div>
</template>
<script>
export default {
props: {
invoice_status: {
type: String,
required: true
},
options: {
default () {
return {}
}
},
section:{
type: String,
required: true
}
},
data(){
return {
marking: '',
currentKey: 1,
}
},
methods: {
search() {
this.options['order_marking_in'] = this.marking;
this.currentKey+=1;
},
reset() {
this.marking = '';
delete(this.options['order_marking_in']);
this.currentKey+=1;
},
},
}
</script>
@@ -102,30 +102,18 @@
<div class="col bg-master-lightest p-1 p-sm-4">
<div class="row tabsContainer tabContent" tab-name="pendingInvoice">
<div class="col">
<list-component section="pendingInvoiceSection" :endpoint="route('api.packing_list.list')" :options="{does_not_have_transaction_type: 1, type: 2}">
<template slot="list" slot-scope="{data}">
<admin-payments-billing-component :data="data" invoice_status="Pending Invoice" section="pendingInvoiceSection" ></admin-payments-billing-component>
</template>
</list-component>
<admin-payments-billing-with-search-component :options="{does_not_have_transaction_type: 1, type: 2}" section="pendingInvoiceSection" invoice_status="Pending Invoice"></admin-payments-billing-with-search-component>
</div>
</div>
<div class="row tabsContainer tabContent hide" tab-name="pendingApproval">
<div class="col">
<list-component section="pendingApprovalSection" :endpoint="route('api.packing_list.list')" :options="{has_invoice_status_in: [0, 1]}">
<template slot="list" slot-scope="{data}">
<admin-payments-billing-component :data="data" invoice_status="Pending Approval" section="pendingApprovalSection" ></admin-payments-billing-component>
</template>
</list-component>
<admin-payments-billing-with-search-component :options="{has_invoice_status_in: [0, 1]}" section="pendingApprovalSection" invoice_status="Pending Approval"></admin-payments-billing-with-search-component>
</div>
</div>
<div class="row tabsContainer tabContent hide" tab-name="pendingPayment">
<div class="col">
<payment-filter-component :endpoint="route('api.packing_list.list')" :data="data"></payment-filter-component>
<list-component section="pendingPaymentSection" :endpoint="route('api.packing_list.list')" :options="{has_invoice_status_in: [2], packing_list_ordered_by_invoice_date: true}">
<template slot="list" slot-scope="{data}">
<admin-payments-billing-component :data="data" invoice_status="Pending Payment" section="pendingPaymentSection" ></admin-payments-billing-component>
</template>
</list-component>
<admin-payments-billing-with-search-component :options="{has_invoice_status_in: [2], packing_list_ordered_by_invoice_date: true}" section="pendingPaymentSection" invoice_status="Pending Payment"></admin-payments-billing-with-search-component>
</div>
</div>
<div class="row tabsContainer tabContent hide" tab-name="paidInvoice">
@@ -135,11 +123,7 @@
<download-billing-with-dates-component section="paymentsReportSection" ></download-billing-with-dates-component>
</div>
</div>
<list-component section="paidInvoiceSection" :endpoint="route('api.packing_list.list')" :options="{has_invoice_status_in: [3]}">
<template slot="list" slot-scope="{data}">
<admin-payments-billing-component :data="data" invoice_status="Paid Invoice" section="paidInvoiceSection" ></admin-payments-billing-component>
</template>
</list-component>
<admin-payments-billing-with-search-component :options="{has_invoice_status_in: [3]}" section="paidInvoiceSection" invoice_status="Paid Invoice"></admin-payments-billing-with-search-component>
</div>
</div>
</div>