Exclude Swedish VAT (25%) from prices and amounts in HTML output
Multiply price and amount by 0.8 before generating HTML. Original CSV and TXT files remain unchanged.
This commit is contained in:
@@ -124,9 +124,9 @@ impl PreparedCustomer {
|
||||
.map(|t| FormattedTransaction {
|
||||
date: t.date.format("%Y-%m-%d %H:%M").to_string(),
|
||||
quality_name: t.quality_name,
|
||||
price: fmt(t.price),
|
||||
price: fmt(t.price * 0.8),
|
||||
volume: fmt(t.volume),
|
||||
amount: fmt(t.amount),
|
||||
amount: fmt(t.amount * 0.8),
|
||||
receipt: t.receipt,
|
||||
})
|
||||
.collect();
|
||||
@@ -158,7 +158,7 @@ impl PreparedCustomer {
|
||||
for card in &cards {
|
||||
for tx in &card.transactions {
|
||||
let volume: f64 = tx.volume.parse().unwrap();
|
||||
let amount: f64 = tx.amount.parse().unwrap();
|
||||
let amount: f64 = tx.amount.parse::<f64>().unwrap();
|
||||
let entry = product_totals
|
||||
.entry(tx.quality_name.clone())
|
||||
.or_insert((0.0, 0.0));
|
||||
|
||||
Reference in New Issue
Block a user