diff --git a/app/Http/Livewire/InvoicesTable.php b/app/Http/Livewire/InvoicesTable.php
index a5cf2bd2978a..abc401d7c90a 100644
--- a/app/Http/Livewire/InvoicesTable.php
+++ b/app/Http/Livewire/InvoicesTable.php
@@ -4,6 +4,7 @@ namespace App\Http\Livewire;
use App\Models\Invoice;
use App\Traits\WithSorting;
+use Carbon\Carbon;
use Livewire\Component;
use Livewire\WithPagination;
@@ -32,17 +33,24 @@ class InvoicesTable extends Component
$query = Invoice::query();
$query = $query->orderBy($this->sort_field, $this->sort_asc ? 'asc' : 'desc');
- // So $status_id will come in three way:
- // paid, unpaid & overdue. Need to transform them to real values.
+ if (in_array('paid', $this->status)) {
+ $query = $query->orWhere('status_id', Invoice::STATUS_PAID);
+ }
- if (count($this->status)) {
- $query = $query->whereIn('status_id', $this->status);
+ if (in_array('unpaid', $this->status)) {
+ $query = $query->orWhereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]);
+ }
+
+ if (in_array('overdue', $this->status)) {
+ $query = $query->orWhereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL])
+ ->where('due_date', '<', Carbon::now())
+ ->orWhere('partial_due_date', '<', Carbon::now());
}
$query = $query->paginate($this->per_page);
return render('components.livewire.invoices-table', [
- 'invoices' => $query
+ 'invoices' => $query,
]);
}
}
diff --git a/app/Http/Livewire/QuotesTable.php b/app/Http/Livewire/QuotesTable.php
index ff2f20f9c369..6dcc3214513d 100644
--- a/app/Http/Livewire/QuotesTable.php
+++ b/app/Http/Livewire/QuotesTable.php
@@ -26,14 +26,23 @@ class QuotesTable extends Component
public function render()
{
- // So $status_id will come in three way:
- // draft, sent, approved & expired. Need to transform them to real values.
-
$query = Quote::query()
->orderBy($this->sort_field, $this->sort_asc ? 'asc' : 'desc');
- if (count($this->status)) {
- $query = $query->whereIn('status_id', $this->status);
+ if (in_array('draft', $this->status)) {
+ $query = $query->orWhere('status_id', Quote::STATUS_DRAFT);
+ }
+
+ if (in_array('sent', $this->status)) {
+ $query = $query->orWhere('status_id', Quote::STATUS_SENT);
+ }
+
+ if (in_array('approved', $this->status)) {
+ $query = $query->orWhere('status_id', Quote::STATUS_APPROVED);
+ }
+
+ if (in_array('expired', $this->status)) {
+ $query = $query->orWhere('status_id', Quote::STATUS_EXPIRED);
}
$query = $query->paginate($this->per_page);
diff --git a/package.json b/package.json
index ae2e21548a0a..03df15e83ffa 100644
--- a/package.json
+++ b/package.json
@@ -25,7 +25,7 @@
"resolve-url-loader": "^3.1.0",
"sass": "^1.15.2",
"sass-loader": "^8.0.0",
- "tailwindcss": "^1.2.0",
+ "tailwindcss": "^1.3",
"turbolinks": "^5.2.0"
}
}
diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php
index 1b82f53161b2..63c6ff9a3e6a 100644
--- a/resources/lang/en/texts.php
+++ b/resources/lang/en/texts.php
@@ -3203,4 +3203,6 @@ return [
'of' => 'Of',
'view_credit' => 'View Credit',
'to_view_entity_password' => 'To view the :entity you need to enter password.',
+ 'showing_x_of' => 'Showing :first to :last out of :total results',
+ 'no_results' => 'No results found.'
];
diff --git a/resources/views/portal/ninja2020/components/livewire/credits-table.blade.php b/resources/views/portal/ninja2020/components/livewire/credits-table.blade.php
index 03c6d7c53788..30892870fb83 100644
--- a/resources/views/portal/ninja2020/components/livewire/credits-table.blade.php
+++ b/resources/views/portal/ninja2020/components/livewire/credits-table.blade.php
@@ -39,33 +39,43 @@
- @foreach($credits as $credit)
-
-
- {{ App\Utils\Number::formatMoney($credit->amount, $credit->client) }}
-
-
- {{ App\Utils\Number::formatMoney($credit->balance, $credit->client) }}
-
-
- {{ $credit->formatDate($credit->date, $credit->client->date_format()) }}
-
-
- {{ empty($credit->public_notes) ? '/' : $credit->public_notes }}
-
-
-
- @lang('texts.view')
-
-
-
- @endforeach
+ @forelse($credits as $credit)
+
+
+ {{ App\Utils\Number::formatMoney($credit->amount, $credit->client) }}
+
+
+ {{ App\Utils\Number::formatMoney($credit->balance, $credit->client) }}
+
+
+ {{ $credit->formatDate($credit->date, $credit->client->date_format()) }}
+
+
+ {{ empty($credit->public_notes) ? '/' : $credit->public_notes }}
+
+
+
+ @lang('texts.view')
+
+
+
+ @empty
+
+
+ {{ ctrans('texts.no_results') }}
+
+
+ @endforelse
- Showing {{ $credits->firstItem() }} to {{ $credits->lastItem() }} out of {{ $credits->total() }}
+ @if($credits->total() > 0)
+
+ {{ ctrans('texts.showing_x_of', ['first' => $credits->firstItem(), 'last' => $credits->lastItem(), 'total' => $credits->total()]) }}
+
+ @endif
{{ $credits->links() }}
\ No newline at end of file
diff --git a/resources/views/portal/ninja2020/components/livewire/invoices-table.blade.php b/resources/views/portal/ninja2020/components/livewire/invoices-table.blade.php
index 4fdd3ff7cf80..1d2eaf2ae848 100644
--- a/resources/views/portal/ninja2020/components/livewire/invoices-table.blade.php
+++ b/resources/views/portal/ninja2020/components/livewire/invoices-table.blade.php
@@ -11,15 +11,15 @@
@@ -63,7 +63,7 @@
- @foreach($invoices as $invoice)
+ @forelse($invoices as $invoice)
@@ -96,13 +96,23 @@
- @endforeach
+ @empty
+
+
+ {{ ctrans('texts.no_results') }}
+
+
+ @endforelse
- Showing {{ $invoices->firstItem() }} to {{ $invoices->lastItem() }} out of {{ $invoices->total() }}
+ @if($invoices->total() > 0)
+
+ {{ ctrans('texts.showing_x_of', ['first' => $invoices->firstItem(), 'last' => $invoices->lastItem(), 'total' => $invoices->total()]) }}
+
+ @endif
{{ $invoices->links() }}
diff --git a/resources/views/portal/ninja2020/components/livewire/payment-methods-table.blade.php b/resources/views/portal/ninja2020/components/livewire/payment-methods-table.blade.php
index ff04572eb8b0..93d13be14467 100644
--- a/resources/views/portal/ninja2020/components/livewire/payment-methods-table.blade.php
+++ b/resources/views/portal/ninja2020/components/livewire/payment-methods-table.blade.php
@@ -41,47 +41,57 @@
- @foreach($payment_methods as $payment_method)
-
-
- {{ $payment_method->formatDateTimestamp($payment_method->created_at, $client->date_format()) }}
-
-
- {{ ctrans("texts.{$payment_method->gateway_type->alias}") }}
-
-
- {{ ucfirst(optional($payment_method->meta)->brand) }}
-
-
- @if(isset($payment_method->meta->exp_month) && isset($payment_method->meta->exp_year))
- {{ $payment_method->meta->exp_month}} / {{ $payment_method->meta->exp_year }}
- @endif
-
-
- @isset($payment_method->meta->last4)
- **** {{ $payment_method->meta->last4 }}
- @endisset
-
-
- @if($payment_method->is_default)
-
-
-
- @endif
-
-
-
- @lang('texts.view')
-
-
-
- @endforeach
+ @forelse($payment_methods as $payment_method)
+
+
+ {{ $payment_method->formatDateTimestamp($payment_method->created_at, $client->date_format()) }}
+
+
+ {{ ctrans("texts.{$payment_method->gateway_type->alias}") }}
+
+
+ {{ ucfirst(optional($payment_method->meta)->brand) }}
+
+
+ @if(isset($payment_method->meta->exp_month) && isset($payment_method->meta->exp_year))
+ {{ $payment_method->meta->exp_month}} / {{ $payment_method->meta->exp_year }}
+ @endif
+
+
+ @isset($payment_method->meta->last4)
+ **** {{ $payment_method->meta->last4 }}
+ @endisset
+
+
+ @if($payment_method->is_default)
+
+
+
+ @endif
+
+
+
+ @lang('texts.view')
+
+
+
+ @empty
+
+
+ {{ ctrans('texts.no_results') }}
+
+
+ @endforelse
- Showing {{ $payment_methods->firstItem() }} to {{ $payment_methods->lastItem() }} out of {{ $payment_methods->total() }}
+ @if($payment_methods->total() > 0)
+
+ {{ ctrans('texts.showing_x_of', ['first' => $payment_methods->firstItem(), 'last' => $payment_methods->lastItem(), 'total' => $payment_methods->total()]) }}
+
+ @endif
{{ $payment_methods->links() }}
\ No newline at end of file
diff --git a/resources/views/portal/ninja2020/components/livewire/payments-table.blade.php b/resources/views/portal/ninja2020/components/livewire/payments-table.blade.php
index d94a224975c1..7e1c51d99fcd 100644
--- a/resources/views/portal/ninja2020/components/livewire/payments-table.blade.php
+++ b/resources/views/portal/ninja2020/components/livewire/payments-table.blade.php
@@ -43,8 +43,8 @@
- @foreach($payments as $payment)
-
+ @forelse($payments as $payment)
+
{{ $payment->formatDate($payment->date, $payment->client->date_format()) }}
@@ -66,12 +66,22 @@
- @endforeach
+ @empty
+
+
+ {{ ctrans('texts.no_results') }}
+
+
+ @endforelse
- Showing {{ $payments->firstItem() }} to {{ $payments->lastItem() }} out of {{ $payments->total() }}
+ @if($payments->total() > 0)
+
+ {{ ctrans('texts.showing_x_of', ['first' => $payments->firstItem(), 'last' => $payments->lastItem(), 'total' => $payments->total()]) }}
+
+ @endif
{{ $payments->links() }}
\ No newline at end of file
diff --git a/resources/views/portal/ninja2020/components/livewire/quotes-table.blade.php b/resources/views/portal/ninja2020/components/livewire/quotes-table.blade.php
index d538bc91831c..58920f1c674b 100644
--- a/resources/views/portal/ninja2020/components/livewire/quotes-table.blade.php
+++ b/resources/views/portal/ninja2020/components/livewire/quotes-table.blade.php
@@ -67,7 +67,7 @@
- @foreach($quotes as $quote)
+ @forelse($quotes as $quote)
@@ -95,13 +95,23 @@
- @endforeach
+ @empty
+
+
+ {{ ctrans('texts.no_results') }}
+
+
+ @endforelse
- Showing {{ $quotes->firstItem() }} to {{ $quotes->lastItem() }} out of {{ $quotes->total() }}
+ @if($quotes->total() > 0)
+
+ {{ ctrans('texts.showing_x_of', ['first' => $quotes->firstItem(), 'last' => $quotes->lastItem(), 'total' => $quotes->total()]) }}
+
+ @endif
{{ $quotes->links() }}
diff --git a/resources/views/portal/ninja2020/components/livewire/recurring-invoices-table.blade.php b/resources/views/portal/ninja2020/components/livewire/recurring-invoices-table.blade.php
index b2b7e78cc0c0..f9fa3854ce69 100644
--- a/resources/views/portal/ninja2020/components/livewire/recurring-invoices-table.blade.php
+++ b/resources/views/portal/ninja2020/components/livewire/recurring-invoices-table.blade.php
@@ -44,7 +44,7 @@
- @foreach($invoices as $invoice)
+ @forelse($invoices as $invoice)
{{ \App\Models\RecurringInvoice::frequencyForKey($invoice->frequency_id) }}
@@ -67,13 +67,23 @@
- @endforeach
+ @empty
+
+
+ {{ ctrans('texts.no_results') }}
+
+
+ @endforelse
- Showing {{ $invoices->firstItem() }} to {{ $invoices->lastItem() }} out of {{ $invoices->total() }}
+ @if($quotes->total() > 0)
+
+ {{ ctrans('texts.showing_x_of', ['first' => $quotes->firstItem(), 'last' => $quotes->lastItem(), 'total' => $quotes->total()]) }}
+
+ @endif
{{ $invoices->links() }}
diff --git a/resources/views/portal/ninja2020/profile/index.blade.php b/resources/views/portal/ninja2020/profile/index.blade.php
index 0856c7ff6e8c..db77d80a9cab 100644
--- a/resources/views/portal/ninja2020/profile/index.blade.php
+++ b/resources/views/portal/ninja2020/profile/index.blade.php
@@ -29,7 +29,7 @@
@lang('texts.first_name')
-
@error('first_name')
@@ -40,7 +40,7 @@
@lang('texts.last_name')
-
@error('last_name')
@@ -51,7 +51,7 @@
@lang('texts.email_address')
-
@error('email')
@@ -62,7 +62,7 @@
@lang('texts.phone')
-
+
@error('phone')
{{ $message }}
@@ -72,7 +72,7 @@
@lang('texts.password')
-
+
@error('password')
{{ $message }}
@@ -82,7 +82,7 @@
@lang('texts.confirm_password')
-
+
@error('password_confirmation')
{{ $message }}
@@ -123,7 +123,7 @@
@lang('texts.name')
-
@error('name')
@@ -133,7 +133,7 @@
@lang('texts.website')
-
@error('website')
@@ -176,7 +176,7 @@
@lang('texts.address1')
-
@error('address1')
@@ -186,7 +186,7 @@
@lang('texts.address2')
-
@error('address2')
@@ -196,7 +196,7 @@
@lang('texts.city')
-
@error('city')
@@ -206,7 +206,7 @@
@lang('texts.state')
-
@error('state')
@@ -216,7 +216,7 @@
@lang('texts.postal_code')
-
@error('postal_code')
@@ -226,10 +226,13 @@
@lang('texts.country')
-
+
@foreach($countries as $country)
user()->client->country->id ? 'selected' : null }} value="{{ $country->id }}">{{ $country->full_name }}
+ {{ $country == auth()->user()->client->country->id ? 'selected' : null }} value="{{ $country->id }}">
+ {{ $country->iso_3166_2 }}
+ ({{ $country->name }})
+
@endforeach
@error('country')
@@ -273,7 +276,7 @@
@lang('texts.shipping_address1')
-
@error('shipping_address1')
@@ -284,7 +287,7 @@
@lang('texts.shipping_address2')
-
@error('shipping_address2')
@@ -294,7 +297,7 @@
@lang('texts.shipping_city')
-
@error('shipping_city')
@@ -305,7 +308,7 @@
@lang('texts.shipping_state')
-
@error('shipping_state')
@@ -316,7 +319,7 @@
@lang('texts.shipping_postal_code')
-
@error('shipping_postal_code')
@@ -324,13 +327,15 @@
@enderror
-
+
@lang('texts.shipping_country')
-
+
@foreach($countries as $country)
user()->client->shipping_country->id ? 'selected' : null }} value="{{ $country->id }}">{{ $country->full_name }}
+ {{ $country == auth()->user()->client->shipping_country->id ? 'selected' : null }} value="{{ $country->id }}">
+ {{ $country->iso_3166_2 }}
+ ({{ $country->name }})
@endforeach