Extend invoices and invoice items to keep more information.
This commit is contained in:
@@ -5,8 +5,10 @@
|
||||
{{ __('invoice.Invoice') }} {{ $invoice->number }} ({{ $invoice->localized_state }})
|
||||
</h2>
|
||||
<p class="relative flex flex-row">
|
||||
<x-pdf-icon class="text-gray-800 cursor-pointer" onclick="window.open('/invoice/{{ $invoice->id }}/pdf-download', '_blank', 'popup=true')"/>
|
||||
<x-e-icon class="cursor-pointer" onclick="window.open('/invoice/{{ $invoice->id }}/xml-download', '_blank', 'popup=true')"/>
|
||||
<x-pdf-icon class="text-gray-800 cursor-pointer"
|
||||
onclick="window.open('/invoice/{{ $invoice->id }}/pdf-download', '_blank', 'popup=true')"/>
|
||||
<x-e-icon class="cursor-pointer"
|
||||
onclick="window.open('/invoice/{{ $invoice->id }}/xml-download', '_blank', 'popup=true')"/>
|
||||
</p>
|
||||
</div>
|
||||
</x-slot>
|
||||
@@ -20,11 +22,14 @@
|
||||
<section>
|
||||
<header>
|
||||
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
|
||||
{{ __('customer.Customer') }}: {{ $invoice->customer->name }} ({{ $invoice->customer->email }})
|
||||
{{ __('customer.Customer') }}: {{ $invoice->customer->name }}
|
||||
({{ $invoice->customer->email }})
|
||||
</h2>
|
||||
<div class="grid grid-cols-2 mt-1 text-sm text-gray-600 dark:text-gray-400">
|
||||
<div class="grid grid-cols-2 mt-4 text-sm text-gray-600 dark:text-gray-400">
|
||||
<div>{{ __("customer.Invoice Address") }}</div>
|
||||
<div>{{ __("customer.Delivery Address") }}</div>
|
||||
@if($invoice->delivery)
|
||||
<div>{{ __("customer.Delivery Address") }}</div>
|
||||
@endif
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@@ -42,6 +47,95 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Invoice options -->
|
||||
<div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
|
||||
<div class="max-w">
|
||||
<section>
|
||||
<header>
|
||||
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
|
||||
{{ __('invoice.Invoice options') }}
|
||||
</h2>
|
||||
</header>
|
||||
</section>
|
||||
<div class="flex flex-col gap-2 w-1/2 mt-4 text-sm text-gray-600 dark:text-gray-400">
|
||||
<div class="flex flex-row items-center">
|
||||
<x-input-label class="w-1/3" for="type" :value="__('invoice.Type code')"/>
|
||||
<x-text-input id="type" name="type" type="text"
|
||||
value="{{ \App\Enum\InvoiceTypeCode::label($invoice->type) }}"
|
||||
class="mt-1 w-2/3"
|
||||
autofocus disabled
|
||||
/>
|
||||
</div>
|
||||
@if(in_array($invoice->type, ['326', '875']))
|
||||
<div class="flex flex-row items-center">
|
||||
<x-input-label class="w-1/3" for="project_count"
|
||||
:value="__('invoice.Partial invoice number')"/>
|
||||
<x-text-input id="project_count" name="project_count" type="text"
|
||||
value="{{ $invoice->project_count }}"
|
||||
class="mt-1 w-2/3"
|
||||
autofocus disabled
|
||||
/>
|
||||
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if($invoice->project)
|
||||
<div class="flex flex-row items-center">
|
||||
<x-input-label class="w-1/3" for="project_count"
|
||||
:value="__('project.Project')"/>
|
||||
<x-text-input id="project_count" name="project_count" type="text"
|
||||
value="{{ $invoice->project->name }}"
|
||||
class="mt-1 w-2/3"
|
||||
autofocus disabled
|
||||
/>
|
||||
|
||||
</div>
|
||||
<div class="flex flex-row items-center">
|
||||
<x-input-label class="w-1/3" for="project_count"
|
||||
:value="__('project.Project Number')"/>
|
||||
<x-text-input id="project_count" name="project_count" type="text"
|
||||
value="{{ $invoice->project->project_number }}"
|
||||
class="mt-1 w-2/3"
|
||||
autofocus disabled
|
||||
/>
|
||||
|
||||
</div>
|
||||
@endif
|
||||
<div class="flex flex-row items-center">
|
||||
<x-input-label class="w-1/3" for="due_date"
|
||||
:value="__('invoice.Payment terms')"/>
|
||||
<x-text-input id="due_date" name="due_date" type="date"
|
||||
value="{{ $invoice->due_date }}"
|
||||
class="mt-1 w-2/3"
|
||||
autofocus disabled
|
||||
/>
|
||||
|
||||
</div>
|
||||
<div class="flex flex-row items-center">
|
||||
<x-input-label class="w-1/3" for="cash_discount"
|
||||
:value="__('invoice.Cash discount')"/>
|
||||
<x-text-input id="cash_discount" name="cash_discount" type="number" steps="0.01"
|
||||
value="{{ $invoice->cash_discount }}"
|
||||
class="mt-1 w-2/3"
|
||||
autofocus disabled
|
||||
/>
|
||||
|
||||
</div>
|
||||
<div class="flex flex-row items-center" x-show="invoice.cash_discount != 0">
|
||||
<x-input-label class="w-1/3" for="cash_discount_date"
|
||||
:value="__('invoice.Cash discount until')"/>
|
||||
<x-text-input id="cash_discount_date" name="cash_discount_date" type="date"
|
||||
value="{{ $invoice->cash_discount_date }}"
|
||||
class="mt-1 w-2/3"
|
||||
autofocus disabled
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Invoice items -->
|
||||
<div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
|
||||
<div class="max-w">
|
||||
@@ -50,12 +144,18 @@
|
||||
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
|
||||
{{ __('invoice.Invoice items') }}
|
||||
</h2>
|
||||
<div class="flex flex-row items-end gap-2 w-full mt-1 text-sm text-gray-600 dark:text-gray-400">
|
||||
<div
|
||||
class="flex flex-row items-end gap-2 w-full mt-4 text-sm text-gray-600 dark:text-gray-400">
|
||||
<x-input-label for="invoice_item.amount" :value="__('invoice.Amount')" class="w-1/12"/>
|
||||
<x-input-label for="invoice_item.name" :value="__('invoice.Name')" class="w-2/3"/>
|
||||
<x-input-label for="invoice_item.price" :value="__('invoice.Price')" class="w-1/12 text-right"/>
|
||||
<x-input-label for="invoice_item.tax" :value="__('invoice.Tax')" class="w-1/12 text-right"/>
|
||||
<x-input-label for="invoice_item.tax" :value="__('invoice.Sum')" class="w-1/12 text-right"/>
|
||||
<x-input-label for="invoice_item.name" :value="__('invoice.Name')" class="w-7/12"/>
|
||||
<x-input-label for="invoice_item.price" :value="__('invoice.Price')"
|
||||
class="w-1/12 text-right"/>
|
||||
<x-input-label for="invoice_item.tax" :value="__('invoice.Discount')"
|
||||
class="w-1/12 text-right"/>
|
||||
<x-input-label for="invoice_item.tax" :value="__('invoice.Tax')"
|
||||
class="w-1/12 text-right"/>
|
||||
<x-input-label for="invoice_item.tax" :value="__('invoice.Sum')"
|
||||
class="w-1/12 text-right"/>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@@ -75,7 +175,8 @@
|
||||
<div class="flex flex-row items-end gap-2 w-full">
|
||||
<div class="w-1/12"></div>
|
||||
<div class="mt-1 block w-2/3">{{ __('invoice.Net') }}</div>
|
||||
<div class="w-1/4 text-right">{{ \Illuminate\Support\Number::currency($invoice->sum - $invoice->tax) }}</div>
|
||||
<div
|
||||
class="w-1/4 text-right">{{ \Illuminate\Support\Number::currency($invoice->sum - $invoice->tax) }}</div>
|
||||
</div>
|
||||
<div class="flex flex-row items-end gap-2 w-full">
|
||||
<div class="w-1/12"></div>
|
||||
@@ -87,6 +188,11 @@
|
||||
<div class="mt-1 block w-2/3">{{ __('invoice.Sum') }}</div>
|
||||
<div class="w-1/4 text-right">{{ \Illuminate\Support\Number::currency($invoice->sum) }}</div>
|
||||
</div>
|
||||
<div class="flex flex-row items-end gap-2 w-full">
|
||||
<div class="w-1/12"></div>
|
||||
<div class="mt-1 block w-2/3">{{ __('invoice.Cash discount sum') }}</div>
|
||||
<div class="w-1/4 text-right">{{ \Illuminate\Support\Number::currency($invoice->sum * (100 - $invoice->cash_discount) / 100) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -94,8 +200,12 @@
|
||||
<div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
|
||||
<div class="max-w">
|
||||
<div class="flex flex-row items-end gap-2 w-full">
|
||||
<x-primary-button onclick="window.location.href = '{{ route('invoice.mail', $invoice->id) }}'"><x-mail-icon class="mr-4"/>{{ __('form.Send') }}</x-primary-button>
|
||||
<x-primary-button onclick="window.location.href = '{{ route('invoice.edit', $invoice->id) }}'"><x-edit-icon class="mr-4"/>{{ __('form.Edit') }}</x-primary-button>
|
||||
<x-primary-button
|
||||
onclick="window.location.href = '{{ route('invoice.mail', $invoice->id) }}'">
|
||||
<x-mail-icon class="mr-4"/>{{ __('form.Send') }}</x-primary-button>
|
||||
<x-primary-button
|
||||
onclick="window.location.href = '{{ route('invoice.edit', $invoice->id) }}'">
|
||||
<x-edit-icon class="mr-4"/>{{ __('form.Edit') }}</x-primary-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user