1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 12:42:36 +01:00

Merge pull request #5212 from turbo124/master

Add missing defaults
This commit is contained in:
David Bomba 2021-03-22 21:05:25 +11:00 committed by GitHub
commit d08b6e874f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 0 deletions

View File

@ -98,11 +98,40 @@ info("get company");
];
}
/**
* define('TOKEN_BILLING_DISABLED', 1);
* define('TOKEN_BILLING_OPT_IN', 2);
* define('TOKEN_BILLING_OPT_OUT', 3);
* define('TOKEN_BILLING_ALWAYS', 4);
*
* off,always,optin,optout
*/
private function transformAutoBill($token_billing_id)
{
switch ($token_billing_id) {
case TOKEN_BILLING_DISABLED:
return 'off';
case TOKEN_BILLING_OPT_IN:
return 'optin';
case TOKEN_BILLING_OPT_OUT:
return 'optout';
case TOKEN_BILLING_ALWAYS:
return 'always';
default:
return 'off';
}
}
public function getCompanySettings()
{
info("get co settings");
return [
'auto_bill' => $this->transformAutoBill($this->account->token_billing_id),
'payment_terms' => $this->account->payment_terms ? (string) $this->account->payment_terms : '',
'timezone_id' => $this->account->timezone_id ? (string) $this->account->timezone_id : '15',
'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',

View File

@ -4199,6 +4199,7 @@ $LANG = array(
'disable_two_factor' => 'Disable Two Factor',
'invoice_task_datelog' => 'Invoice Task Datelog',
'invoice_task_datelog_help' => 'Add date details to the invoice line items',
'promo_code' => 'Promo code',
);
return $LANG;