Fixed Article Packets and Shipping Note Text Entry
This commit is contained in:
@@ -47,11 +47,13 @@ class WarehouseArticlePacketController extends TTCrud {
|
||||
|
||||
foreach ($subItems as $subItem) {
|
||||
$article = WarehouseArticleModel::get($subItem->id);
|
||||
$cheapestSellPrices = json_decode($article->cheapestSellPrice);
|
||||
$cheapestSellPrices = json_decode($article->cheapestSellPrice, true);
|
||||
// find in array cheapestSellPrices by title === 'Energie Steiermark' and get the price
|
||||
$articlePrice = array_values(array_filter($cheapestSellPrices, function ($cheapestSellPrice) {
|
||||
return $cheapestSellPrice->title === 'Energie Steiermark';
|
||||
}))[0]->price;
|
||||
return $cheapestSellPrice['title'] === 'Energie Steiermark';
|
||||
}));
|
||||
|
||||
$articlePrice = $articlePrice[0]['price'] ?? 0;
|
||||
|
||||
$calculatedSellPrice += $subItem->amount * $articlePrice;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user