From c8cf58703502847cfeeaa57e6370a51fc11be2c8 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 6 Feb 2023 08:47:52 +1100 Subject: [PATCH 01/16] Update discord invite link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 282a956bec50..bfbc44080fd6 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ ## [Hosted](https://www.invoiceninja.com) | [Self-Hosted](https://www.invoiceninja.org) -Join us on [Slack](http://slack.invoiceninja.com), [Discord](https://discord.com/channels/1071654583870435439/1071654584390537279) [Discourse](https://forum.invoiceninja.com) - +Join us on [Slack](http://slack.invoiceninja.com), [Discord](https://discord.gg/ZwEdtfCwXA) [Discourse](https://forum.invoiceninja.com) - or [StackOverflow](https://stackoverflow.com/tags/invoice-ninja/) if you like, just make sure to add the `invoice-ninja` tag to your question. From 80c1d0b2ebc9436fdbe0fd87d68f10db96490370 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 6 Feb 2023 09:03:49 +1100 Subject: [PATCH 02/16] Fixes for required client fields --- app/PaymentDrivers/CustomPaymentDriver.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/PaymentDrivers/CustomPaymentDriver.php b/app/PaymentDrivers/CustomPaymentDriver.php index b0629883c111..b9227c816fc3 100644 --- a/app/PaymentDrivers/CustomPaymentDriver.php +++ b/app/PaymentDrivers/CustomPaymentDriver.php @@ -43,6 +43,11 @@ class CustomPaymentDriver extends BaseDriver return $types; } + public function init() + { + return $this; + } + public function setPaymentMethod($payment_method_id) { $this->payment_method = $payment_method_id; From af8ea65b33b7bd64098c0276cb43d9711ff601f8 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 6 Feb 2023 09:06:42 +1100 Subject: [PATCH 03/16] Stub required fields for custom payment drivers --- app/PaymentDrivers/CustomPaymentDriver.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/PaymentDrivers/CustomPaymentDriver.php b/app/PaymentDrivers/CustomPaymentDriver.php index b9227c816fc3..6a95a6f05643 100644 --- a/app/PaymentDrivers/CustomPaymentDriver.php +++ b/app/PaymentDrivers/CustomPaymentDriver.php @@ -106,4 +106,9 @@ class CustomPaymentDriver extends BaseDriver { // Driver doesn't support this feature. } + + public function getClientRequiredFields(): array + { + return []; + } } From 7a378863a55cb5ab22cc571968638d5742bcd444 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 6 Feb 2023 11:34:33 +1100 Subject: [PATCH 04/16] Attach recurring invoice docs --- app/Mail/Engine/InvoiceEmailEngine.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/Mail/Engine/InvoiceEmailEngine.php b/app/Mail/Engine/InvoiceEmailEngine.php index 7f3a0bf417d9..cf326986bdbf 100644 --- a/app/Mail/Engine/InvoiceEmailEngine.php +++ b/app/Mail/Engine/InvoiceEmailEngine.php @@ -138,6 +138,17 @@ class InvoiceEmailEngine extends BaseEmailEngine if ($this->client->getSetting('document_email_attachment') !== false && $this->invoice->company->account->hasFeature(Account::FEATURE_DOCUMENTS)) { + if($this->invoice->recurring_invoice()->exists()) + { + foreach ($this->invoice->recurring_invoice->documents as $document) { + + if($document->size > $this->max_attachment_size) + $this->setAttachmentLinks([" $document->hash]) ."'>". $document->name .""]); + else + $this->setAttachments([['file' => base64_encode($document->getFile()), 'path' => $document->filePath(), 'name' => $document->name, 'mime' => NULL, ]]); + } + } + // Storage::url foreach ($this->invoice->documents as $document) { From 2eb3136b74b57174440c054b589e87d446aff9fb Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 7 Feb 2023 07:59:14 +1100 Subject: [PATCH 05/16] Minor fixes for observers --- app/Observers/ClientContactObserver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Observers/ClientContactObserver.php b/app/Observers/ClientContactObserver.php index ecc6fd67677e..b570d2d1ea88 100644 --- a/app/Observers/ClientContactObserver.php +++ b/app/Observers/ClientContactObserver.php @@ -82,7 +82,7 @@ class ClientContactObserver CreditInvitation::withTrashed()->where('client_contact_id', $client_contact_id)->cursor()->each(function ($invite){ - if($invite->credits()->doesnthave('invitations')) + if($invite->credit()->doesnthave('invitations')) $invite->credit->service()->createInvitations(); }); From f69bd5875f4fd91a7efd336eebb77bcde3365e34 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 7 Feb 2023 11:38:54 +1100 Subject: [PATCH 06/16] Fixes for bank transaction rules includes --- .../BankTransactionRuleTransformer.php | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/app/Transformers/BankTransactionRuleTransformer.php b/app/Transformers/BankTransactionRuleTransformer.php index 02394c5bb579..ffc0aeb4b2e4 100644 --- a/app/Transformers/BankTransactionRuleTransformer.php +++ b/app/Transformers/BankTransactionRuleTransformer.php @@ -11,13 +11,12 @@ namespace App\Transformers; -use App\Models\Account; use App\Models\BankTransaction; use App\Models\BankTransactionRule; use App\Models\Company; -use App\Models\Expense; -use App\Models\Invoice; +use App\Models\ExpenseCategory; use App\Transformers\VendorTransformer; +use App\Transformers\ExpenseCateogryTransformer; use App\Utils\Traits\MakesHash; /** @@ -77,6 +76,9 @@ class BankTransactionRuleTransformer extends EntityTransformer { $transformer = new ClientTransformer($this->serializer); + if(!$bank_transaction_rule->client) + return null; + return $this->includeItem($bank_transaction_rule->expense, $transformer, Client::class); } @@ -84,7 +86,20 @@ class BankTransactionRuleTransformer extends EntityTransformer { $transformer = new VendorTransformer($this->serializer); + if(!$bank_transaction_rule->vendor) + return null; + return $this->includeItem($bank_transaction_rule->vendor, $transformer, Vendor::class); } + public function includeExpenseCategory(BankTransactionRule $bank_transaction_rule) + { + $transformer = new ExpenseCategoryTransformer($this->serializer); + + if(!$bank_transaction_rule->expense_cateogry) + return null; + + return $this->includeItem($bank_transaction_rule->expense_category, $transformer, ExpenseCategory::class); + } + } From 0ff40ff6549d4381b1109d800f65492663579c99 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 7 Feb 2023 11:42:24 +1100 Subject: [PATCH 07/16] type --- app/Models/BankTransactionRule.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/BankTransactionRule.php b/app/Models/BankTransactionRule.php index d79ab69c5048..a4ab0b8ed61b 100644 --- a/app/Models/BankTransactionRule.php +++ b/app/Models/BankTransactionRule.php @@ -163,7 +163,7 @@ class BankTransactionRule extends BaseModel return $this->belongsTo(User::class)->withTrashed(); } - public function expense_cateogry() + public function expense_category() { return $this->belongsTo(ExpenseCategory::class)->withTrashed(); } From 60280ae3c666f268fb9de552a5468dd910aa05a4 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 7 Feb 2023 13:45:05 +1100 Subject: [PATCH 08/16] minor fix for bank transaction relation to expense category --- app/Models/BankTransactionRule.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/BankTransactionRule.php b/app/Models/BankTransactionRule.php index a4ab0b8ed61b..0284e787d703 100644 --- a/app/Models/BankTransactionRule.php +++ b/app/Models/BankTransactionRule.php @@ -165,7 +165,7 @@ class BankTransactionRule extends BaseModel public function expense_category() { - return $this->belongsTo(ExpenseCategory::class)->withTrashed(); + return $this->belongsTo(ExpenseCategory::class, 'category_id', 'id')->withTrashed(); } } \ No newline at end of file From 9698099e219e1b3dc708b23f64f0f287ab1c5c8c Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 7 Feb 2023 17:19:38 +1100 Subject: [PATCH 09/16] Fixes for approve quotes with no terms/signature requirements --- public/js/clients/quotes/approve.js | 2 +- public/mix-manifest.json | 2 +- resources/js/clients/quotes/approve.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/js/clients/quotes/approve.js b/public/js/clients/quotes/approve.js index 3810671a3806..cc5c2cc570f9 100644 --- a/public/js/clients/quotes/approve.js +++ b/public/js/clients/quotes/approve.js @@ -1,2 +1,2 @@ /*! For license information please see approve.js.LICENSE.txt */ -(()=>{function e(e,t){for(var n=0;n{function e(e,t){for(var n=0;n { - if (!this.shouldDisplaySignature && !this.shouldDisplayTerms && this.shouldDisplayUserInput){ + if (!this.shouldDisplaySignature && !this.shouldDisplayTerms && this.shouldDisplayUserInput){ this.displayInput(); document @@ -146,7 +146,7 @@ class Approve { }); } - if (!this.shouldDisplaySignature && !this.shouldDisplayTerms && this.shouldDisplayUserInput) { + if (!this.shouldDisplaySignature && !this.shouldDisplayTerms && !this.shouldDisplayUserInput) { this.submitForm(); } }); From 0e17559a8fe01c85d05e2333cddd543ceb7ea04d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 7 Feb 2023 20:10:47 +1100 Subject: [PATCH 10/16] Update readme --- README.md | 6 ++---- app/Http/Requests/Report/GenericReportRequest.php | 2 +- app/Http/Requests/Report/ProductSalesReportRequest.php | 2 +- app/Http/Requests/Report/ProfitLossRequest.php | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index bfbc44080fd6..5c34b7e21852 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,7 @@ ## [Hosted](https://www.invoiceninja.com) | [Self-Hosted](https://www.invoiceninja.org) -Join us on [Slack](http://slack.invoiceninja.com), [Discord](https://discord.gg/ZwEdtfCwXA) [Discourse](https://forum.invoiceninja.com) - -or [StackOverflow](https://stackoverflow.com/tags/invoice-ninja/) if you like, -just make sure to add the `invoice-ninja` tag to your question. +Join us on [Slack](http://slack.invoiceninja.com), [Discord](https://discord.gg/ZwEdtfCwXA), [Support Forum](https://forum.invoiceninja.com) ## Introduction @@ -27,13 +25,13 @@ We offer a $30 per year white-label license to remove the Invoice Ninja branding * [API Documentation](https://app.swaggerhub.com/apis/invoiceninja/invoiceninja) * [APP Documentation](https://invoiceninja.github.io/) * [Support Forum](https://forum.invoiceninja.com) -* [StackOverflow](https://stackoverflow.com/tags/invoice-ninja/) ## Setup ### Mobile Apps * [iPhone](https://apps.apple.com/app/id1503970375?platform=iphone) * [Android](https://play.google.com/store/apps/details?id=com.invoiceninja.app) +* [F-Droid](https://f-droid.org/en/packages/com.invoiceninja.app) ### Desktop Apps * [macOS](https://apps.apple.com/app/id1503970375?platform=mac) diff --git a/app/Http/Requests/Report/GenericReportRequest.php b/app/Http/Requests/Report/GenericReportRequest.php index b305f36da106..b70ffd7afabc 100644 --- a/app/Http/Requests/Report/GenericReportRequest.php +++ b/app/Http/Requests/Report/GenericReportRequest.php @@ -42,7 +42,7 @@ class GenericReportRequest extends Request { $input = $this->all(); - if (! array_key_exists('date_range', $input)) { + if (! array_key_exists('date_range', $input) || $input['date_range'] == '') { $input['date_range'] = 'all'; } diff --git a/app/Http/Requests/Report/ProductSalesReportRequest.php b/app/Http/Requests/Report/ProductSalesReportRequest.php index f5be44551b30..c0399b8335f5 100644 --- a/app/Http/Requests/Report/ProductSalesReportRequest.php +++ b/app/Http/Requests/Report/ProductSalesReportRequest.php @@ -46,7 +46,7 @@ class ProductSalesReportRequest extends Request { $input = $this->all(); - if (! array_key_exists('date_range', $input)) { + if (! array_key_exists('date_range', $input) || $input['date_range'] == '') { $input['date_range'] = 'all'; } diff --git a/app/Http/Requests/Report/ProfitLossRequest.php b/app/Http/Requests/Report/ProfitLossRequest.php index 338ffad7f6c3..34e33518ffb3 100644 --- a/app/Http/Requests/Report/ProfitLossRequest.php +++ b/app/Http/Requests/Report/ProfitLossRequest.php @@ -42,7 +42,7 @@ class ProfitLossRequest extends Request { $input = $this->all(); - if (! array_key_exists('date_range', $input)) { + if (! array_key_exists('date_range', $input) || $input['date_range'] == '') { $input['date_range'] = 'all'; } From c989aaad870de4ed9fd483de6a126144d9bdfede Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 7 Feb 2023 20:12:27 +1100 Subject: [PATCH 11/16] Update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5c34b7e21852..6878d59700b0 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ We offer a $30 per year white-label license to remove the Invoice Ninja branding git clone https://github.com/invoiceninja/invoiceninja.git git checkout v5-stable cp .env.example .env -composer update +composer i -o --no-dev php artisan key:generate ``` From cb47c9d40e07cbb46ac7e038101c3ee1e3b4903b Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 7 Feb 2023 22:25:40 +1100 Subject: [PATCH 12/16] Fixes for applying invoice numbers to subscriptions where invoice number is set to When Sent --- app/Services/Invoice/ApplyNumber.php | 3 ++- app/Services/Payment/UpdateInvoicePayment.php | 6 +++++- app/Services/Subscription/SubscriptionService.php | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/Services/Invoice/ApplyNumber.php b/app/Services/Invoice/ApplyNumber.php index 6520d2d86542..7bb10ec8e887 100644 --- a/app/Services/Invoice/ApplyNumber.php +++ b/app/Services/Invoice/ApplyNumber.php @@ -36,6 +36,7 @@ class ApplyNumber extends AbstractService public function run() { + if ($this->invoice->number != '') { return $this->invoice; } @@ -45,7 +46,7 @@ class ApplyNumber extends AbstractService $this->trySaving(); break; case 'when_sent': - if ($this->invoice->status_id == Invoice::STATUS_SENT) { + if ($this->invoice->status_id >= Invoice::STATUS_SENT) { $this->trySaving(); } break; diff --git a/app/Services/Payment/UpdateInvoicePayment.php b/app/Services/Payment/UpdateInvoicePayment.php index 4fc84e33b489..5035b4cb2a71 100644 --- a/app/Services/Payment/UpdateInvoicePayment.php +++ b/app/Services/Payment/UpdateInvoicePayment.php @@ -85,7 +85,11 @@ class UpdateInvoicePayment if($invoice->is_proforma) { - $invoice->number = ''; + + if(strlen($invoice->number) > 1 && str_starts_with($invoice->number,"####")) + $invoice->number = ''; + + $invoice->is_proforma = false; $invoice->service() diff --git a/app/Services/Subscription/SubscriptionService.php b/app/Services/Subscription/SubscriptionService.php index c9862683f843..e2c0e9f56383 100644 --- a/app/Services/Subscription/SubscriptionService.php +++ b/app/Services/Subscription/SubscriptionService.php @@ -958,7 +958,7 @@ class SubscriptionService $invoice->subscription_id = $this->subscription->id; $invoice->client_id = $client_id; $invoice->is_proforma = true; - $invoice->number = ctrans('texts.subscription') . "_" . now()->format('Y-m-d') . "_" . rand(0,100000); + $invoice->number = "####" . ctrans('texts.subscription') . "_" . now()->format('Y-m-d') . "_" . rand(0,100000); $line_items = $bundle->map(function ($item){ $line_item = new InvoiceItem; From 6a62b5cbfae29d121cda8906862ed22b9b5482d3 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 7 Feb 2023 22:26:17 +1100 Subject: [PATCH 13/16] version bump --- VERSION.txt | 2 +- config/ninja.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index 4b14ecd1e5b0..81733607d8da 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.5.68 \ No newline at end of file +5.5.69 \ No newline at end of file diff --git a/config/ninja.php b/config/ninja.php index 0cce2761257e..b151fe78510f 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.5.68', - 'app_tag' => '5.5.68', + 'app_version' => '5.5.69', + 'app_tag' => '5.5.69', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''), From 4b9b1c3fc217db4d1d1ad64cd41157abeb578fe1 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 7 Feb 2023 22:47:43 +1100 Subject: [PATCH 14/16] Add Product Image and Product Max Quantity to the products table --- app/Http/Livewire/BillingPortalPurchasev2.php | 1 + app/Models/Product.php | 2 ++ app/Transformers/ProductTransformer.php | 2 ++ ...7_114011_add_additional_product_fields.php | 31 +++++++++++++++++++ .../billing-portal-purchasev2.blade.php | 26 ++++++++-------- 5 files changed, 49 insertions(+), 13 deletions(-) create mode 100644 database/migrations/2023_02_07_114011_add_additional_product_fields.php diff --git a/app/Http/Livewire/BillingPortalPurchasev2.php b/app/Http/Livewire/BillingPortalPurchasev2.php index 099e7f8c4f04..f7f4d1ba79dc 100644 --- a/app/Http/Livewire/BillingPortalPurchasev2.php +++ b/app/Http/Livewire/BillingPortalPurchasev2.php @@ -322,6 +322,7 @@ class BillingPortalPurchasev2 extends Component 'total' => $total, 'qty' => $qty, 'is_recurring' => true, + 'product_image' => $p->product_image, ]); } diff --git a/app/Models/Product.php b/app/Models/Product.php index bf8847db8804..34f9fee8014a 100644 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -39,6 +39,8 @@ class Product extends BaseModel 'in_stock_quantity', 'stock_notification_threshold', 'stock_notification', + 'max_quantity', + 'product_image', ]; protected $touches = []; diff --git a/app/Transformers/ProductTransformer.php b/app/Transformers/ProductTransformer.php index 12fa8ddf9aa8..3d0247da0002 100644 --- a/app/Transformers/ProductTransformer.php +++ b/app/Transformers/ProductTransformer.php @@ -93,6 +93,8 @@ class ProductTransformer extends EntityTransformer 'in_stock_quantity' => (int) $product->in_stock_quantity ?: 0, 'stock_notification' => (bool) $product->stock_notification, 'stock_notification_threshold' => (int) $product->stock_notification_threshold, + 'max_quantity' => (int) $product->max_quantity, + 'product_image' => (string) $product->product_image ?: '', ]; } } diff --git a/database/migrations/2023_02_07_114011_add_additional_product_fields.php b/database/migrations/2023_02_07_114011_add_additional_product_fields.php new file mode 100644 index 000000000000..4b0760722b42 --- /dev/null +++ b/database/migrations/2023_02_07_114011_add_additional_product_fields.php @@ -0,0 +1,31 @@ +unsignedInteger("max_quantity")->nullable(); + $table->string("product_image", 191)->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +}; diff --git a/resources/views/portal/ninja2020/components/livewire/billing-portal-purchasev2.blade.php b/resources/views/portal/ninja2020/components/livewire/billing-portal-purchasev2.blade.php index b5398e952937..2adb5cfcf1e4 100644 --- a/resources/views/portal/ninja2020/components/livewire/billing-portal-purchasev2.blade.php +++ b/resources/views/portal/ninja2020/components/livewire/billing-portal-purchasev2.blade.php @@ -36,9 +36,9 @@ @if(!empty($subscription->recurring_product_ids)) @foreach($recurring_products as $index => $product)
  • - @if(filter_var($product->custom_value1, FILTER_VALIDATE_URL)) + @if(filter_var($product->product_image, FILTER_VALIDATE_URL))
    - +
    @endif
    @@ -74,7 +74,7 @@ @endfor } @else - @for ($i = 2; $i <= ($subscription->use_inventory_management ? min($product->in_stock_quantity, max(100,$product->custom_value2)) : max(100,$product->custom_value2)); $i++) + @for ($i = 2; $i <= ($subscription->use_inventory_management ? min($product->in_stock_quantity, max(100,$product->max_quantity)) : max(100,$product->max_quantity)); $i++) @endfor @endif @@ -96,9 +96,9 @@ @if(!empty($subscription->product_ids)) @foreach($products as $product)
  • - @if(filter_var($product->custom_value1, FILTER_VALIDATE_URL)) + @if(filter_var($product->product_image, FILTER_VALIDATE_URL))
    - +
    @endif
    @@ -135,9 +135,9 @@ @if(!empty($subscription->optional_recurring_product_ids)) @foreach($optional_recurring_products as $index => $product)
  • - @if(filter_var($product->custom_value1, FILTER_VALIDATE_URL)) + @if(filter_var($product->product_image, FILTER_VALIDATE_URL))
    - +
    @endif
    @@ -148,7 +148,7 @@
    - @if(is_numeric($product->custom_value2)) + @if(is_numeric($product->max_quantity))

    @if($subscription->use_inventory_management && $product->in_stock_quantity == 0) @@ -162,7 +162,7 @@ @endif > - @for ($i = 1; $i <= ($subscription->use_inventory_management ? min($product->in_stock_quantity, max(100,$product->custom_value2)) : max(100,$product->custom_value2)); $i++) + @for ($i = 1; $i <= ($subscription->use_inventory_management ? min($product->in_stock_quantity, max(100,$product->max_quantity)) : max(100,$product->max_quantity)); $i++) @endfor @@ -176,9 +176,9 @@ @if(!empty($subscription->optional_product_ids)) @foreach($optional_products as $index => $product)
  • - @if(filter_var($product->custom_value1, FILTER_VALIDATE_URL)) + @if(filter_var($product->product_image, FILTER_VALIDATE_URL))
    - +
    @endif
    @@ -190,7 +190,7 @@

    - @if(is_numeric($product->custom_value2)) + @if(is_numeric($product->max_quantity))

    @if($subscription->use_inventory_management && $product->in_stock_quantity == 0) @@ -200,7 +200,7 @@ @endif From 2746eaef068b51b767186c04971ba977285118be Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 7 Feb 2023 23:03:05 +1100 Subject: [PATCH 15/16] Redirect to invoicing.co for login, always --- app/Http/Controllers/BaseController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Http/Controllers/BaseController.php b/app/Http/Controllers/BaseController.php index 7cf98c9388ca..0c3c63a8858e 100644 --- a/app/Http/Controllers/BaseController.php +++ b/app/Http/Controllers/BaseController.php @@ -1031,6 +1031,11 @@ class BaseController extends Controller public function flutterRoute() { if ((bool) $this->checkAppSetup() !== false && $account = Account::first()) { + + //always redirect invoicing.co to invoicing.co + if(Ninja::isHosted() && (request()->getSchemeAndHttpHost() != 'https://invoicing.co')) + return redirect()->secure('https://invoicing.co'); + if (config('ninja.require_https') && ! request()->isSecure()) { return redirect()->secure(request()->getRequestUri()); } From 025191fc2c0dc045207361e31ad15b0934830bed Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 7 Feb 2023 23:36:38 +1100 Subject: [PATCH 16/16] Test adding a third parameter to the task timelog --- tests/Feature/TaskApiTest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/Feature/TaskApiTest.php b/tests/Feature/TaskApiTest.php index 031966083393..fe338e01a8f2 100644 --- a/tests/Feature/TaskApiTest.php +++ b/tests/Feature/TaskApiTest.php @@ -58,7 +58,7 @@ class TaskApiTest extends TestCase public function testTaskLockingGate() { $data = [ - 'timelog' => [[1,2],[3,4]], + 'timelog' => [[1,2,'a'],[3,4,'d']], ]; $response = $this->withHeaders([ @@ -194,7 +194,7 @@ class TaskApiTest extends TestCase public function testTimeLogValidation3() { $data = [ - 'timelog' => [["a","b"],["c","d"]], + 'timelog' => [["a","b",'d'],["c","d",'d']], ]; try { @@ -213,7 +213,7 @@ class TaskApiTest extends TestCase public function testTimeLogValidation4() { $data = [ - 'timelog' => [[1,2],[3,0]], + 'timelog' => [[1,2,'d'],[3,0,'d']], ]; $response = $this->withHeaders([ @@ -232,8 +232,8 @@ class TaskApiTest extends TestCase public function testStartTask() { $log = [ - [2, 1], - [10, 20], + [2, 1,'d'], + [10, 20,'d'], ]; $last = end($log);