fix(pdf): hide payment terms text on paid invoices
This commit is contained in:
@@ -341,14 +341,16 @@ export function InvoiceDocument({ invoice }: DocProps) {
|
||||
</View>
|
||||
)}
|
||||
|
||||
<Text style={[styles.paragraph, { marginTop: 16 }]}>
|
||||
{invoice.dueDate
|
||||
? t.paymentTerms(
|
||||
Math.max(0, Math.round((invoice.dueDate.getTime() - invoice.invoiceDate.getTime()) / 86400000)),
|
||||
formatDate(invoice.dueDate, invoice.language),
|
||||
)
|
||||
: t.paymentTermsImmediate}
|
||||
</Text>
|
||||
{!invoice.paid && (
|
||||
<Text style={[styles.paragraph, { marginTop: 16 }]}>
|
||||
{invoice.dueDate
|
||||
? t.paymentTerms(
|
||||
Math.max(0, Math.round((invoice.dueDate.getTime() - invoice.invoiceDate.getTime()) / 86400000)),
|
||||
formatDate(invoice.dueDate, invoice.language),
|
||||
)
|
||||
: t.paymentTermsImmediate}
|
||||
</Text>
|
||||
)}
|
||||
|
||||
{invoice.giroCodePngDataUrl && !invoice.paid && (
|
||||
<View style={styles.giroBlock}>
|
||||
|
||||
Reference in New Issue
Block a user