mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-22 05:53:58 +00:00
re categorize purchase order filters
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class DoesNotHavePurchaseOrderStatusIn implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->whereDoesntHave('transactions', function($transaction) use($value) {
|
||||
return $transaction->where('transactions.type', TransactionType::PURCHASE_ORDER)->whereIn('transactions.status', $value);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ class HasPurchaseOrderStatusIn implements Filter
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->whereHas('transactions', function($query) use($value) {
|
||||
return $query->where('transactions.type', TransactionType::PURCHASE_ORDER)->where('transactions.status', $value);
|
||||
return $query->where('transactions.type', TransactionType::PURCHASE_ORDER)->whereIn('transactions.status', $value);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<list-component key="2" section="poPendingApprovalSection" :endpoint="route('api.booking.list')" :options="{per_page: 10, purchase_order_approval: true, has_payment_status_in: [2, 3]}">
|
||||
<list-component key="2" section="poPendingApprovalSection" :endpoint="route('api.booking.list')" :options="{per_page: 10, purchase_order_approval: true}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<booking-component :data="data"></booking-component>
|
||||
</template>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<div class="row">
|
||||
<div class="col b-r b-white">
|
||||
<div class="row fs-12 text-center">
|
||||
<div class="col p-t-20 p-b-20 bg-master-lighter tabButton active" tab-name="all">
|
||||
<div class="col p-t-20 p-b-20 bg-master-lighter tabButton active" tab-name="no-submission">
|
||||
<div class="row justify-content-center m-b-5">
|
||||
<div class="col-auto">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
|
||||
@@ -22,7 +22,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="fs-12 m-t-5 all-caps">All</div>
|
||||
<div class="fs-12 m-t-5 all-caps">No Submission</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -30,7 +30,7 @@
|
||||
</div>
|
||||
<div class="col b-r b-white">
|
||||
<div class="row fs-12 text-center">
|
||||
<div class="col p-t-20 p-b-20 bg-master-lighter tabButton" tab-name="pending-submission">
|
||||
<div class="col p-t-20 p-b-20 bg-master-lighter tabButton" tab-name="incomplete-submission">
|
||||
<div class="row justify-content-center m-b-5">
|
||||
<div class="col-auto">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
|
||||
@@ -41,7 +41,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="fs-12 m-t-5 all-caps">Pending Submission</div>
|
||||
<div class="fs-12 m-t-5 all-caps">In-complete Submission</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -92,22 +92,22 @@
|
||||
</div>
|
||||
<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="all">
|
||||
<list-component key="2" section="all" :endpoint="route('api.booking.list')" :options="{per_page: 10, ServiceId: 4, status_in:[2,3], has_payment_status_in: [2, 3]}">
|
||||
<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,3], does_not_have_purchase_order_status_in: [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="pending-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], does_not_have_transaction_type: 7}">
|
||||
<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]}">
|
||||
<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: [2, 3], has_purchase_order_status_in: [0, 1]}">
|
||||
<list-component key="2" section="poPendingReviewSection" :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: [1]}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<booking-component :data="data"></booking-component>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user