Skip to content

Commit

Permalink
fix(Apply discount on invoice): display price of product after discou…
Browse files Browse the repository at this point in the history
…nt on invoice
  • Loading branch information
Angemichel12 committed Jul 29, 2024
1 parent 8ac7857 commit 6c85f3b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/services/invoiceService.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,20 @@ const InvoiceDocument: React.FC<{ data: InvoiceData }> = ({ data }) => (
<Image style={styles.productImage} src={product.image} />
</View>
<Text style={styles.tableCell}>{product.name}</Text>
<Text style={styles.tableCell}>{product.price.toFixed(2)} Rwf</Text>
<Text style={styles.tableCell}>
{(
product.price -
(product.price * product.discount) / 100
).toFixed(2)}{" "}
Rwf
</Text>
<Text style={styles.tableCell}>{product.quantity}</Text>
<Text style={styles.tableCell}>
{(product.price * product.quantity).toFixed(2)} Rwf
{(
(product.price - (product.price * product.discount) / 100) *
product.quantity
).toFixed(2)}{" "}
Rwf
</Text>
</View>
))}
Expand Down

0 comments on commit 6c85f3b

Please sign in to comment.