diff --git a/application/WarehouseOrder/WarehouseOrderController.php b/application/WarehouseOrder/WarehouseOrderController.php
index 1cd3c881b..649e0e99a 100644
--- a/application/WarehouseOrder/WarehouseOrderController.php
+++ b/application/WarehouseOrder/WarehouseOrderController.php
@@ -1,4 +1,6 @@
-name;
- $position['articleName'] = WarehouseArticleModel::get($position['article'])->title;
+ $position['articleName'] = $position['article_text'] ?? WarehouseArticleModel::get($position['article'])->title;
}
return $order;
@@ -227,7 +229,7 @@ class WarehouseOrderController extends TTCrud {
$mail->isHTML(true);
$mail->Subject = "Neue Bestellung #$orderNumber";
$mail->Body = "
-
+
XINON E-Mail Template
diff --git a/public/js/pages/WarehouseArticle/WarehouseArticle.js b/public/js/pages/WarehouseArticle/WarehouseArticle.js
index dc1735f2c..c528b0b49 100644
--- a/public/js/pages/WarehouseArticle/WarehouseArticle.js
+++ b/public/js/pages/WarehouseArticle/WarehouseArticle.js
@@ -295,7 +295,7 @@ Vue.component('warehouse-article', {
Preis |
Summe |
-
+
| {{item.title}} |
{{item.amount}} |
{{item.purchasePrice}} € |
@@ -363,5 +363,17 @@ Vue.component('warehouse-article', {
window.location.href = `${window['TT_CONFIG']['BASE_PATH']}/WarehouseOrder`;
}, 2000);
}
+ },
+ mounted() {
+ const table = this.$refs.table?.$refs?.table;
+ if (!table) return;
+
+ const showId = new URLSearchParams(window.location.search).get('showId');
+ const currentFilterId = table.filters?.id;
+
+ if ((showId && currentFilterId !== showId) || (!showId && currentFilterId)) {
+ table.filters = showId ? { id: showId } : {};
+ table.refreshTable();
+ }
}
})
diff --git a/public/js/pages/WarehouseOrder/WarehouseOrder.js b/public/js/pages/WarehouseOrder/WarehouseOrder.js
index bb8b9b4e7..a0c869575 100644
--- a/public/js/pages/WarehouseOrder/WarehouseOrder.js
+++ b/public/js/pages/WarehouseOrder/WarehouseOrder.js
@@ -278,8 +278,19 @@ Vue.component('warehouse-order-modal', {
v-model="order.positions"
:config="positionsConfig"
@updateField-article="fetchDistributors"
+ @updateField-article_text="fetchDistributors"
@updateField-distributorId="fetchDistributorData"
- />
+ >
+
+
+
+
+
Lieferadresse
@@ -319,6 +330,7 @@ Vue.component('warehouse-order-modal', {
return {
window: window,
showSendShippingNote: null,
+ lastDistributorFetch: null,
positionsConfig: {
customOrdering: 'distributorId',
fields: {
@@ -327,6 +339,7 @@ Vue.component('warehouse-order-modal', {
label: 'Artikel',
apiUrl: '/WarehouseArticle/autoComplete',
customFieldReference: 'WarehouseArticle',
+ emitDisplayValue: true,
},
distributorId: {type: 'select', label: 'Lieferant', options: [], customFieldReference: 'WarehouseDistributor'},
distributorArticleNumber: {type: 'input', label: 'Lieferant Art-Nr.'},
@@ -334,23 +347,12 @@ Vue.component('warehouse-order-modal', {
buyPrice: {type: 'input', label: 'Einkaufspreis', inputType: 'number'},
verwendung: {type: 'input', label: 'Verwendung'},
},
- validateForm: (formData) => {
- const fields = [
- {key: 'amount', message: 'Bitte füllen Sie die Menge aus'},
- {key: 'distributorId', message: 'Bitte füllen Sie den Lieferanten aus'},
- {key: 'article', message: 'Bitte füllen Sie den Artikel aus'},
- {key: 'buyPrice', message: 'Bitte füllen Sie den Einkaufspreis aus'}
- ];
-
- for (const field of fields) {
- if (!formData[field.key]) {
- window.notify('error', field.message);
- return false;
- }
- }
-
- return true;
- },
+ validateFormOptions: [
+ {key: 'amount', message: 'Bitte füllen Sie die Menge aus'},
+ {key: 'distributorId', message: 'Bitte füllen Sie den Lieferanten aus'},
+ {key: 'article', message: 'Bitte füllen Sie den Artikel aus'},
+ {key: 'buyPrice', message: 'Bitte füllen Sie den Einkaufspreis aus'}
+ ],
},
order: {
extReference: '',
@@ -436,7 +438,9 @@ Vue.component('warehouse-order-modal', {
async fetchDistributors(article) {
const url = `${window.TT_CONFIG["BASE_PATH"]}/WarehouseOrder/getArticleDistributorData`;
const params = typeof article === 'string' ? {allDistributor: true} : {articleId: article};
+ if (JSON.stringify(params) === JSON.stringify(this.lastDistributorFetch)) return;
+ this.lastDistributorFetch = params;
const response = await axios.get(url, {params});
this.positionsConfig.fields.distributorId.options = response.data.map(distributor => ({
value: distributor.id,
@@ -573,10 +577,8 @@ Vue.component('warehouse-order', {
},
methods: {
async closeModal() {
- console.log("hi");
this.orderModalId = null;
this.changeStatusModalId = null;
- console.log("hi");
await new Promise(resolve => setTimeout(resolve, 250));
this.$refs.table.$refs.table.refreshTable();
},
diff --git a/public/plugins/vue/tt-components/tt-position-manager.js b/public/plugins/vue/tt-components/tt-position-manager.js
index 1e7da80e0..b0e16aade 100644
--- a/public/plugins/vue/tt-components/tt-position-manager.js
+++ b/public/plugins/vue/tt-components/tt-position-manager.js
@@ -69,6 +69,7 @@ Vue.component('tt-positions-manager',
:emit-display-value="field.emitDisplayValue || false"
v-model="formData[key]"
@input="$emit('updateField-' + key, $event)"
+ @displayValue="$emit('updateField-' + key + '_text', $event)"
:ref="'autocomplete-' + key"
:api-url="window.TT_CONFIG['BASE_PATH'] + field.apiUrl"
sm
@@ -105,6 +106,8 @@ Vue.component('tt-positions-manager',
:additional-class="selectedIndex === null ? 'btn-primary' : 'btn-success'"
:text="selectedIndex === null ? 'Hinzufügen' : 'Aktualisieren'"/>
+
+
@@ -170,9 +173,7 @@ Vue.component('tt-positions-manager',
},
checkEmitDisplayValueAutocomplete() {
for (const [key, field] of Object.entries(this.config.fields)) {
- console.log("HI");
if ((typeof field.showCondition === 'function' && field.showCondition(this.formData) === true || !field.showCondition) && field.type === 'autocomplete' && field.emitDisplayValue && (isNaN(this.formData[key]) || !this.formData[key]) && this.$refs['autocomplete-' + key][0]) {
- console.log("hi");
this.$set(this.formData, key + '_text', this.$refs['autocomplete-' + key][0].displayValue);
this.$delete(this.formData, key);
}