Small adjustments to invoices.
This commit is contained in:
@@ -405,17 +405,23 @@
|
|||||||
tax: tax
|
tax: tax
|
||||||
})
|
})
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
|
let error = false;
|
||||||
|
let invoice_id = response.data.id;
|
||||||
for (let i = 0; i < self.items.length; i++) {
|
for (let i = 0; i < self.items.length; i++) {
|
||||||
let pos = sort_flipped[i];
|
let pos = sort_flipped[i];
|
||||||
let item = self.items[pos];
|
let item = self.items[pos];
|
||||||
axios.post('invoice/' + response.data.id + '/item', item)
|
axios.post('invoice/' + invoice_id + '/item', item)
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function (error) {
|
||||||
|
error = true;
|
||||||
console.log(error);
|
console.log(error);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if (!error) {
|
||||||
|
window.location.href = '/invoice/' + invoice_id;
|
||||||
|
}
|
||||||
console.log(response);
|
console.log(response);
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function (error) {
|
||||||
|
|||||||
@@ -101,7 +101,7 @@
|
|||||||
data: {
|
data: {
|
||||||
id: {{ $invoice->id }},
|
id: {{ $invoice->id }},
|
||||||
To: '{{ $invoice->customer->email }}',
|
To: '{{ $invoice->customer->email }}',
|
||||||
Cc: '{{ $invoice->address->email }}',
|
Cc: '{{ ($invoice->address->email === $invoice->customer->email) ? "" : $invoice->address->email }}',
|
||||||
Bcc: '',
|
Bcc: '',
|
||||||
Subject: '{{ __('invoice.Invoice') . ' ' . $invoice->number }}',
|
Subject: '{{ __('invoice.Invoice') . ' ' . $invoice->number }}',
|
||||||
Body: '{{ __('invoice.Invoice body', ['invoice_number' => $invoice->number]) }}',
|
Body: '{{ __('invoice.Invoice body', ['invoice_number' => $invoice->number]) }}',
|
||||||
|
|||||||
@@ -2,7 +2,9 @@
|
|||||||
<div style="font-size: 10px;">{{ $options->company_name }}, {{ $options->address }}
|
<div style="font-size: 10px;">{{ $options->company_name }}, {{ $options->address }}
|
||||||
, {{ $options->zip }} {{ $options->city }}</div>
|
, {{ $options->zip }} {{ $options->city }}</div>
|
||||||
<div style="margin-top: 5mm;">
|
<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->name }}</div>
|
||||||
<div>{{ $invoice->address->address }}</div>
|
<div>{{ $invoice->address->address }}</div>
|
||||||
<div> </div>
|
<div> </div>
|
||||||
|
|||||||
Reference in New Issue
Block a user