diff --git a/VERSION.txt b/VERSION.txt
index b26261575073..62f9457511f8 100644
--- a/VERSION.txt
+++ b/VERSION.txt
@@ -1 +1 @@
-5.5.15
\ No newline at end of file
+6
\ No newline at end of file
diff --git a/app/Http/Controllers/ClientPortal/CreditController.php b/app/Http/Controllers/ClientPortal/CreditController.php
index 9b6ee3fefed8..c49606ae700e 100644
--- a/app/Http/Controllers/ClientPortal/CreditController.php
+++ b/app/Http/Controllers/ClientPortal/CreditController.php
@@ -35,6 +35,7 @@ class CreditController extends Controller
$data = [
'credit' => $credit,
'key' => $invitation ? $invitation->key : false,
+ 'invitation' => $invitation
];
if ($invitation && auth()->guard('contact') && ! request()->has('silent') && ! $invitation->viewed_date) {
diff --git a/app/Http/Controllers/ClientPortal/InvoiceController.php b/app/Http/Controllers/ClientPortal/InvoiceController.php
index b5f42beb0783..2270a5f8350e 100644
--- a/app/Http/Controllers/ClientPortal/InvoiceController.php
+++ b/app/Http/Controllers/ClientPortal/InvoiceController.php
@@ -69,6 +69,7 @@ class InvoiceController extends Controller
$data = [
'invoice' => $invoice,
+ 'invitation' => $invitation,
'key' => $invitation ? $invitation->key : false,
];
diff --git a/app/Http/Controllers/ClientPortal/QuoteController.php b/app/Http/Controllers/ClientPortal/QuoteController.php
index 8cf4d3d9a06f..ccaa48f98e57 100644
--- a/app/Http/Controllers/ClientPortal/QuoteController.php
+++ b/app/Http/Controllers/ClientPortal/QuoteController.php
@@ -61,6 +61,7 @@ class QuoteController extends Controller
$data = [
'quote' => $quote,
'key' => $invitation ? $invitation->key : false,
+ 'invitation' => $invitation
];
if ($invitation && auth()->guard('contact') && ! request()->has('silent') && ! $invitation->viewed_date) {
diff --git a/app/Http/Controllers/VendorPortal/PurchaseOrderController.php b/app/Http/Controllers/VendorPortal/PurchaseOrderController.php
index a0361a6a09a9..ba2524bf0829 100644
--- a/app/Http/Controllers/VendorPortal/PurchaseOrderController.php
+++ b/app/Http/Controllers/VendorPortal/PurchaseOrderController.php
@@ -99,6 +99,7 @@ class PurchaseOrderController extends Controller
'settings' => $purchase_order->company->settings,
'sidebar' => $this->sidebarMenu(),
'company' => $purchase_order->company,
+ 'invitation' => $invitation
];
if ($request->query('mode') === 'fullscreen') {
diff --git a/app/Http/Livewire/QuotesTable.php b/app/Http/Livewire/QuotesTable.php
index a82f72898210..4600a0f7a9d9 100644
--- a/app/Http/Livewire/QuotesTable.php
+++ b/app/Http/Livewire/QuotesTable.php
@@ -28,17 +28,17 @@ class QuotesTable extends Component
public $company;
- public $sort_field = 'status_id'; // Default sortBy. Feel free to change or pull from client/company settings.
+ public $sort = 'status_id'; // Default sortBy. Feel free to change or pull from client/company settings.
public $sort_asc = true;
public function sortBy($field)
{
- $this->sort_field === $field
+ $this->sort === $field
? $this->sort_asc = ! $this->sort_asc
: $this->sort_asc = true;
- $this->sort_field = $field;
+ $this->sort = $field;
}
public function mount()
@@ -51,7 +51,7 @@ class QuotesTable extends Component
$query = Quote::query()
->with('client.gateway_tokens', 'company', 'client.contacts')
- ->orderBy($this->sort_field, $this->sort_asc ? 'asc' : 'desc');
+ ->orderBy($this->sort, $this->sort_asc ? 'asc' : 'desc');
if (count($this->status) > 0) {
diff --git a/app/Http/ValidationRules/Credit/ValidCreditsRules.php b/app/Http/ValidationRules/Credit/ValidCreditsRules.php
index f745092fe967..b8d6d2624ed8 100644
--- a/app/Http/ValidationRules/Credit/ValidCreditsRules.php
+++ b/app/Http/ValidationRules/Credit/ValidCreditsRules.php
@@ -51,6 +51,15 @@ class ValidCreditsRules implements Rule
$unique_array = [];
+ $total_credit_amount = array_sum(array_column($this->input['credits'], 'amount'));
+
+ if($total_credit_amount <= 0){
+
+ $this->error_msg = "Total of credits must be more than zero.";
+
+ return false;
+ }
+
$cred_collection = Credit::withTrashed()->whereIn('id', array_column($this->input['credits'], 'credit_id'))->get();
foreach ($this->input['credits'] as $credit) {
diff --git a/app/Services/ClientPortal/InstantPayment.php b/app/Services/ClientPortal/InstantPayment.php
index 9ab3dc581e1e..9d03393b2e59 100644
--- a/app/Services/ClientPortal/InstantPayment.php
+++ b/app/Services/ClientPortal/InstantPayment.php
@@ -48,6 +48,7 @@ class InstantPayment
public function run()
{
+
$is_credit_payment = false;
$tokens = [];
@@ -107,6 +108,7 @@ class InstantPayment
$payable_amount = Number::roundValue(Number::parseFloat($payable_invoice['amount'], $client->currency()->precision));
$invoice_balance = Number::roundValue(($invoice->partial > 0 ? $invoice->partial : $invoice->balance), $client->currency()->precision);
+
/*If we don't allow under/over payments force the payable amount - prevents inspect element adjustments in JS*/
if ($settings->client_portal_allow_under_payment == false && $settings->client_portal_allow_over_payment == false) {
diff --git a/config/ninja.php b/config/ninja.php
index 6bacd49a47f5..d0593cbac99b 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.15',
- 'app_tag' => '5.5.15',
+ 'app_version' => '5.5.16',
+ 'app_tag' => '5.5.16',
'minimum_client_version' => '5.0.16',
'terms_version' => '1.0.1',
'api_secret' => env('API_SECRET', ''),
diff --git a/resources/views/email/template/admin.blade.php b/resources/views/email/template/admin.blade.php
index b8f76ee34817..86e7cde9ed47 100644
--- a/resources/views/email/template/admin.blade.php
+++ b/resources/views/email/template/admin.blade.php
@@ -125,7 +125,7 @@