mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 02:44:29 -04:00
Fixes for tax calculations
This commit is contained in:
parent
b52204c616
commit
3e46aad567
@ -217,9 +217,11 @@ class BaseRule implements RuleInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
$this->tax_rate1 = $this->client->company->tax_data->regions->{$this->client_region}->subregions->{$this->client_subregion}->tax_rate;
|
||||
$this->tax_name1 = $this->client->company->tax_data->regions->{$this->client_region}->subregions->{$this->client_subregion}->tax_name;
|
||||
|
||||
if(isset($this->client->company->tax_data->regions->{$this->client_region}->subregions->{$this->client_subregion})) {
|
||||
$this->tax_rate1 = $this->client->company->tax_data->regions->{$this->client_region}->subregions->{$this->client_subregion}->tax_rate;
|
||||
$this->tax_name1 = $this->client->company->tax_data->regions->{$this->client_region}->subregions->{$this->client_subregion}->tax_name;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,6 @@ class InvoiceItemSum
|
||||
{
|
||||
if (!$this->invoice->line_items || !is_array($this->invoice->line_items)) {
|
||||
$this->items = [];
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -146,7 +145,8 @@ class InvoiceItemSum
|
||||
}
|
||||
|
||||
//should we be filtering by client country here? do we need to reflect at the company <=> client level?
|
||||
if (in_array($this->client->country->iso_3166_2, $this->tax_jurisdictions)) { //only calculate for supported tax jurisdictions
|
||||
// if (in_array($this->client->country->iso_3166_2, $this->tax_jurisdictions)) { //only calculate for supported tax jurisdictions
|
||||
if (in_array($this->client->company->country()->iso_3166_2, $this->tax_jurisdictions)) { //only calculate for supported tax jurisdictions
|
||||
|
||||
$class = "App\DataMapper\Tax\\".$this->client->company->country()->iso_3166_2."\\Rule";
|
||||
|
||||
@ -216,7 +216,12 @@ class InvoiceItemSum
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* calcTaxes
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
private function calcTaxes()
|
||||
{
|
||||
if ($this->calc_tax) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user