Custom Price / Land / User Order Homeparty

This commit is contained in:
Kevin Adametz 2021-08-20 18:22:21 +02:00
parent d46824a4ac
commit 51d81d8ec6
55 changed files with 1951 additions and 681 deletions

View file

@ -188,5 +188,29 @@ class HomepartyUserOrderItem extends Model
{
return (float) (($this->attributes['price'] - $this->attributes['ek-price']) * $this->attributes['qty']);
}
public function getCurrencyByKey($key)
{
$rNumber = 0;
if($this->homeparty && $this->homeparty->isPriceCurrency()){
$user_country = $this->homeparty->getUserCountry();
$faktor = isset($user_country->currency_faktor) ? $user_country->currency_faktor : 1;
switch ($key) {
case 'TotalIncomePrice':
$rNumber = $this->geTotalIncomePrice() * $faktor;
break;
case 'TotalPrice':
$rNumber = $this->getTotalPrice() * $faktor;
break;
case 'TotalEKPrice':
$rNumber = $this->geTotalEKPrice() * $faktor;
break;
}
}
return formatNumber($rNumber);
}
}