Merge branch 'WarehouseOffer/show-discount-in-pdf' into 'master'

show discount in pdf from now

See merge request fronk/thetool!1741
This commit is contained in:
Luca Haid
2025-09-11 06:02:36 +00:00
2 changed files with 6 additions and 1 deletions
@@ -343,6 +343,7 @@ class WarehouseOfferController extends TTCrud
$p['articleDescription'] = ($article->description !== $article->title) ? ($article->description ?? '') : '';
$p['articleUnit'] = $p['unit'] ?? $article->unit ?? 'Stk.';
$p['price'] = (float)($p['unitPrice'] ?? 0);
$p['discount'] = isset($p['discount']) ? (float)$p['discount'] : 0;
$p['amount'] = (float)($p['amount'] ?? 0);
$discount = isset($p['discount']) ? (float)$p['discount'] : 0;
$p['totalPrice'] = ($p['price'] * $p['amount']) * (1 - $discount / 100);