Skip to content
Code-Schnipsel Gruppen Projekte
Commit bd8e7972 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

Merge branch 'next-2.x' into 'main'

fix: if linked entities, then do not set standard shipping

See merge request !35
Übergeordnete 5bdbf5ea b519a023
No related branches found
Tags 2.0.4
3 Merge Requests!43Update 'next-3.x' with latest changes from 'main',!35fix: if linked entities, then do not set standard shipping,!32Add QUIQQER Tooling
Pipeline #8764 bestanden mit Phase
in 57 Sekunden
......@@ -19,6 +19,7 @@
use QUI\Smarty\Collector;
use function array_merge;
use function count;
use function explode;
use function json_decode;
use function method_exists;
......@@ -538,9 +539,14 @@ public static function onQuiqqerProductsPriceEnd(Collector $Collector, QUI\ERP\P
public static function onQuiqqerOrderFactoryCreate(AbstractOrder $Order): void
{
try {
self::addDefaultShipping($Order->getArticles());
$Process = new QUI\ERP\Process($Order->getGlobalProcessId());
$Order->update(QUI::getUsers()->getSystemUser());
// wenn verknüpfte entities, dann nicht standard versand setzen
// by mor
if (count($Process->getEntities()) <= 1) {
self::addDefaultShipping($Order->getArticles());
$Order->update(QUI::getUsers()->getSystemUser());
}
} catch (QUI\Exception $Exception) {
QUI\System\Log::addError($Exception->getMessage());
}
......@@ -560,9 +566,15 @@ public static function onQuiqqerInvoiceTemporaryInvoiceCreated(
}
try {
self::addDefaultShipping($TemporaryInvoice->getArticles());
$TemporaryInvoice->addCustomDataEntry(self::DEFAULT_SHIPPING_TIME_KEY, time());
$TemporaryInvoice->update(QUI::getUsers()->getSystemUser());
$Process = new QUI\ERP\Process($TemporaryInvoice->getGlobalProcessId());
// wenn verknüpfte entities, dann nicht standard versand setzen
// by mor
if (count($Process->getEntities()) <= 1) {
self::addDefaultShipping($TemporaryInvoice->getArticles());
$TemporaryInvoice->addCustomDataEntry(self::DEFAULT_SHIPPING_TIME_KEY, time());
$TemporaryInvoice->update(QUI::getUsers()->getSystemUser());
}
} catch (QUI\Exception $Exception) {
QUI\System\Log::addError($Exception->getMessage());
}
......@@ -581,9 +593,15 @@ public static function onQuiqqerOffersCreated(AbstractOffer $Offer): void
}
try {
self::addDefaultShipping($Offer->getArticles());
$Offer->addCustomDataEntry(self::DEFAULT_SHIPPING_TIME_KEY, time());
$Offer->update(QUI::getUsers()->getSystemUser());
$Process = new QUI\ERP\Process($Offer->getGlobalProcessId());
// wenn verknüpfte entities, dann nicht standard versand setzen
// by mor
if (count($Process->getEntities()) <= 1) {
self::addDefaultShipping($Offer->getArticles());
$Offer->addCustomDataEntry(self::DEFAULT_SHIPPING_TIME_KEY, time());
$Offer->update(QUI::getUsers()->getSystemUser());
}
} catch (Exception $Exception) {
QUI\System\Log::addError($Exception->getMessage());
}
......@@ -598,8 +616,14 @@ public static function onQuiqqerOffersCreated(AbstractOffer $Offer): void
public static function onQuiqqerSalesOrdersCreated(SalesOrder $Sales): void
{
try {
self::addDefaultShipping($Sales->getArticles());
$Sales->update();
$Process = new QUI\ERP\Process($Sales->getGlobalProcessId());
// wenn verknüpfte entities, dann nicht standard versand setzen
// by mor
if (count($Process->getEntities()) <= 1) {
self::addDefaultShipping($Sales->getArticles());
$Sales->update();
}
} catch (QUI\Exception $Exception) {
QUI\System\Log::addError($Exception->getMessage());
}
......
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