fixing the unknown tab to list the transactions of is_mapped false and also mapped and status in rejected

This commit is contained in:
Steve Ng
2023-10-25 18:03:31 +08:00
parent bc5a8a9193
commit 910f190075
2 changed files with 26 additions and 1 deletions
@@ -0,0 +1,25 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use Illuminate\Database\Eloquent\Builder;
class IsMappedFalseOrMappedButStatusIn implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return Builder|mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->where(function($q) use ($value) {
$q->whereDoesntHave('owners');
$q->orwhereHas('owners', function($query) use ($value) {
$query->whereIn('status', $value);
});
});
}
}
@@ -311,7 +311,7 @@ export default {
this.filter = {min_amount: 0, is_mapped: true, is_mapped_with_multiple: true, statement_transaction_owner_type_in: [1, 2], statement_transaction_owner_status_in: [1], per_page: 100, order_by: {column: 'posting_date', DESC: true}}
break;
case 3:
this.filter = {min_amount: 0, is_mapped: false, per_page: 100, order_by: {column: 'posting_date', DESC: true}}
this.filter = {min_amount: 0, is_mapped_false_or_mapped_but_status_in: [4], per_page: 100, order_by: {column: 'posting_date', DESC: true}}
break;
case 4:
this.filter = {min_amount: 0, is_mapped: true, statement_transaction_owner_type_in: [1, 2], statement_transaction_owner_status_in: [2], per_page: 100, order_by: {column: 'posting_date', DESC: true}}