Skip to content
Code-Schnipsel Gruppen Projekte
Commit 07aa49f1 erstellt von Patrick Müller's avatar Patrick Müller
Dateien durchsuchen

feat: ArticleView -> show attribute list price factor value

Übergeordneter 9e8fbddc
No related branches found
No related tags found
Keine zugehörigen Merge Requests gefunden
......@@ -7,6 +7,7 @@
namespace QUI\ERP\Accounting;
use QUI;
use QUI\ERP\Accounting\Calc as ErpCalc;
/**
* Class ArticleView
......@@ -102,6 +103,33 @@ public function getCustomFields(): array
$field['custom_calc']['valueText'] = '';
}
}
// Add price addition
$sum = (float)$field['custom_calc']['value'];
if (!empty($field['custom_calc']['displayDiscounts']) &&
(!QUI::isFrontend() || !QUI\ERP\Products\Utils\Package::hidePrice()) &&
$sum > 0) {
if ($sum >= 0) {
$priceAddition = '+';
} else {
$priceAddition = '-';
}
switch ((int)$field['custom_calc']['calculation']) {
case ErpCalc::CALCULATION_PERCENTAGE:
$priceAddition .= $sum.'%';
break;
default:
$priceAddition .= $this->getCurrency()->format($sum);
break;
}
// locale values
$field['custom_calc']['valueText'] .= ' ('.$priceAddition.')';
}
}
$customFields[] = $field;
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren