Small adjustments to invoices.

This commit is contained in:
2025-01-14 11:05:05 +01:00
parent 3bd914a276
commit 671981000f
3 changed files with 11 additions and 3 deletions

View File

@@ -405,17 +405,23 @@
tax: tax
})
.then(function (response) {
let error = false;
let invoice_id = response.data.id;
for (let i = 0; i < self.items.length; i++) {
let pos = sort_flipped[i];
let item = self.items[pos];
axios.post('invoice/' + response.data.id + '/item', item)
axios.post('invoice/' + invoice_id + '/item', item)
.then(function (response) {
console.log(response);
})
.catch(function (error) {
error = true;
console.log(error);
})
}
if (!error) {
window.location.href = '/invoice/' + invoice_id;
}
console.log(response);
})
.catch(function (error) {

View File

@@ -101,7 +101,7 @@
data: {
id: {{ $invoice->id }},
To: '{{ $invoice->customer->email }}',
Cc: '{{ $invoice->address->email }}',
Cc: '{{ ($invoice->address->email === $invoice->customer->email) ? "" : $invoice->address->email }}',
Bcc: '',
Subject: '{{ __('invoice.Invoice') . ' ' . $invoice->number }}',
Body: '{{ __('invoice.Invoice body', ['invoice_number' => $invoice->number]) }}',

View File

@@ -2,7 +2,9 @@
<div style="font-size: 10px;">{{ $options->company_name }}, {{ $options->address }}
, {{ $options->zip }} {{ $options->city }}</div>
<div style="margin-top: 5mm;">
<div>{{ $invoice->customer->name }}</div>
@if ( $invoice->customer->name != $invoice->address->name)
<div>{{ $invoice->customer->name }}</div>
@endif
<div>{{ $invoice->address->name }}</div>
<div>{{ $invoice->address->address }}</div>
<div>&nbsp;</div>