diff --git a/application/WarehouseOrder/WarehouseOrderController.php b/application/WarehouseOrder/WarehouseOrderController.php
index 61801ca9a..e19e3c124 100644
--- a/application/WarehouseOrder/WarehouseOrderController.php
+++ b/application/WarehouseOrder/WarehouseOrderController.php
@@ -16,7 +16,7 @@ class WarehouseOrderController extends TTCrud {
['key' => 'delAddrName', 'text' => 'Name', 'required' => true, 'modal' => false, 'table' => false],
['key' => 'delAddrPLZ', 'text' => 'PLZ', 'required' => true, 'modal' => false, 'table' => false],
['key' => 'editor', 'text' => 'Bearbeiter', 'required' => true, 'modal' => ['type' => 'select'], 'table' => ['filter' => 'select']],
- ['key' => 'note', 'text' => 'Notiz', 'required' => false, 'modal' => false, 'table' => false],
+ ['key' => 'note', 'text' => 'Interne Notiz', 'required' => false, 'modal' => false, 'table' => false],
['key' => 'sum', 'text' => 'Summe', 'required' => false, 'modal' => false, 'table' => ['class' => 'text-right']],
['key' => 'status', 'text' => 'Status', 'required' => false, 'modal' => ['type' => 'select', 'items' => [
['value' => 'new', 'text' => 'Neu'],
@@ -174,6 +174,37 @@ class WarehouseOrderController extends TTCrud {
$order['positions'] = json_decode($order['positions'], true);
$distributorName = WarehouseDistributorModel::get($order['distributorId'])->name;
+ $texts = [
+ 'EN' => [
+ 'taxFree' => 'Please provide tax-free delivery according to § 6a UStG (Austrian Sales tax law).
Our VAT ID number: ATU68711968. Delivery to Austria.',
+ 'orderConfirmation' => 'Please send the order confirmation to einkauf@xinon.at',
+ 'sendShippingNote' => 'Please send the delivery note with our shipping note and neutral packaging.',
+ ],
+ 'DE' => [
+ 'taxFree' => 'Bitte um steuerfreie Lieferung gemäß § 6a UStG.
Unsere UID-Nr.: ATU68711968. Lieferung nach Österreich.',
+ 'orderConfirmation' => 'Wir bitten um Zusendung der Auftragsbestätigung für die Bestellung an einkauf@xinon.at.',
+ 'sendShippingNote' => 'Bitte senden Sie den Lieferschein mit unserem Versandschein und neutraler Verpackung.',
+ ]];
+
+ $countryText = (new Country(WarehouseDistributorModel::get($order['distributorId'])->countryId))->name;
+ $isGermanSpeaking = in_array($countryText, ['Österreich', 'Deutschland', 'Schweiz']);
+
+ $appendToBody = '';
+ if ($isGermanSpeaking && $countryText !== "Österreich") {
+ $appendToBody .= $texts['DE']['taxFree'] . '
';
+ } else {
+ $appendToBody .= $texts['EN']['taxFree'] . '
';
+ }
+
+ $appendToBody .= $texts[$isGermanSpeaking ? 'DE' : 'EN']['orderConfirmation'];
+
+ if ($order['sendShippingNote'] > 0) {
+ $appendToBody .= '
' . $texts[$isGermanSpeaking ? 'DE' : 'EN']['sendShippingNote'];
+ }
+
+ $appendToBody .= $isGermanSpeaking ? '
Die Bestellung liegt als PDF-Anhang bei.' : '
The order is attached as a PDF file.';
+
+
// Instantiate PHPMailer
$mail = new PHPMailer\PHPMailer\PHPMailer(true);
@@ -208,7 +239,8 @@ class WarehouseOrderController extends TTCrud {
Datum: " . date('d.m.Y H:i', $order['create']) . "
Lieferant: $distributorName
Die Bestellung liegt als PDF-Anhang bei.
+ +$appendToBody