feat(pdf): add noQuote prop to QuoteDocument

Renders 'Not quoted' in item price cells, '—' in totals, and
changes the quote_notes callout header to 'Why we cannot quote'
when the flag is set. Visual identity stays the same (still a
QUOTATION document on letterhead).
This commit is contained in:
Dave 2026-08-26 23:40:47 +02:00
parent a2e10652a4
commit 6796dbea06

View file

@ -142,7 +142,7 @@ export function QuoteDocument({
logoDataUri,
partialNote,
quoteNotes,
noQuote: _noQuote,
noQuote,
}: QuoteDocumentProps) {
const subtotal = quoteSubtotal(items);
const vat = vatAmount(subtotal);
@ -236,10 +236,10 @@ export function QuoteDocument({
{item.quantity}
</Text>
<Text style={[styles.tableCell, styles.colPrice, styles.alignRight]}>
{formatZAR(item.selling_price)}
{noQuote ? "Not quoted" : formatZAR(item.selling_price)}
</Text>
<Text style={[styles.tableCell, styles.colTotal, styles.alignRight]}>
{formatZAR(item.quantity * item.selling_price)}
{noQuote ? "Not quoted" : formatZAR(item.quantity * item.selling_price)}
</Text>
</View>
))}
@ -265,7 +265,7 @@ export function QuoteDocument({
]}
>
<Text style={[styles.quoteNoteLabel, { color: accent }]}>
Note
{noQuote ? "Why we cannot quote" : "Note"}
</Text>
<Text style={styles.quoteNoteText}>{quoteNotes}</Text>
</View>
@ -273,16 +273,16 @@ export function QuoteDocument({
<View style={styles.totals}>
<View style={styles.totalLine}>
<Text style={styles.totalLabel}>Subtotal:</Text>
<Text style={styles.totalValue}>{formatZAR(subtotal)}</Text>
<Text style={styles.totalValue}>{noQuote ? "—" : formatZAR(subtotal)}</Text>
</View>
<View style={styles.totalLine}>
<Text style={styles.totalLabel}>VAT (15%):</Text>
<Text style={styles.totalValue}>{formatZAR(vat)}</Text>
<Text style={styles.totalValue}>{noQuote ? "—" : formatZAR(vat)}</Text>
</View>
<View style={styles.totalRule} />
<View style={styles.totalLine}>
<Text style={styles.totalFinalLabel}>Total:</Text>
<Text style={styles.totalFinalValue}>{formatZAR(total)}</Text>
<Text style={styles.totalFinalValue}>{noQuote ? "—" : formatZAR(total)}</Text>
</View>
</View>
</View>