mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
list companies without confirmed payments
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class WithOutTransactions implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->whereDoesntHave('transactions');
|
||||
}
|
||||
}
|
||||
@@ -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 WithoutConfirmedPayments implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->whereDoesntHave('transactions', function($transaction){
|
||||
return $transaction->where('transactions.type', TransactionType::PAYMENT)->whereIn('transactions.status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED]);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,9 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Support\Collection;
|
||||
use Staudenmeir\EloquentHasManyDeep\HasManyDeep;
|
||||
use Staudenmeir\EloquentHasManyDeep\HasRelationships;
|
||||
|
||||
|
||||
/**
|
||||
* Class Company
|
||||
@@ -27,6 +30,7 @@ use Illuminate\Support\Collection;
|
||||
*/
|
||||
class Company extends AbstractModel implements Documentable
|
||||
{
|
||||
use HasRelationships;
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'companies';
|
||||
@@ -90,6 +94,14 @@ class Company extends AbstractModel implements Documentable
|
||||
return $this->HasMany(Booking::class, 'company_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return hasManyDeep
|
||||
*/
|
||||
public function transactions(): hasManyDeep
|
||||
{
|
||||
return $this->hasManyDeep(Transaction::class, [Booking::class], ['company_id', 'booking_id'], ['id', 'id']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Builder
|
||||
*/
|
||||
|
||||
+3
-2
@@ -11,6 +11,7 @@
|
||||
"php": "^7.2.5",
|
||||
"ext-fileinfo": "*",
|
||||
"ext-json": "^1.6",
|
||||
"ext-zip": "*",
|
||||
"barryvdh/laravel-dompdf": "^0.9.0",
|
||||
"carlos-meneses/laravel-mpdf": "^2.1",
|
||||
"fideloper/proxy": "^4.2",
|
||||
@@ -23,8 +24,8 @@
|
||||
"rinvex/countries": "^6.1",
|
||||
"spatie/laravel-activitylog": "^3.14",
|
||||
"spatie/laravel-permission": "^3.17",
|
||||
"tymon/jwt-auth": "^1.0",
|
||||
"ext-zip": "*"
|
||||
"staudenmeir/eloquent-has-many-deep": "^1.7",
|
||||
"tymon/jwt-auth": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"facade/ignition": "^2.0",
|
||||
|
||||
@@ -522,7 +522,7 @@
|
||||
<div class="row justify-content-end">
|
||||
<div class="col">
|
||||
<div class="row fs-12 text-center">
|
||||
<div class="col p-t-20 p-b-20 bg-master-lighter tabButton active">
|
||||
<div class="col p-t-20 p-b-20 bg-master-lighter tabButton active" tab-name="customer-list">
|
||||
<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"
|
||||
@@ -539,6 +539,25 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="row fs-12 text-center">
|
||||
<div class="col p-t-20 p-b-20 bg-master-lighter tabButton" tab-name="customer-leads">
|
||||
<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"
|
||||
width="35" height="35"
|
||||
viewBox="0 0 172 172"
|
||||
style=" fill:#000000;"><defs><linearGradient x1="99.4375" y1="60.46875" x2="99.4375" y2="79.9585" gradientUnits="userSpaceOnUse" id="color-1_44007_gr1"><stop offset="0" stop-color="#4ec9ff"></stop><stop offset="1" stop-color="#2bffe6"></stop></linearGradient><linearGradient x1="72.5625" y1="60.46875" x2="72.5625" y2="79.9585" gradientUnits="userSpaceOnUse" id="color-2_44007_gr2"><stop offset="0" stop-color="#4ec9ff"></stop><stop offset="1" stop-color="#2bffe6"></stop></linearGradient><linearGradient x1="86" y1="16.125" x2="86" y2="157.44988" gradientUnits="userSpaceOnUse" id="color-3_44007_gr3"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient><linearGradient x1="72.69688" y1="16.125" x2="72.69688" y2="157.44988" gradientUnits="userSpaceOnUse" id="color-4_44007_gr4"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient></defs><g fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M0,172v-172h172v172z" fill="none"></path><g><path d="M99.4375,61.8125c-4.4528,0 -8.0625,3.6097 -8.0625,8.0625c0,4.4528 3.6097,8.0625 8.0625,8.0625c4.4528,0 8.0625,-3.6097 8.0625,-8.0625c0,-4.4528 -3.6097,-8.0625 -8.0625,-8.0625z" fill="url(#color-1_44007_gr1)"></path><path d="M72.5625,61.8125c-4.4528,0 -8.0625,3.6097 -8.0625,8.0625c0,4.4528 3.6097,8.0625 8.0625,8.0625c4.4528,0 8.0625,-3.6097 8.0625,-8.0625c0,-4.4528 -3.6097,-8.0625 -8.0625,-8.0625z" fill="url(#color-2_44007_gr2)"></path><path d="M121.14981,92.23769c3.27606,-5.8265 5.16269,-12.52912 5.16269,-19.67519v-16.125c0,-22.22831 -18.08419,-40.3125 -40.3125,-40.3125c-22.22831,0 -40.3125,18.08419 -40.3125,40.3125v16.125c0,7.14606 1.88931,13.84869 5.16269,19.67519c-15.03387,11.13969 -23.97519,28.76163 -23.97519,47.51231v16.125h118.25v-16.125c0,-18.75069 -8.944,-36.37262 -23.97519,-47.51231zM51.0625,56.4375c0,-19.264 15.6735,-34.9375 34.9375,-34.9375c19.264,0 34.9375,15.6735 34.9375,34.9375v16.125c0,19.264 -15.6735,34.9375 -34.9375,34.9375c-19.264,0 -34.9375,-15.6735 -34.9375,-34.9375zM86,112.875c13.158,0 24.82444,-6.364 32.18819,-16.14381c1.45931,1.09381 2.8595,2.24944 4.18712,3.47225c-8.729,11.46756 -21.96763,18.04656 -36.37531,18.04656c-14.35125,0 -27.74844,-6.69725 -36.378,-18.04387c1.33031,-1.2255 2.7305,-2.38112 4.18981,-3.47494c7.36375,9.77981 19.03288,16.14381 32.18819,16.14381zM139.75,150.5h-13.4375v-5.375h-5.375v5.375h-69.875v-5.375h-5.375v5.375h-13.4375v-10.75c0,-13.28431 4.93425,-25.94781 13.57725,-35.69c9.6535,12.31144 24.39444,19.565 40.17275,19.565c15.8455,0 30.41713,-7.12725 40.17006,-19.56769c8.64569,9.7395 13.57994,22.40569 13.57994,35.69269z" fill="url(#color-3_44007_gr3)"></path><path d="M86,32.25v-5.375c-11.24719,0 -21.69081,6.54138 -26.60625,16.65981l4.83481,2.34887c4.085,-8.40919 12.427,-13.63369 21.77144,-13.63369z" fill="url(#color-4_44007_gr4)"></path></g></g></svg>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="fs-12 m-t-5 all-caps">Leads</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -547,6 +566,13 @@
|
||||
<div class="row tabsContainer tabContent" tab-name="customer-list" v-if="$store.getters.isAdmin">
|
||||
<company-quick-view-section-component></company-quick-view-section-component>
|
||||
</div>
|
||||
<div class="row tabsContainer tabContent" tab-name="customer-leads" v-if="$store.getters.isAdmin">
|
||||
<list-component key="2" :section="this.section" :endpoint="route('api.company.list')" :options="{'business_type': 2, with_bookings:true, Without_confirmed_payments: true}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<company-list-component :data="data"></company-list-component>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user