From d911c24421b8191001b75882caae56eba4a89d0a Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 20 Mar 2021 13:47:35 +1100 Subject: [PATCH 1/2] Update texts --- resources/lang/en/texts.php | 1 + 1 file changed, 1 insertion(+) 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; From 65cf2752a64abfd3ed382ec344f586bd1e99fbb2 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 22 Mar 2021 21:05:00 +1100 Subject: [PATCH 2/2] Add missing defaults --- app/Traits/GenerateMigrationResources.php | 29 +++++++++++++++++++++++ 1 file changed, 29 insertions(+) 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',