show discount in pdf from now
This commit is contained in:
@@ -23,6 +23,7 @@ $texts = [
|
||||
'amount' => 'Menge',
|
||||
'unit' => 'Einheit',
|
||||
'unitPrice' => 'Einzelpreis',
|
||||
'discount' => 'Rabatt',
|
||||
'totalPrice' => 'Gesamtpreis'
|
||||
],
|
||||
'summary' => [
|
||||
@@ -83,6 +84,7 @@ $formattedValidUntil = date("d.m.Y", strtotime("+14 days", $offerDate));
|
||||
#positionsTable th.amount, #positionsTable td.amount { text-align: right; width: 50px;}
|
||||
#positionsTable th.unit, #positionsTable td.unit { text-align: center; width: 40px;}
|
||||
#positionsTable th.price, #positionsTable td.price { text-align: right; width: 80px;}
|
||||
#positionsTable th.discount, #positionsTable td.discount { text-align: right; width: 50px;}
|
||||
#positionsTable th.total, #positionsTable td.total { text-align: right; width: 90px;}
|
||||
|
||||
.position-group-header td { background-color: #e8f0f8; font-weight: bold; border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; padding: 4px; }
|
||||
@@ -141,6 +143,7 @@ $formattedValidUntil = date("d.m.Y", strtotime("+14 days", $offerDate));
|
||||
<th class="amount"><?= $text['table']['amount'] ?></th>
|
||||
<th class="unit"><?= $text['table']['unit'] ?></th>
|
||||
<th class="price"><?= $text['table']['unitPrice'] ?></th>
|
||||
<th class="discount"><?= $text['table']['discount'] ?></th>
|
||||
<th class="total"><?= $text['table']['totalPrice'] ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -151,7 +154,7 @@ $formattedValidUntil = date("d.m.Y", strtotime("+14 days", $offerDate));
|
||||
$isAlternativeGroup = ($groupName === 'Alternativpositionen');
|
||||
if (!empty($groupName)): ?>
|
||||
<tr class="position-group-header <?= $isAlternativeGroup ? 'alternative-group-header' : '' ?>">
|
||||
<td colspan="6"><?= htmlspecialchars($isAlternativeGroup ? $text['alternativeHeader'] : $groupName) ?></td>
|
||||
<td colspan="7"><?= htmlspecialchars($isAlternativeGroup ? $text['alternativeHeader'] : $groupName) ?></td>
|
||||
</tr>
|
||||
<?php endif;
|
||||
|
||||
@@ -170,6 +173,7 @@ $formattedValidUntil = date("d.m.Y", strtotime("+14 days", $offerDate));
|
||||
<td class="amount"><?= number_format($p['amount'], 2, ',', '.') ?></td>
|
||||
<td class="unit"><?= htmlspecialchars($p['articleUnit']) ?></td>
|
||||
<td class="price"><?= formatPrice($p['price'], '€') ?></td>
|
||||
<td class="price"><?= htmlspecialchars($p['discount'] . '%') ?></td>
|
||||
<td class="total"><?= formatPrice($p['totalPrice'], '€') ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user