Fixes for tax calculations

This commit is contained in:
David Bomba 2023-06-29 13:57:16 +10:00
parent 7c695a8de2
commit eb44584fe8
2 changed files with 7 additions and 4 deletions

View File

@ -117,6 +117,9 @@ class Rule extends BaseRule implements RuleInterface
if(in_array($this->tax_data?->txbService,['Y','L'])) { if(in_array($this->tax_data?->txbService,['Y','L'])) {
$this->default($item); $this->default($item);
} }
else {
$this->taxExempt($item);
}
return $this; return $this;
} }

View File

@ -120,10 +120,10 @@ class ExpenseFilters extends QueryFilters
$search_key = $split[0] == 'client' ? 'client_id' : 'project_id'; $search_key = $split[0] == 'client' ? 'client_id' : 'project_id';
return $this->builder->whereNotNull('invoice_id') return $this->builder->whereHas('invoice', function ($query) use ($search_key, $split){
->whereHas('invoice', function ($query) use ($search_key, $split){ $query->where($search_key, $this->decodePrimaryKey($split[1]))
$query->where($search_key, $this->decodePrimaryKey($split[1])); ->whereIn('status_id', [\App\Models\Invoice::STATUS_DRAFT, \App\Models\Invoice::STATUS_SENT, \App\Models\Invoice::STATUS_PARTIAL]);
}); });
} }
return $this->builder; return $this->builder;