From 1ebff701fdb370bd743547b8ddf1e8e0605b45dc Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 7 Sep 2021 17:27:23 +1000 Subject: [PATCH 1/6] Fixes for eager loading --- app/Http/Controllers/BaseController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/BaseController.php b/app/Http/Controllers/BaseController.php index 14e0caa6fc..f1005e13ab 100644 --- a/app/Http/Controllers/BaseController.php +++ b/app/Http/Controllers/BaseController.php @@ -301,7 +301,7 @@ class BaseController extends Controller }, 'company.recurring_invoices'=> function ($query) use ($updated_at, $user) { - $query->where('updated_at', '>=', $updated_at)->with('invitations', 'documents', 'client.gateway_tokens', 'client.group_settings'); + $query->where('updated_at', '>=', $updated_at)->with('invitations', 'documents', 'client.gateway_tokens', 'client.group_settings', 'company'); if(!$user->hasPermission('view_recurring_invoice')) $query->where('recurring_invoices.user_id', $user->id)->orWhere('recurring_invoices.assigned_user_id', $user->id); @@ -534,7 +534,7 @@ class BaseController extends Controller }, 'company.recurring_invoices'=> function ($query) use ($created_at, $user) { - $query->where('created_at', '>=', $created_at)->with('invitations', 'documents'); + $query->where('created_at', '>=', $created_at)->with('invitations', 'documents', 'client.gateway_tokens', 'client.group_settings', 'company'); if(!$user->hasPermission('view_recurring_invoice')) $query->where('recurring_invoices.user_id', $user->id)->orWhere('recurring_invoices.assigned_user_id', $user->id); From ddc85d6f081db9164b4d0c19f238e0fc179706e9 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 7 Sep 2021 17:36:57 +1000 Subject: [PATCH 2/6] Minor fixes for hosted migrations --- app/Http/Controllers/BaseController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/BaseController.php b/app/Http/Controllers/BaseController.php index f1005e13ab..30c72da5a9 100644 --- a/app/Http/Controllers/BaseController.php +++ b/app/Http/Controllers/BaseController.php @@ -301,7 +301,7 @@ class BaseController extends Controller }, 'company.recurring_invoices'=> function ($query) use ($updated_at, $user) { - $query->where('updated_at', '>=', $updated_at)->with('invitations', 'documents', 'client.gateway_tokens', 'client.group_settings', 'company'); + $query->where('updated_at', '>=', $updated_at)->with('invitations', 'documents', 'client.gateway_tokens', 'client.group_settings', 'client.company'); if(!$user->hasPermission('view_recurring_invoice')) $query->where('recurring_invoices.user_id', $user->id)->orWhere('recurring_invoices.assigned_user_id', $user->id); @@ -534,7 +534,7 @@ class BaseController extends Controller }, 'company.recurring_invoices'=> function ($query) use ($created_at, $user) { - $query->where('created_at', '>=', $created_at)->with('invitations', 'documents', 'client.gateway_tokens', 'client.group_settings', 'company'); + $query->where('created_at', '>=', $created_at)->with('invitations', 'documents', 'client.gateway_tokens', 'client.group_settings', 'client.company'); if(!$user->hasPermission('view_recurring_invoice')) $query->where('recurring_invoices.user_id', $user->id)->orWhere('recurring_invoices.assigned_user_id', $user->id); From 671bb2808b880a080a0a2e072792e2763414e786 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 7 Sep 2021 17:46:23 +1000 Subject: [PATCH 3/6] Minor fixes for recurring invoice loading --- app/Transformers/RecurringInvoiceTransformer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Transformers/RecurringInvoiceTransformer.php b/app/Transformers/RecurringInvoiceTransformer.php index cb6f9223a0..19df457d5f 100644 --- a/app/Transformers/RecurringInvoiceTransformer.php +++ b/app/Transformers/RecurringInvoiceTransformer.php @@ -150,7 +150,8 @@ class RecurringInvoiceTransformer extends EntityTransformer 'entity_type' => 'recurringInvoice', 'frequency_id' => (string) $invoice->frequency_id, 'remaining_cycles' => (int) $invoice->remaining_cycles, - 'recurring_dates' => (array) $invoice->recurringDates(), + //'recurring_dates' => (array) $invoice->recurringDates(), + 'recurring_dates' => [], 'auto_bill' => (string) $invoice->auto_bill, 'auto_bill_enabled' => (bool) $invoice->auto_bill_enabled, 'due_date_days' => (string) $invoice->due_date_days ?: '', From 57602952e9b89ede3bcd77b103f4da094e3a4ef4 Mon Sep 17 00:00:00 2001 From: = Date: Tue, 7 Sep 2021 21:58:17 +1000 Subject: [PATCH 4/6] Set partial labels on invoices --- app/Utils/HtmlEngine.php | 6 ++++-- dusk.sh | 0 2 files changed, 4 insertions(+), 2 deletions(-) mode change 100644 => 100755 dusk.sh diff --git a/app/Utils/HtmlEngine.php b/app/Utils/HtmlEngine.php index 0914431dc4..7cf6d86a32 100644 --- a/app/Utils/HtmlEngine.php +++ b/app/Utils/HtmlEngine.php @@ -184,8 +184,10 @@ class HtmlEngine $data['$invoice.subtotal'] = &$data['$subtotal']; if ($this->entity->partial > 0) { - $data['$balance_due'] = ['value' => Number::formatMoney($this->entity->partial, $this->client) ?: ' ', 'label' => ctrans('texts.balance_due')]; - $data['$balance_due_raw'] = ['value' => $this->entity->partial, 'label' => ctrans('texts.balance_due')]; + $data['$balance_due'] = ['value' => Number::formatMoney($this->entity->partial, $this->client) ?: ' ', 'label' => ctrans('texts.partial_due')]; + $data['$balance_due_raw'] = ['value' => $this->entity->partial, 'label' => ctrans('texts.partial_due')]; + $data['$due_date'] = ['value' => $this->translateDate($this->entity->partial_due_date, $this->entity->client->date_format(), $this->entity->client->locale()) ?: ' ', 'label' => ctrans('texts.'.$this->entity_string.'_due_date')]; + } else { if($this->entity->status_id == 1){ diff --git a/dusk.sh b/dusk.sh old mode 100644 new mode 100755 From 9458069abbf1204f8c04c01fbc9ffb898d5aac7a Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 8 Sep 2021 07:05:53 +1000 Subject: [PATCH 5/6] Fixes for special character encoding --- app/Http/Middleware/QueryLogging.php | 2 +- app/PaymentDrivers/Stripe/CreditCard.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Http/Middleware/QueryLogging.php b/app/Http/Middleware/QueryLogging.php index 647dc030f5..30b4adc32a 100644 --- a/app/Http/Middleware/QueryLogging.php +++ b/app/Http/Middleware/QueryLogging.php @@ -55,7 +55,7 @@ class QueryLogging // nlog("Query count = {$count}"); if($count > 175){ - nlog("Quer count = {$count}"); + nlog("Query count = {$count}"); nlog($queries); } diff --git a/app/PaymentDrivers/Stripe/CreditCard.php b/app/PaymentDrivers/Stripe/CreditCard.php index 43fd5eb470..7d187185db 100644 --- a/app/PaymentDrivers/Stripe/CreditCard.php +++ b/app/PaymentDrivers/Stripe/CreditCard.php @@ -76,7 +76,8 @@ class CreditCard private function decodeUnicodeString($string) { - return iconv("UTF-8", "ISO-8859-1//TRANSLIT", $this->decode_encoded_utf8($string)); + return html_entity_decode($string, ENT_QUOTES, 'UTF-8'); + // return iconv("UTF-8", "ISO-8859-1//TRANSLIT", $this->decode_encoded_utf8($string)); } private function decode_encoded_utf8($string){ From 65e79633ec85f58aed14857d1ba03a99377bd856 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 8 Sep 2021 07:51:21 +1000 Subject: [PATCH 6/6] v5.3.8 --- VERSION.txt | 2 +- config/ninja.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index 2e0c25f79a..d758bc62f6 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.3.7 \ No newline at end of file +5.3.8 \ No newline at end of file diff --git a/config/ninja.php b/config/ninja.php index 72a1e1a691..15096ac5da 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -14,8 +14,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => '5.3.7', - 'app_tag' => '5.3.7', + 'app_version' => '5.3.8', + 'app_tag' => '5.3.8', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''),