@@ -14,11 +15,9 @@
{{ __('customer.Add new customer') }}
-
{{ __("customer.Add new customer by clicking add") }}
-
{{ __('form.Add') }}
@@ -35,50 +34,22 @@
-
+
{{ __('common.Name') }}
{{ __('common.Email') }}
{{ __('common.Created at') }}
-
+
-
-
+
+
-
-
-
-
-
-
{{ __('customer.Invoice Address') }}
-
-
-
-
-
-
-
-
-
-
{{ __('customer.Delivery Address') }}
-
-
-
-
-
-
-
-
-
-
-
+
+
diff --git a/resources/views/customer/show.blade.php b/resources/views/customer/show.blade.php
new file mode 100644
index 0000000..59da3d1
--- /dev/null
+++ b/resources/views/customer/show.blade.php
@@ -0,0 +1,99 @@
+
+
+
+ {{ __('customer.Customer') }}: {{ $customer->name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ __('customer.Existing addresses') }}
+
+
+
+
+ @if($customer->address)
+
+
{{ __('customer.Invoice Address') }}
+
{{ $customer->address->name }}
+
{{ $customer->address->address }}
+
{{ $customer->address->zip }} {{ $customer->address->city }}
+
{{ $customer->address->phone }}
+
{{ $customer->address->email }}
+
+ @endif
+ @if($customer->delivery)
+
+
{{ __('customer.Delivery Address') }}
+
{{ $customer->delivery->name }}
+
{{ $customer->delivery->address }}
+
{{ $customer->delivery->zip }} {{ $customer->delivery->city }}
+
{{ $customer->delivery->phone }}
+
{{ $customer->delivery->email }}
+
+ @endif
+
+
+
+
+
+
+
+
+
+
+ {{ __('invoice.Invoices') }}
+
+
+
+
+ {{ __('invoice.Invoice Number') }}
+ {{ __('common.Name') }}
+ {{ __('invoice.State') }}
+ {{ __('invoice.Sum') }}
+ {{ __('common.Created at') }}
+
+
+ @php
+ $sum = 0;
+ @endphp
+ @foreach($customer->invoices as $invoice)
+ @php($sum += $invoice->sum)
+
+
+ {{ $invoice->number }}
+ {{ $invoice->address->name }}
+ {{ $invoice->localized_state }}
+ {{ \Illuminate\Support\Number::currency($invoice->sum) }}
+ {{ $invoice->created }}
+
+
+ @endforeach
+
+
+
+
{{ __('invoice.Sum') }}
+
{{ \Illuminate\Support\Number::currency($sum) }}
+
+
+
+
+
+
+
+
+
diff --git a/routes/web.php b/routes/web.php
index 428bc25..2c7dcaa 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -25,7 +25,7 @@ Route::middleware('auth')->group(function () {
Route::patch('/profile', [ProfileController::class, 'update'])->name('profile.update');
Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy');
- Route::resource('/customer', CustomerController::class)->only(['index', 'create', 'edit']);
+ Route::resource('/customer', CustomerController::class)->only(['index', 'create', 'show', 'edit']);
Route::get('/address/{id}/edit', [AddressController::class, 'edit'])->name('address.edit');
Route::resource('/taxrate', TaxrateController::class)->only(['index', 'create', 'edit']);
Route::get('/option', [OptionController::class, 'index'])->name('option.index');