mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-19 04:23:59 +00:00
fix payment due date days filter
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
@@ -17,7 +18,7 @@ class PaymentDay implements Filter
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->whereHas('transactions', function (Builder $query) use($value) {
|
||||
$query->where('transactions.type', 1)->whereRaw("DATEDIFF(NOW(), transactions.updated_at) <= $value");
|
||||
$query->where('transactions.type', 1)->where('status', ApprovalStatus::APPROVED)->whereDate('updated_at', '<=', Carbon::now()->subdays($value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
fetchPaymentList(){
|
||||
|
||||
this.$store.dispatch('reloadList', {name: this.section});
|
||||
this.$store.dispatch('updateListQueue', {name: this.section, page:1, filters: {per_page:5, group_by: 'DATE(transactions.updated_at)', has_invoice_status_in:[2], payment_day:this.parameters.due, credit_term:this.parameters.segment }});
|
||||
this.$store.dispatch('updateListQueue', {name: this.section, page:1, filters: {per_page:5, has_invoice_status_in:[2], payment_day:this.parameters.due, credit_term:this.parameters.segment }});
|
||||
|
||||
//this.$store.dispatch('toggleSection', {name: this.section, status: true});
|
||||
//this.$store.dispatch('updateListQueue', {name: this.section, page:1, filters: {per_page:5, group_by: 'transactions.id', payment_day:this.due,has_invoice_status_in:[2] /*,credit_term:[0.0]*/ }});
|
||||
|
||||
Reference in New Issue
Block a user