Skip to content
Code-Schnipsel Gruppen Projekte
Bestätigt Commit 4d1c4caf erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

feat: erp#78

Übergeordneter c71b02e0
No related branches found
No related tags found
Keine zugehörigen Merge Requests gefunden
console.log('load shipping');
require(['qui/QUI'], function (QUI) {
"use strict";
......@@ -39,7 +37,7 @@ require(['qui/QUI'], function (QUI) {
events: {
onSubmit: function (Instance, value) {
PriceFactorWindow.Loader.show();
const currency = ArticleList.getAttribute('currency');
const vat = 19;
let shippingData;
......
......@@ -293,6 +293,35 @@
<p class="content-message-information">Please note: The delivery times only allow an estimated time of arrival after shipping!</p>]]>
</en>
</locale>
<locale name="shipping.defaultShipping.settings.title">
<de><![CDATA[Standard Versand]]></de>
<en><![CDATA[Default shipping]]></en>
</locale>
<locale name="shipping.defaultShipping.settings.defaultShipping">
<de><![CDATA[Standard Versand]]></de>
<en><![CDATA[Default shipping]]></en>
</locale>
<locale name="shipping.defaultShipping.settings.defaultShipping.desc">
<de><![CDATA[Lege fest welcher Versand als Standard Versand verwendet werden soll.]]></de>
<en><![CDATA[Specify which shipping should be used as default shipping.]]></en>
</locale>
<locale name="shipping.defaultShipping.settings.addDefaultShipping">
<de><![CDATA[Standard Versand automatisch hinzufügen]]></de>
<en><![CDATA[Add standard shipping automatically]]></en>
</locale>
<locale name="shipping.defaultShipping.settings.addDefaultShipping.desc">
<de><![CDATA[
Der Standard Versand wird einer Bestellung hinzugefügt falls diese Bestellung noch keinen Versand hat.
Diese Einstellung hat nur Auswirkung im Backend und nicht auf Frontend Aktionen.
Wenn ein Nutzer eine Bestellung ausführt, wird dieser Versand nicht beachtet.
]]></de>
<en><![CDATA[
The default shipping will be added to an order if this order has no shipping yet.
This setting has effect only in backend and not on frontend actions.
When a user executes an order, this shipping is ignored.
]]></en>
</locale>
</groups>
<groups name="quiqqer/shipping" datatype="php">
......
......@@ -24,6 +24,14 @@
<type><![CDATA[bool]]></type>
<defaultvalue>0</defaultvalue>
</conf>
<conf name="defaultShipping">
<type><![CDATA[integer]]></type>
</conf>
<conf name="addDefaultShipping">
<type><![CDATA[bool]]></type>
<defaultvalue>0</defaultvalue>
</conf>
</section>
<section name="no_rules">
......@@ -103,10 +111,12 @@
<input type="checkbox" conf="shipping.showShippingInfoAfterPrice">
<text>
<locale group="quiqqer/shipping" var="shipping.settings.showShippingInfoAfterPrice.enable"/>
<locale group="quiqqer/shipping"
var="shipping.settings.showShippingInfoAfterPrice.enable"/>
</text>
<description>
<locale group="quiqqer/shipping" var="shipping.settings.showShippingInfoAfterPrice.enable.description"/>
<locale group="quiqqer/shipping"
var="shipping.settings.showShippingInfoAfterPrice.enable.description"/>
</description>
</input>
......@@ -142,6 +152,39 @@
</input>
</settings>
<settings title="defaultShipping" name="defaultShipping">
<title>
<locale group="quiqqer/shipping" var="shipping.defaultShipping.settings.title"/>
</title>
<input conf="shipping.defaultShipping"
data-qui="package/quiqqer/shipping/bin/backend/controls/ShippingSelect"
data-qui-options-multiple="0"
data-qui-options-max="1"
>
<text>
<locale group="quiqqer/shipping"
var="shipping.defaultShipping.settings.defaultShipping"/>
</text>
<description>
<locale group="quiqqer/shipping"
var="shipping.defaultShipping.settings.defaultShipping.desc"/>
</description>
</input>
<input conf="shipping.addDefaultShipping" type="checkbox">
<text>
<locale group="quiqqer/shipping"
var="shipping.defaultShipping.settings.addDefaultShipping"/>
</text>
<description>
<locale group="quiqqer/shipping"
var="shipping.defaultShipping.settings.addDefaultShipping.desc"/>
</description>
</input>
</settings>
<settings title="mail" name="mail">
<title>
<locale group="quiqqer/shipping" var="shipping.mail.settings.title"/>
......
......@@ -500,4 +500,31 @@ public static function onQuiqqerProductsPriceEnd(Collector $Collector, QUI\ERP\P
$Collector->append($html);
}
/**
* @param \QUI\ERP\Order\AbstractOrder $Order
* @return void
*
* @throws \QUI\Exception
*/
public static function onQuiqqerOrderShippingOnEmpty(QUI\ERP\Order\AbstractOrder $Order)
{
if (!QUI::isBackend()) {
return;
}
$Config = QUI::getPackage('quiqqer/shipping')->getConfig();
$default = $Config->getValue('shipping', 'defaultShipping');
$add = $Config->getValue('shipping', 'addDefaultShipping');
if (empty($add)) {
return;
}
try {
$Shipping = Shipping::getInstance()->getShippingEntry($default);
$Order->setShipping($Shipping);
} catch (QUI\Exception $Exception) {
}
}
}
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren