Commit Graph

19 Commits

Author SHA1 Message Date
82cf4b34ac Fix summary amount calculation and add Öresutjämning row
- Amount = round(volume, 2) * round(avg_price, 2)
- Add Öresutjämning showing difference between transaction sum and calculated total
2026-03-23 16:41:49 +01:00
b95cae2ea7 Ensure grand_total is consistent with product calculations
Calculate grand_total from products (volume * avg_price), matching the product row calculations.
2026-03-23 16:24:59 +01:00
3bb65ca7f6 Fix grand_total calculation from card totals
Calculate grand_total from card totals instead of products to ensure consistency.
2026-03-23 16:21:58 +01:00
03f643ba82 Reorder summary columns and calculate amount from volume * avg_price
Summary now shows: Produkt | Volym (L) | Snittpris/L | Belopp
Amount is calculated as volume * average_price instead of summing transactions.
2026-03-23 16:16:54 +01:00
611a471bf1 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.
2026-03-23 16:08:13 +01:00
6b1c9d0c12 Store original and cleaned files in batch folder
- Save original .txt file in the batch folder
- Save cleaned .csv file with just batch number as filename (no '-cleaned' suffix)
- Both files stored alongside the HTML and PDF outputs
2026-03-23 15:46:24 +01:00
1cc34b1a5c Add preprocessing step to convert real input to cleaned format
- Read quoted tab-separated input with US date format (M/D/YYYY H:MM:SS AM/PM)
- Convert dates to ISO format (YYYY-MM-DD HH:MM:SS)
- Save cleaned version to .cleaned.csv alongside the HTML output
- Continue processing with existing workflow on cleaned file
2026-03-23 13:58:36 +01:00
fd2e776181 Support quoted tab-separated input with US date format
Parse dates in M/D/YYYY H:MM:SS AM/PM format in addition to the
ISO format used in the cleaned-up test data.
2026-03-23 13:53:36 +01:00
2360dc6b53 Get batch number from file contents instead of filename 2026-03-23 13:43:27 +01:00
f1ba5a05fb Accept output path argument and create batch subdirectory 2026-03-23 11:24:34 +01:00
748d8a1f19 Remove PDF generation
Revert PDF generation feature - will use external tool for HTML to PDF conversion.
2026-03-23 11:19:20 +01:00
deb49aaac7 Revert "Fix PDF generation with simplified HTML"
This reverts commit d0654af339.
2026-03-23 11:18:30 +01:00
d0654af339 Fix PDF generation with simplified HTML
Use simpler HTML structure compatible with printpdf renderer.
Use inline styles and standard table elements for better rendering.
2026-03-23 11:12:28 +01:00
0ebadbdb48 Add PDF generation for invoices
- Generate both HTML and PDF versions of each customer invoice
- PDFs use printpdf with HTML rendering for consistent styling
- Same layout and formatting as HTML output
2026-03-23 11:04:24 +01:00
4119ad7059 Add summary section with product breakdown
- Show total volume, total amount, and average price per product
- Include grand total row
- Products sorted alphabetically
2026-03-23 10:57:35 +01:00
809f5d2a58 Add Kr currency unit and period display
- Show Kr after all amounts and prices
- Replace batch reference with period (first-last date)
- Same period shown on all customer invoices
2026-03-23 10:51:43 +01:00
bc586e21e7 Translate UI to Swedish 2026-03-23 10:46:39 +01:00
1929b3ed49 Accept CSV file path as command line argument
Output is now written to the same directory as the input file.
2026-03-23 10:41:54 +01:00
650435e00c Add invoice generator for fuel station transactions
- Read CSV files from input/ directory
- Generate static HTML invoices grouped by customer and card
- Filter transactions to only include fleet customers
- Compact print-friendly layout with 2 decimal precision
2026-03-23 10:36:14 +01:00