Fixes for quote queries

This commit is contained in:
David Bomba 2023-01-16 07:54:49 +11:00
parent 3da4c42f71
commit f8a9220531
3 changed files with 4 additions and 12 deletions

View File

@ -87,6 +87,7 @@ class QuoteFilters extends QueryFilters
if (in_array('expired', $status_parameters)) { if (in_array('expired', $status_parameters)) {
$this->builder->orWhere(function ($query){ $this->builder->orWhere(function ($query){
$query->where('status_id', Quote::STATUS_SENT) $query->where('status_id', Quote::STATUS_SENT)
->company()
->whereNotNull('due_date') ->whereNotNull('due_date')
->where('due_date', '<=', now()->toDateString()); ->where('due_date', '<=', now()->toDateString());
}); });
@ -95,6 +96,7 @@ class QuoteFilters extends QueryFilters
if (in_array('upcoming', $status_parameters)) { if (in_array('upcoming', $status_parameters)) {
$this->builder->orWhere(function ($query){ $this->builder->orWhere(function ($query){
$query->where('status_id', Quote::STATUS_SENT) $query->where('status_id', Quote::STATUS_SENT)
->company()
->where('due_date', '>=', now()->toDateString()) ->where('due_date', '>=', now()->toDateString())
->orderBy('due_date', 'DESC'); ->orderBy('due_date', 'DESC');
}); });

View File

@ -90,9 +90,7 @@ trait Utilities
nlog("checkout failure"); nlog("checkout failure");
nlog($_payment); nlog($_payment);
if (is_array($_payment) && array_key_exists('actions', $_payment) && array_key_exists('response_summary', end($_payment['actions']))) { if (is_array($_payment) && array_key_exists('status', $_payment)) {
$error_message = end($_payment['actions'])['response_summary'];
} elseif (is_array($_payment) && array_key_exists('status', $_payment)) {
$error_message = $_payment['status']; $error_message = $_payment['status'];
} }
else { else {

View File

@ -34,15 +34,7 @@ class BankMatchingService implements ShouldQueue, ShouldBeUnique
{ {
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
protected $company_id; public function __construct(public $company_id, public $db){}
protected $db;
public function __construct($company_id, $db)
{
$this->company_id = $company_id;
$this->db = $db;
}
public function handle() :void public function handle() :void
{ {