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

fix: #52

Übergeordneter 768d2075
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
......@@ -34,6 +34,8 @@ function () {
$Basket->setHash('');
$Basket->save();
}
$Basket = new QUI\ERP\Order\Basket\BasketOrder($Order->getHash());
} catch (QUI\Exception $Exception) {
}
}
......
......@@ -336,24 +336,28 @@ public function setSuccessfulStatus()
*/
/**
* @param $Basket - optional
*
* @throws Basket\Exception
* @throws QUI\ERP\Exception
* @throws QUI\Exception
*/
public function recalculate()
public function recalculate($Basket = null)
{
$Basket = new QUI\ERP\Order\Basket\BasketOrder(
$this->getHash(),
$this->getCustomer()
);
$Products = $Basket->getProducts();
if ($Basket === null) {
$Basket = new QUI\ERP\Order\Basket\BasketOrder(
$this->getHash(),
$this->getCustomer()
);
}
$ArticleList = new ArticleList();
$ArticleList->setUser($this->getCustomer());
$ProductCalc = QUI\ERP\Products\Utils\Calc::getInstance();
$ProductCalc->setUser($this->getCustomer());
$Products = $Basket->getProducts();
$Products->calc($ProductCalc);
$products = $Products->getProducts();
......@@ -367,7 +371,13 @@ public function recalculate()
}
}
// recalculate price factors
$Products->getPriceFactors()->clear();
QUI::getEvents()->fireEvent(
'quiqqerOrderBasketToOrder',
[$Basket, $this, $Products]
);
$ArticleList->importPriceFactors(
$Products->getPriceFactors()->toErpPriceFactorList()
);
......
......@@ -84,6 +84,9 @@ public function __construct($orderHash, $User = false)
new QUI\ERP\Products\Utils\PriceFactor($factor)
);
}
$this->List->recalculate();
$this->Order->recalculate($this);
}
/**
......
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren