This commit is contained in:
David Bomba 2024-04-11 18:10:11 +10:00
parent 608c59b543
commit 65660fdc42
4 changed files with 35 additions and 5 deletions

View File

@ -1 +1 @@
5.8.47 5.8.48

View File

@ -66,6 +66,35 @@ class BaseTransformer
} }
} }
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) public function getInvoiceTypeId($data, $field)
{ {
return isset($data[$field]) && $data[$field] ? (string)$data[$field] : '1'; return isset($data[$field]) && $data[$field] ? (string)$data[$field] : '1';
@ -641,7 +670,7 @@ class BaseTransformer
return $ec->id; 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->name = $name;
$ec->save(); $ec->save();

View File

@ -17,8 +17,8 @@ return [
'require_https' => env('REQUIRE_HTTPS', true), 'require_https' => env('REQUIRE_HTTPS', true),
'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_url' => rtrim(env('APP_URL', ''), '/'),
'app_domain' => env('APP_DOMAIN', 'invoicing.co'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
'app_version' => env('APP_VERSION', '5.8.47'), 'app_version' => env('APP_VERSION', '5.8.48'),
'app_tag' => env('APP_TAG', '5.8.47'), 'app_tag' => env('APP_TAG', '5.8.48'),
'minimum_client_version' => '5.0.16', 'minimum_client_version' => '5.0.16',
'terms_version' => '1.0.1', 'terms_version' => '1.0.1',
'api_secret' => env('API_SECRET', false), 'api_secret' => env('API_SECRET', false),

View File

@ -199,7 +199,7 @@ $lang = array(
'removed_logo' => 'Successfully removed logo', 'removed_logo' => 'Successfully removed logo',
'sent_message' => 'Successfully sent message', 'sent_message' => 'Successfully sent message',
'invoice_error' => 'Please make sure to select a client and correct any errors', '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.', 'payment_error' => 'There was an error processing your payment. Please try again later.',
'registration_required' => 'Registration Required', 'registration_required' => 'Registration Required',
'confirmation_required' => 'Please confirm your email address, :link to resend the confirmation email.', 'confirmation_required' => 'Please confirm your email address, :link to resend the confirmation email.',
@ -5292,6 +5292,7 @@ $lang = array(
'e_credit' => 'E-Credit', 'e_credit' => 'E-Credit',
'e_purchase_order' => 'E-Purchase Order', 'e_purchase_order' => 'E-Purchase Order',
'e_quote_type' => 'E-Quote Type', 'e_quote_type' => 'E-Quote Type',
'unlock_unlimited_clients' => 'Please upgrade to unlock unlimited clients!'
); );
return $lang; return $lang;