Berater Bestellung / online

This commit is contained in:
Kevin Adametz 2020-08-24 18:17:02 +02:00
parent 16fe2fa363
commit ecc71c616f
26 changed files with 828 additions and 240 deletions

View file

@ -55,6 +55,7 @@ class ShoppingOrderItem extends Model
'product_id',
'qty',
'price',
'price_net',
'tax_rate',
'slug',
];
@ -72,10 +73,22 @@ class ShoppingOrderItem extends Model
public function getFormattedPrice()
{
if (\App::getLocale() == "en") {
return number_format($this->attributes['price'], 2, '.', ',');
}
return number_format($this->attributes['price'], 2, ',', '.');
return formatNumber($this->attributes['price']);
}
public function getFormattedTotalPrice()
{
return formatNumber($this->attributes['price'] * $this->attributes['qty']);
}
public function getFormattedPriceNet()
{
return formatNumber($this->attributes['price_net']);
}
public function getFormattedTotalPriceNet()
{
return formatNumber($this->attributes['price_net'] * $this->attributes['qty']);
}
}