Updates to 03-2025

This commit is contained in:
Kevin Adametz 2025-04-01 10:36:47 +02:00
parent bfa3bb1df4
commit 9ae662f63e
243 changed files with 12580 additions and 12018 deletions

View file

@ -121,7 +121,7 @@ class ShoppingCollectOrder extends Model
$add_tax = round($add_tax, 2);
$tax_split[$tax_rate] = isset($tax_split[$tax_rate]) ? round($tax_split[$tax_rate] += $add_tax, 2) : $add_tax;
foreach($tax_split as $key=>$value){
foreach((array)$tax_split as $key=>$value){
$tax_split[$key] = number_format($value, 2);
}
$this->tax_split = $tax_split;
@ -141,13 +141,31 @@ class ShoppingCollectOrder extends Model
public function addShopItem($shop_item_id, $shop_item)
{
$shop_item->user_price_net = number_format($shop_item->user_price_net, 2);
$shop_item->user_price_total_net = number_format($shop_item->user_price_total_net, 2);
$shop_item->user_tax = number_format($shop_item->user_tax, 2);
$shop_item->user_tax_total = number_format($shop_item->user_tax_total, 2);
$numberFields = [
'user_price_net',
'user_price_total_net',
'user_tax',
'user_tax_total'
];
$intFields = [
'points_total',
'points'
];
foreach ($numberFields as $field) {
if (isset($shop_item->$field)) {
$shop_item->$field = number_format($shop_item->$field, 2);
}
}
foreach ($intFields as $field) {
if (isset($shop_item->$field)) {
$shop_item->$field = intval($shop_item->$field);
}
}
$this->shop_items[$shop_item_id] = $shop_item;
}
public function addOrder($order)