Helpers for new zealand
This commit is contained in:
parent
d831ab64f2
commit
78256510c7
|
|
@ -84,6 +84,7 @@ class CreateCompany
|
||||||
'724' => $company = $this->spanishSetup($company),
|
'724' => $company = $this->spanishSetup($company),
|
||||||
'36' => $company = $this->australiaSetup($company),
|
'36' => $company = $this->australiaSetup($company),
|
||||||
'710' => $company = $this->southAfticaSetup($company),
|
'710' => $company = $this->southAfticaSetup($company),
|
||||||
|
'554' => $company = $this->newZealandSetup($company),
|
||||||
default => $company->save(),
|
default => $company->save(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -131,6 +132,22 @@ class CreateCompany
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function newZealandSetup($company): Company
|
||||||
|
{
|
||||||
|
|
||||||
|
$company->enabled_tax_rates = 1;
|
||||||
|
|
||||||
|
$settings = $company->settings;
|
||||||
|
$settings->currency_id = '15';
|
||||||
|
$settings->timezone_id = '113';
|
||||||
|
|
||||||
|
$company->settings = $settings;
|
||||||
|
|
||||||
|
$company->save();
|
||||||
|
|
||||||
|
return $company;
|
||||||
|
}
|
||||||
|
|
||||||
private function spanishSetup(Company $company): Company
|
private function spanishSetup(Company $company): Company
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,7 @@ class ExpenseRepository extends BaseRepository
|
||||||
$exchange_rate = new CurrencyApi();
|
$exchange_rate = new CurrencyApi();
|
||||||
|
|
||||||
$expense->exchange_rate = $exchange_rate->exchangeRate($expense_currency, $company_currency, Carbon::parse($expense->date));
|
$expense->exchange_rate = $exchange_rate->exchangeRate($expense_currency, $company_currency, Carbon::parse($expense->date));
|
||||||
|
$expense->invoice_currency_id = $company_currency;
|
||||||
|
|
||||||
return $expense;
|
return $expense;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,9 @@ class CompanyService
|
||||||
case '724': // Spain
|
case '724': // Spain
|
||||||
$taxes[] = ['name' => 'IVA', 'rate' => 21];
|
$taxes[] = ['name' => 'IVA', 'rate' => 21];
|
||||||
break;
|
break;
|
||||||
|
case '554': // New Zealand
|
||||||
|
$taxes[] = ['name' => 'GST', 'rate' => 15];
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue