mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for financial year start
This commit is contained in:
parent
391df15a96
commit
1324394256
@ -71,11 +71,21 @@ trait GenerateMigrationResources
|
|||||||
|
|
||||||
protected function getCompany()
|
protected function getCompany()
|
||||||
{
|
{
|
||||||
info("get company");
|
info("get company");
|
||||||
|
|
||||||
|
$financial_year_start = null;
|
||||||
|
if($this->account->financial_year_start)
|
||||||
|
{
|
||||||
|
//2000-02-01 format
|
||||||
|
$exploded_date = explode("-", $this->account->financial_year_start);
|
||||||
|
|
||||||
|
$financial_year_start = (int)$exploded_date[1];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'first_day_of_week' => $this->account->start_of_week,
|
'first_day_of_week' => $this->account->start_of_week,
|
||||||
'first_month_of_year' => $this->account->financial_year_start,
|
'first_month_of_year' => $financial_year_start,
|
||||||
'version' => NINJA_VERSION,
|
'version' => NINJA_VERSION,
|
||||||
'referral_code' => $this->account->referral_code ?: '',
|
'referral_code' => $this->account->referral_code ?: '',
|
||||||
'account_id' => $this->account->id,
|
'account_id' => $this->account->id,
|
||||||
@ -130,10 +140,15 @@ info("get company");
|
|||||||
{
|
{
|
||||||
info("get co settings");
|
info("get co settings");
|
||||||
|
|
||||||
|
$timezone_id = $this->account->timezone_id ? $this->account->timezone_id : 15;
|
||||||
|
|
||||||
|
if($timezone_id > 57)
|
||||||
|
$timezone_id = (string)($timezone_id - 1);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'auto_bill' => $this->transformAutoBill($this->account->token_billing_id),
|
'auto_bill' => $this->transformAutoBill($this->account->token_billing_id),
|
||||||
'payment_terms' => $this->account->payment_terms ? (string) $this->account->payment_terms : '',
|
'payment_terms' => $this->account->payment_terms ? (string) $this->account->payment_terms : '',
|
||||||
'timezone_id' => $this->account->timezone_id ? (string) $this->account->timezone_id : '15',
|
'timezone_id' => $timezone_id,
|
||||||
'date_format_id' => $this->account->date_format_id ? (string) $this->account->date_format_id : '1',
|
'date_format_id' => $this->account->date_format_id ? (string) $this->account->date_format_id : '1',
|
||||||
'currency_id' => $this->account->currency_id ? (string) $this->account->currency_id : '1',
|
'currency_id' => $this->account->currency_id ? (string) $this->account->currency_id : '1',
|
||||||
'name' => $this->account->name ?: trans('texts.untitled'),
|
'name' => $this->account->name ?: trans('texts.untitled'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user