Skip to content
Code-Schnipsel Gruppen Projekte

Revisionen vergleichen

Änderungen werden so angezeigt, als ob die Quellrevision mit der Zielrevision zusammengeführt würde. Erfahre mehr über den Vergleich von Revisionen.

Quelle

Zielprojekt auswählen
No results found

Ziel

Zielprojekt auswählen
  • quiqqer/shipping
1 Ergebnis
Änderungen anzeigen
Commits auf Quelle (2)
......@@ -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());
}
......