From 65660fdc420a1b75a2392366f9f2762b2157e111 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 11 Apr 2024 18:10:11 +1000 Subject: [PATCH] v5.8.48 --- VERSION.txt | 2 +- app/Import/Transformer/BaseTransformer.php | 31 +++++++++++++++++++++- config/ninja.php | 4 +-- lang/en/texts.php | 3 ++- 4 files changed, 35 insertions(+), 5 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index bf55a892b987..ad7756863525 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.8.47 \ No newline at end of file +5.8.48 \ No newline at end of file diff --git a/app/Import/Transformer/BaseTransformer.php b/app/Import/Transformer/BaseTransformer.php index 81d38ba75e75..f7cad871c3bb 100644 --- a/app/Import/Transformer/BaseTransformer.php +++ b/app/Import/Transformer/BaseTransformer.php @@ -65,6 +65,35 @@ class BaseTransformer return $parsed_date; } } + + public function parseDateOrNull($data, $field) + { + $date = &$data[$field]; + + if(!$date || strlen($date) <= 1) { + return null; + } + + if(stripos($date, "/") !== false && $this->company->settings->country_id != 840) { + $date = str_replace('/', '-', $date); + } + + try { + $parsed_date = Carbon::parse($date); + + return $parsed_date->format('Y-m-d'); + } catch(\Exception $e) { + $parsed_date = date('Y-m-d', strtotime($date)); + + if ($parsed_date == '1970-01-01') { + return now()->format('Y-m-d'); + } + + return $parsed_date; + } + + + } public function getInvoiceTypeId($data, $field) { @@ -641,7 +670,7 @@ class BaseTransformer return $ec->id; } - $ec = \App\Factory\ExpenseCategoryFactory::create($this->company->id, $this->company->owner()->id); + $ec = ExpenseCategoryFactory::create($this->company->id, $this->company->owner()->id); $ec->name = $name; $ec->save(); diff --git a/config/ninja.php b/config/ninja.php index 7b000ad84eed..3b4cd01e68f7 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -17,8 +17,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => env('APP_VERSION', '5.8.47'), - 'app_tag' => env('APP_TAG', '5.8.47'), + 'app_version' => env('APP_VERSION', '5.8.48'), + 'app_tag' => env('APP_TAG', '5.8.48'), 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', false), diff --git a/lang/en/texts.php b/lang/en/texts.php index e6819133dfff..aa52b2655d9c 100644 --- a/lang/en/texts.php +++ b/lang/en/texts.php @@ -199,7 +199,7 @@ $lang = array( 'removed_logo' => 'Successfully removed logo', 'sent_message' => 'Successfully sent message', 'invoice_error' => 'Please make sure to select a client and correct any errors', - 'limit_clients' => 'Sorry, this will exceed the limit of :count clients. Please upgrade to a paid plan.', + 'limit_clients' => 'You\'ve hit the :count client limit on Free accounts. Congrats on your success!.', 'payment_error' => 'There was an error processing your payment. Please try again later.', 'registration_required' => 'Registration Required', 'confirmation_required' => 'Please confirm your email address, :link to resend the confirmation email.', @@ -5292,6 +5292,7 @@ $lang = array( 'e_credit' => 'E-Credit', 'e_purchase_order' => 'E-Purchase Order', 'e_quote_type' => 'E-Quote Type', + 'unlock_unlimited_clients' => 'Please upgrade to unlock unlimited clients!' ); return $lang;