show discount in pdf from now

This commit is contained in:
2025-09-11 08:01:35 +02:00
parent 90e40567b1
commit 99b10b034c
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);