From 6e5f5da6bb7e8232b3474d850a87726995008314 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 2 Jul 2022 08:28:12 +1000 Subject: [PATCH 1/4] Fixes for tests when calling classes outside app scope --- app/Jobs/Mail/NinjaMailerJob.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Jobs/Mail/NinjaMailerJob.php b/app/Jobs/Mail/NinjaMailerJob.php index f5513e36f341..f653ff496590 100644 --- a/app/Jobs/Mail/NinjaMailerJob.php +++ b/app/Jobs/Mail/NinjaMailerJob.php @@ -334,8 +334,8 @@ class NinjaMailerJob implements ShouldQueue return true; /* On the hosted platform we actively scan all outbound emails to ensure outbound email quality remains high */ - // if(Ninja::isHosted()) - // return (new \Modules\Admin\Jobs\Account\EmailQuality($this->nmo, $this->company))->run(); + if(class_exists(\Modules\Admin\Jobs\Account\EmailQuality::class)) + return (new \Modules\Admin\Jobs\Account\EmailQuality($this->nmo, $this->company))->run(); return false; } From 6faa3a0ccbfbc2dee9d38db6a8a88c310bd2fe5b Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 2 Jul 2022 11:40:51 +1000 Subject: [PATCH 2/4] Adjust number applying on Purchase orders when_sent / when_saved --- app/Jobs/Util/Import.php | 3 +++ app/Services/PurchaseOrder/ApplyNumber.php | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/Jobs/Util/Import.php b/app/Jobs/Util/Import.php index 995dbb646117..99549bd53224 100644 --- a/app/Jobs/Util/Import.php +++ b/app/Jobs/Util/Import.php @@ -923,6 +923,9 @@ class Import implements ShouldQueue $modified['company_id'] = $this->company->id; $modified['line_items'] = $this->cleanItems($modified['line_items']); + if(array_key_exists('next_send_date', $resource)) + $modified['next_send_date_client'] = $resource['next_send_date']; + if(array_key_exists('created_at', $modified)) $modified['created_at'] = Carbon::parse($modified['created_at']); diff --git a/app/Services/PurchaseOrder/ApplyNumber.php b/app/Services/PurchaseOrder/ApplyNumber.php index 9f47baec4a9c..68398c9ebd1b 100644 --- a/app/Services/PurchaseOrder/ApplyNumber.php +++ b/app/Services/PurchaseOrder/ApplyNumber.php @@ -41,7 +41,20 @@ class ApplyNumber extends AbstractService return $this->purchase_order; } - $this->trySaving(); + switch ($this->vendor->company->getSetting('counter_number_applied')) { + case 'when_saved': + $this->trySaving(); + break; + case 'when_sent': + if ($this->invoice->status_id == PurchaseOrder::STATUS_SENT) { + $this->trySaving(); + } + break; + + default: + break; + } + return $this->purchase_order; } From 356d7aeba43cc0cb5b211a90d8ce057230005d0a Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 2 Jul 2022 11:59:40 +1000 Subject: [PATCH 3/4] Hide custom values that are empty --- app/Services/PdfMaker/Design.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Services/PdfMaker/Design.php b/app/Services/PdfMaker/Design.php index 85295f7d358d..46d232e29b45 100644 --- a/app/Services/PdfMaker/Design.php +++ b/app/Services/PdfMaker/Design.php @@ -332,7 +332,10 @@ class Design extends BaseDesign $_variable = explode('.', $variable)[1]; $_customs = ['custom1', 'custom2', 'custom3', 'custom4']; - if (in_array($_variable, $_customs)) { + /* 2/7/2022 don't show custom values if they are empty */ + $var = str_replace("custom", "custom_value", $_variable); + + if (in_array($_variable, $_customs) && !empty($this->entity->{$var})) { $elements[] = ['element' => 'tr', 'elements' => [ ['element' => 'th', 'content' => $variable . '_label', 'properties' => ['data-ref' => 'entity_details-' . substr($variable, 1) . '_label']], ['element' => 'th', 'content' => $variable, 'properties' => ['data-ref' => 'entity_details-' . substr($variable, 1)]], From e7249fb4bdb33d27052fb8749bb88285ff975908 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 2 Jul 2022 12:37:35 +1000 Subject: [PATCH 4/4] v5.4.7 --- VERSION.txt | 2 +- config/ninja.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index cad6b7af839f..48360de846a2 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.4.6 \ No newline at end of file +5.4.7 \ No newline at end of file diff --git a/config/ninja.php b/config/ninja.php index 33945b3e6271..10db9fa47b2f 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.4.6', - 'app_tag' => '5.4.6', + 'app_version' => '5.4.7', + 'app_tag' => '5.4.7', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''),