diff --git a/app/Traits/GenerateMigrationResources.php b/app/Traits/GenerateMigrationResources.php index a0b966b3e785..df9cbff6681d 100644 --- a/app/Traits/GenerateMigrationResources.php +++ b/app/Traits/GenerateMigrationResources.php @@ -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', diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index d841ee51ece6..06a296e0945c 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -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;