Extend invoices and invoice items to keep more information.

This commit is contained in:
2025-01-31 13:04:59 +01:00
parent e2240c017d
commit d8afe4960e
20 changed files with 1475 additions and 640 deletions

View File

@@ -205,6 +205,44 @@
</div>
</div>
<!-- Invoices -->
<div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
<div class="max-w">
<section>
<details>
<summary class="text-lg font-medium text-gray-900 dark:text-gray-100 cursor-pointer">
{{ __('invoice.Invoices') }}
</summary>
<form class="mt-6 space-y-2" @submit.prevent="">
<div class="flex flex-row items-center">
<div class="w-1/4 flex flex-row items-center">
<x-input-label for="payment_terms"
:value="__('invoice.Payment terms in days')"/>
</div>
<x-text-input id="payment_terms" name="payment_terms" type="number"
class="mt-1 block"
:value="old('payment_terms')" required autofocus
autocomplete="payment_terms"
x-model="options.payment_terms"/>
</div>
<div class="flex flex-row items-center">
<div class="w-1/4 flex flex-row items-center">
<x-input-label for="cash_discount_date"
:value="__('invoice.Cash discount terms in days')"/>
</div>
<x-text-input id="cash_discount_date" name="cash_discount_date" type="number"
class="mt-1 block"
:value="old('cash_discount_date')" required autofocus
autocomplete="cash_discount_date"
x-model="options.cash_discount_date"/>
</div>
</form>
</details>
</section>
</div>
</div>
<!-- Correspondence -->
<div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
<div class="max-w">
@@ -357,10 +395,14 @@
</div>
</div>
<div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
<p class="text-red-600 font-bold mb-8" x-text="message" x-show="error"></p>
<p x-show="success" x-transition
class="text-sm text-green-600 dark:text-green-400 mb-8">{{ __('form.Saved') }}</p>
<div class="flex items-center gap-4">
<x-primary-button @click="submit">{{ __('form.Save') }}</x-primary-button>
</div>
</div>
</div>
</div>
@@ -371,6 +413,7 @@
return {
options: {},
error: false,
success: false,
message: '',
init() {
@@ -381,7 +424,6 @@
vm.options[value.name] = value.value;
});
})
console.log(vm.options);
},
updatePreview() {
@@ -401,11 +443,11 @@
let vm = this;
axios.post('/option', vm.options)
.then(function (response) {
console.log(response.data);
vm.success = true;
})
.catch(function (error) {
console.log(error);
vm.error = true;
vm.message = error.response.data.message;
})
}
}