Merge branch 'feature/enable-set-ls-invoiced' into 'master'
added possibility to set shipping notes as billed See merge request fronk/thetool!667
This commit is contained in:
@@ -10,7 +10,7 @@ const defaultCrudModalData = {
|
||||
}
|
||||
|
||||
window.crudModalStatusOptions =
|
||||
[{value: 'new', text: 'Neu'}, {value: 'accepted', text: 'Akzeptiert'}, {value: 'invoiced', text: 'In Rechnung gestellt', disabled: true}]
|
||||
[{value: 'new', text: 'Neu'}, {value: 'accepted', text: 'Akzeptiert'}, {value: 'invoiced', text: 'In Rechnung gestellt'}]
|
||||
|
||||
// create a additional vue component for showing positions in the table with lazy loading for article titles and description
|
||||
Vue.component('warehouse-shipping-note-positions', {
|
||||
@@ -138,6 +138,7 @@ Vue.component('warehouse-shipping-note', {
|
||||
|
||||
<button @click="openCrudModal('create')" class="btn btn-primary">Lieferschein erstellen</button>
|
||||
<button @click="openVerifyModal" class="btn btn-primary">Lieferscheine Freigeben</button>
|
||||
<button @click="openBilledModal" class="btn btn-primary">Lieferscheine als verrechnet markieren</button>
|
||||
|
||||
<tt-table-crud emit-edit
|
||||
@openHistory="historyModal = true; historyModalId = $event.id"
|
||||
@@ -180,6 +181,21 @@ Vue.component('warehouse-shipping-note', {
|
||||
},
|
||||
|
||||
methods: {
|
||||
async openBilledModal() {
|
||||
const unbilledShippingNotes = await axios.post(window.TT_CONFIG['BASE_PATH'] + '/WarehouseShippingNote/get', {
|
||||
"pagination": {"page": 1, "per_page": 1}, "filters": {
|
||||
"status": "accepted"
|
||||
}, "order": {"key": null, "order": "asc"}
|
||||
});
|
||||
|
||||
if (unbilledShippingNotes.data.rows.length === 0) {
|
||||
this.window.notify('warning', 'Keine Lieferscheine zum Verrechnen gefunden');
|
||||
return;
|
||||
}
|
||||
|
||||
await this.openCrudModal(unbilledShippingNotes.data.rows[0]);
|
||||
this.crudModalVerifyMode = true;
|
||||
},
|
||||
async openVerifyModal() {
|
||||
const unverifiedShippingNotes = await axios.post(window.TT_CONFIG['BASE_PATH'] + '/WarehouseShippingNote/get', {
|
||||
"pagination": {"page": 1, "per_page": 1}, "filters": {
|
||||
@@ -218,8 +234,8 @@ Vue.component('warehouse-shipping-note', {
|
||||
this.crudModalSelectDeliveryAddressMode = 'new';
|
||||
const disconnectedData = JSON.parse(JSON.stringify(data));
|
||||
|
||||
if (disconnectedData.status !== 'new') {
|
||||
this.window.notify('warning', 'Lieferschein kann nicht bearbeitet werden, da er bereits genehmigt wurde');
|
||||
if (disconnectedData.status !== 'new' && disconnectedData.status !== 'accepted') {
|
||||
this.window.notify('warning', 'Lieferschein kann nicht bearbeitet werden, da er bereits in Rechnung gestellt wurde');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user