2023-02-28 13:36:25 +01:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: 2022 Andreas Palm
|
|
|
|
|
|
|
|
SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
|
|
|
-->
|
|
|
|
|
2022-11-14 22:29:42 +01:00
|
|
|
<div class="container-fluid" id="createshipmentapp">
|
2022-10-29 21:38:28 +02:00
|
|
|
<form action="" method="post" v-on:submit.prevent="submit">
|
|
|
|
<div class="row">
|
|
|
|
<div v-for="msg in messages" :class="msg.class">{{msg.text}}</div>
|
|
|
|
<div>
|
2022-11-14 22:29:42 +01:00
|
|
|
<h1>{|Paketmarken Drucker für|} [CARRIERNAME]</h1>
|
2022-10-29 21:38:28 +02:00
|
|
|
</div>
|
|
|
|
<div class="col-md-4">
|
|
|
|
<h2>{|Empfänger|}</h2>
|
|
|
|
<table>
|
|
|
|
<tr>
|
2022-11-22 00:21:57 +01:00
|
|
|
<td>{|Adresstyp|}:</td>
|
|
|
|
<td>
|
|
|
|
<select v-model.number="form.addresstype">
|
2024-07-13 14:46:58 +02:00
|
|
|
<option value="0">Firma</option>
|
2022-11-22 00:21:57 +01:00
|
|
|
<option value="1">Packstation</option>
|
|
|
|
<option value="2">Filiale</option>
|
2024-07-13 14:46:58 +02:00
|
|
|
<option value="3">Privatadresse</option>
|
2022-11-22 00:21:57 +01:00
|
|
|
</select>
|
|
|
|
</td>
|
2022-10-29 21:38:28 +02:00
|
|
|
</tr>
|
2024-07-13 14:46:58 +02:00
|
|
|
<tr v-if="form.addresstype === 0">
|
|
|
|
<td>{|Firma|}:</td>
|
|
|
|
<td><input type="text" size="36" v-model.trim="form.company_name"></td>
|
2022-10-29 21:38:28 +02:00
|
|
|
</tr>
|
2022-11-22 00:21:57 +01:00
|
|
|
<tr v-if="form.addresstype === 0">
|
2024-07-13 14:46:58 +02:00
|
|
|
<td>{|Abteilung|}:</td>
|
|
|
|
<td><input type="text" size="36" v-model.trim="form.company_division"></td>
|
|
|
|
</tr>
|
|
|
|
<tr v-if="form.addresstype === 3">
|
|
|
|
<td>{|Name|}:</td>
|
|
|
|
<td><input type="text" size="36" v-model.trim="form.name"></td>
|
|
|
|
</tr>
|
|
|
|
<tr v-if="form.addresstype === 0 || form.addresstype === 3">
|
|
|
|
<td>{|Ansprechpartner|}:</td>
|
|
|
|
<td><input type="text" size="36" v-model.trim="form.contact_name"></td>
|
2022-11-22 00:21:57 +01:00
|
|
|
</tr>
|
|
|
|
<tr v-if="form.addresstype === 1 || form.addresstype === 2">
|
|
|
|
<td>{|Postnummer|}:</td>
|
|
|
|
<td><input type="text" size="36" v-model.trim="form.postnumber"></td>
|
|
|
|
</tr>
|
2024-07-13 14:46:58 +02:00
|
|
|
<tr v-if="form.addresstype === 0 || form.addresstype === 3">
|
2022-10-29 21:38:28 +02:00
|
|
|
<td>{|Strasse/Hausnummer|}:</td>
|
|
|
|
<td>
|
2022-11-14 22:29:42 +01:00
|
|
|
<input type="text" size="30" v-model.trim="form.street">
|
|
|
|
<input type="text" size="5" v-model.trim="form.streetnumber">
|
2022-10-29 21:38:28 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
2022-11-22 00:21:57 +01:00
|
|
|
<tr v-if="form.addresstype === 1">
|
|
|
|
<td>{|Packstationsnummer|}:</td>
|
|
|
|
<td><input type="text" size="10" v-model.trim="form.parcelstationNumber"></td>
|
|
|
|
</tr>
|
|
|
|
<tr v-if="form.addresstype === 2">
|
|
|
|
<td>{|Postfilialnummer|}:</td>
|
|
|
|
<td><input type="text" size="10" v-model.trim="form.postofficeNumber"></td>
|
|
|
|
</tr>
|
2024-07-13 14:46:58 +02:00
|
|
|
<tr v-if="form.addresstype === 0 || form.addresstype === 3">
|
2022-10-29 21:38:28 +02:00
|
|
|
<td>{|Adresszeile 2|}:</td>
|
2022-11-14 22:29:42 +01:00
|
|
|
<td><input type="text" size="36" v-model.trim="form.address2"></td>
|
2022-10-29 21:38:28 +02:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>{|PLZ/Ort|}:</td>
|
2022-11-14 22:29:42 +01:00
|
|
|
<td><input type="text" size="5" v-model.trim="form.zip">
|
|
|
|
<input type="text" size="30" v-model.trim="form.city">
|
2022-10-29 21:38:28 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>{|Bundesland|}:</td>
|
2022-11-14 22:29:42 +01:00
|
|
|
<td><input type="text" size="36" v-model.trim="form.state"></td>
|
2022-10-29 21:38:28 +02:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>{|Land|}:</td>
|
|
|
|
<td>
|
2022-11-14 22:29:42 +01:00
|
|
|
<select v-model="form.country" required>
|
2023-03-30 22:24:40 +02:00
|
|
|
<option v-for="(value, key) in countries" :value="key">{{value.name}}</option>
|
2022-10-29 21:38:28 +02:00
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>{|E-Mail|}:</td>
|
2022-11-14 22:29:42 +01:00
|
|
|
<td><input type="text" size="36" v-model.trim="form.email"></td>
|
2022-10-29 21:38:28 +02:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>{|Telefon|}:</td>
|
2022-11-14 22:29:42 +01:00
|
|
|
<td><input type="text" size="36" v-model.trim="form.phone"></td>
|
2022-10-29 21:38:28 +02:00
|
|
|
</tr>
|
2022-10-21 10:46:09 +02:00
|
|
|
|
2022-10-29 21:38:28 +02:00
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-4" v-once>
|
|
|
|
<h2>vollst. Adresse</h2>
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<td>{|Name|}</td>
|
2022-11-14 22:29:42 +01:00
|
|
|
<td>{{form.original.name}}</td>
|
2022-10-29 21:38:28 +02:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>{|Ansprechpartner|}</td>
|
2022-11-14 22:29:42 +01:00
|
|
|
<td>{{form.original.ansprechpartner}}</td>
|
2022-10-29 21:38:28 +02:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>{|Abteilung|}</td>
|
2022-11-14 22:29:42 +01:00
|
|
|
<td>{{form.original.abteilung}}</td>
|
2022-10-29 21:38:28 +02:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>{|Unterabteilung|}</td>
|
2022-11-14 22:29:42 +01:00
|
|
|
<td>{{form.original.unterabteilung}}</td>
|
2022-10-29 21:38:28 +02:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>{|Adresszusatz|}</td>
|
2022-11-14 22:29:42 +01:00
|
|
|
<td>{{form.original.adresszusatz}}</td>
|
2022-10-29 21:38:28 +02:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>{|Strasse|}</td>
|
2022-11-14 22:29:42 +01:00
|
|
|
<td>{{form.original.strasse}}</td>
|
2022-10-29 21:38:28 +02:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>{|PLZ/Ort|}</td>
|
2022-11-14 22:29:42 +01:00
|
|
|
<td>{{form.original.plz}} {{form.original.ort}}</td>
|
2022-10-29 21:38:28 +02:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>{|Bundesland|}</td>
|
2022-11-14 22:29:42 +01:00
|
|
|
<td>{{form.original.bundesland}}</td>
|
2022-10-29 21:38:28 +02:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>{|Land|}</td>
|
2022-11-14 22:29:42 +01:00
|
|
|
<td>{{form.original.land}}</td>
|
2022-10-29 21:38:28 +02:00
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-4">
|
|
|
|
<h2>{|Paket|}</h2>
|
|
|
|
<table>
|
|
|
|
<tr>
|
2023-10-26 20:51:47 +02:00
|
|
|
<td>{|Gewicht (in kg)</b>|}:</td>
|
2022-11-14 22:29:42 +01:00
|
|
|
<td><input type="text" v-model.number="form.weight"></td>
|
2022-10-29 21:38:28 +02:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>{|Höhe (in cm)|}:</td>
|
2022-11-14 22:29:42 +01:00
|
|
|
<td><input type="text" size="10" v-model.number="form.height"></td>
|
2022-10-29 21:38:28 +02:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>{|Breite (in cm)|}:</td>
|
2022-11-14 22:29:42 +01:00
|
|
|
<td><input type="text" size="10" v-model.number="form.width"></td>
|
2022-10-29 21:38:28 +02:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>{|Länge (in cm)|}:</td>
|
2022-11-14 22:29:42 +01:00
|
|
|
<td><input type="text" size="10" v-model.number="form.length"></td>
|
2022-10-29 21:38:28 +02:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>{|Produkt|}:</td>
|
|
|
|
<td>
|
2022-11-22 00:21:57 +01:00
|
|
|
<select v-model="form.product" required>
|
2023-03-30 22:24:40 +02:00
|
|
|
<option v-for="prod in products" :value="prod.Id" v-if="productAvailable(prod)">{{prod.Name}}</option>
|
2023-10-26 20:51:47 +02:00
|
|
|
</select><i>Für Produktwahl Gewicht eingeben!</i>
|
2022-10-29 21:38:28 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
2022-11-14 22:29:42 +01:00
|
|
|
<tr v-if="serviceAvailable('premium')">
|
|
|
|
<td>{|Premium|}:</td>
|
|
|
|
<td><input type="checkbox" v-model="form.services.premium"></td>
|
|
|
|
</tr>
|
2022-10-29 21:38:28 +02:00
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div class="clearfix"></div>
|
|
|
|
<div class="col-md-12">
|
2023-10-26 20:56:18 +02:00
|
|
|
<h2>{|Sonstiges|}</h2>
|
2022-10-29 21:38:28 +02:00
|
|
|
<table>
|
2023-03-30 22:24:40 +02:00
|
|
|
<tbody>
|
|
|
|
<tr>
|
2023-10-26 20:56:18 +02:00
|
|
|
<td>{|Referenzen|}:</td>
|
2023-03-30 22:24:40 +02:00
|
|
|
<td><input type="text" size="36" v-model="form.order_number"></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>{|Versicherungssumme|}:</td>
|
|
|
|
<td><input type="text" size="10" v-model="form.total_insured_value"/></td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
<tbody v-if="customsRequired()">
|
|
|
|
<tr>
|
|
|
|
<td>{|Rechnungsnummer|}:</td>
|
|
|
|
<td><input type="text" size="36" v-model="form.invoice_number" required="required"></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>{|Sendungsart|}:</td>
|
|
|
|
<td>
|
|
|
|
<select v-model="form.shipment_type">
|
|
|
|
<option v-for="(value, key) in customs_shipment_types" :value="key">{{value}}</option>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
2022-10-29 21:38:28 +02:00
|
|
|
</table>
|
|
|
|
</div>
|
2023-03-30 22:24:40 +02:00
|
|
|
<div class="col-md-12" v-if="customsRequired()">
|
2022-10-29 21:38:28 +02:00
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<th>{|Bezeichnung|}</th>
|
|
|
|
<th>{|Menge|}</th>
|
|
|
|
<th>{|HSCode|}</th>
|
|
|
|
<th>{|Herkunftsland|}</th>
|
|
|
|
<th>{|Einzelwert|}</th>
|
|
|
|
<th>{|Einzelgewicht|}</th>
|
|
|
|
<th>{|Gesamtwert|}</th>
|
|
|
|
<th>{|Gesamtgewicht|}</th>
|
2022-11-22 00:21:57 +01:00
|
|
|
<th><a v-on:click="addPosition"><img src="themes/new/images/add.png"></a></
|
|
|
|
</th>
|
2022-10-29 21:38:28 +02:00
|
|
|
</tr>
|
|
|
|
<tr v-for="(pos, index) in form.positions">
|
2022-11-14 22:29:42 +01:00
|
|
|
<td><input type="text" v-model.trim="pos.bezeichnung" required></td>
|
|
|
|
<td><input type="text" v-model.number="pos.menge" required></td>
|
2022-11-22 00:21:57 +01:00
|
|
|
<td><input type="text" v-model.trim="pos.zolltarifnummer"></td>
|
|
|
|
<td><input type="text" v-model.trim="pos.herkunftsland"></td>
|
|
|
|
<td><input type="text" v-model.number="pos.zolleinzelwert"></td>
|
|
|
|
<td><input type="text" v-model.number="pos.zolleinzelgewicht"></td>
|
2022-10-29 21:38:28 +02:00
|
|
|
<td>{{Number(pos.menge*pos.zolleinzelwert || 0).toFixed(2)}}</td>
|
|
|
|
<td>{{Number(pos.menge*pos.zolleinzelgewicht || 0).toFixed(3)}}</td>
|
|
|
|
<td><a v-on:click="deletePosition(index)"><img src="themes/new/images/delete.svg"></a></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2022-11-14 22:29:42 +01:00
|
|
|
<td colspan="6"></td>
|
2022-10-29 21:38:28 +02:00
|
|
|
<td>{{total_value.toFixed(2)}}</td>
|
|
|
|
<td>{{total_weight.toFixed(3)}}</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div>
|
2024-03-27 00:14:39 +01:00
|
|
|
<input class="btnGreen" type="submit" value="{|Paketmarke drucken|}" name="drucken" :disabled="submitting">
|
2022-11-14 22:29:42 +01:00
|
|
|
<!--<input type="button" value="{|Andere Versandart auswählen|}" name="anders"> -->
|
2022-10-29 21:38:28 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
2022-11-14 22:29:42 +01:00
|
|
|
const createshipmentapp = new Vue({
|
|
|
|
el: '#createshipmentapp',
|
|
|
|
data: [JSON],
|
2024-03-19 19:10:43 +01:00
|
|
|
mounted() {
|
|
|
|
this.autoselectproduct();
|
|
|
|
},
|
2022-10-29 21:38:28 +02:00
|
|
|
computed: {
|
|
|
|
total_value() {
|
|
|
|
let sum = 0;
|
2022-11-22 00:21:57 +01:00
|
|
|
for (const pos of this.form.positions) {
|
2022-11-14 22:29:42 +01:00
|
|
|
sum += (pos.menge * pos.zolleinzelwert) || 0;
|
2022-10-29 21:38:28 +02:00
|
|
|
}
|
|
|
|
return sum;
|
|
|
|
},
|
|
|
|
total_weight() {
|
|
|
|
let sum = 0;
|
2022-11-22 00:21:57 +01:00
|
|
|
for (const pos of this.form.positions) {
|
2022-11-14 22:29:42 +01:00
|
|
|
sum += (pos.menge * pos.zolleinzelgewicht) || 0;
|
2022-10-29 21:38:28 +02:00
|
|
|
}
|
|
|
|
return sum;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
2022-11-22 00:21:57 +01:00
|
|
|
submit: function () {
|
2022-10-29 21:38:28 +02:00
|
|
|
let app = this;
|
2024-03-27 00:14:39 +01:00
|
|
|
app.submitting = true;
|
2022-10-29 21:38:28 +02:00
|
|
|
let xhr = new XMLHttpRequest();
|
|
|
|
xhr.open('POST', location.href, true);
|
|
|
|
xhr.setRequestHeader('Content-Type', 'application/json');
|
|
|
|
xhr.onload = function () {
|
|
|
|
let json = JSON.parse(this.response);
|
|
|
|
app.messages = json.messages;
|
2024-03-27 00:14:39 +01:00
|
|
|
app.submitting = false;
|
2022-10-29 21:38:28 +02:00
|
|
|
}
|
|
|
|
xhr.send(JSON.stringify($.extend({submit:'print'}, this.form)));
|
|
|
|
},
|
2022-11-22 00:21:57 +01:00
|
|
|
addPosition: function () {
|
|
|
|
this.form.positions.push({});
|
2022-10-29 21:38:28 +02:00
|
|
|
},
|
2022-11-22 00:21:57 +01:00
|
|
|
deletePosition: function (index) {
|
2022-10-29 21:38:28 +02:00
|
|
|
this.form.positions.splice(index, 1);
|
2022-11-14 22:29:42 +01:00
|
|
|
},
|
2023-03-30 22:24:40 +02:00
|
|
|
productAvailable: function (product) {
|
|
|
|
if (product == undefined)
|
|
|
|
return false;
|
|
|
|
if (product.WeightMin > this.form.weight || product.WeightMax < this.form.weight)
|
|
|
|
return false;
|
|
|
|
return true;
|
|
|
|
},
|
2022-11-22 00:21:57 +01:00
|
|
|
serviceAvailable: function (service) {
|
2022-11-14 22:29:42 +01:00
|
|
|
if (!this.products.hasOwnProperty(this.form.product))
|
|
|
|
return false;
|
|
|
|
return this.products[this.form.product].AvailableServices.indexOf(service) >= 0;
|
2023-03-30 22:24:40 +02:00
|
|
|
},
|
|
|
|
customsRequired: function () {
|
|
|
|
return this.countries[this.form.country].eu == '0';
|
2024-03-19 19:10:43 +01:00
|
|
|
},
|
|
|
|
autoselectproduct: function () {
|
|
|
|
if (!this.productAvailable(this.products[this.form.product])) {
|
|
|
|
for (prod in this.products) {
|
|
|
|
if (!this.productAvailable(this.products[prod]))
|
|
|
|
continue;
|
|
|
|
this.form.product = prod;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2023-03-30 22:24:40 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
beforeUpdate: function () {
|
2024-03-19 19:10:43 +01:00
|
|
|
this.autoselectproduct();
|
2022-10-29 21:38:28 +02:00
|
|
|
}
|
|
|
|
})
|
2023-10-26 20:51:47 +02:00
|
|
|
</script>
|