mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 12:12:48 +01:00
Helpers for new zealand
This commit is contained in:
parent
d831ab64f2
commit
78256510c7
@ -84,6 +84,7 @@ class CreateCompany
|
||||
'724' => $company = $this->spanishSetup($company),
|
||||
'36' => $company = $this->australiaSetup($company),
|
||||
'710' => $company = $this->southAfticaSetup($company),
|
||||
'554' => $company = $this->newZealandSetup($company),
|
||||
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
|
||||
{
|
||||
try {
|
||||
|
@ -121,7 +121,8 @@ class ExpenseRepository extends BaseRepository
|
||||
$exchange_rate = new CurrencyApi();
|
||||
|
||||
$expense->exchange_rate = $exchange_rate->exchangeRate($expense_currency, $company_currency, Carbon::parse($expense->date));
|
||||
|
||||
$expense->invoice_currency_id = $company_currency;
|
||||
|
||||
return $expense;
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,10 @@ class CompanyService
|
||||
case '724': // Spain
|
||||
$taxes[] = ['name' => 'IVA', 'rate' => 21];
|
||||
break;
|
||||
|
||||
case '554': // New Zealand
|
||||
$taxes[] = ['name' => 'GST', 'rate' => 15];
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user