Add extra mode for utdrags-CSV-files
Dependencies
- [2]
PPY4AJBOsplit ica and gnucash - [3]
5USC3DZ3Split out CSV into a module - [4]
GFBOF5P6Tune amount/value - [5]
5OTWTEPSImplement GCTransaction and GCTransactionBuffer - [*]
QDZOD3MNAble to parse CSV - [*]
YFZX4FSZGenerate transaction numbers
Change contents
- edit in src/main.rs at line 31[8.1936][8.1936]
println!("Extra arguments: {}", args[3]);if !args[3].is_empty() {println!("Importing using 'Utdrag' ordering")} - edit in src/ica_csv.rs at line 21
// If we get an argument, this is the special case when creating// CSV based on Utdrag PDF files.// There the order is sequential, with first entry firstlet utdrag_entry_order = !&args[3].is_empty(); - replacement in src/ica_csv.rs at line 110
write_csv(&mut wtr, &mut transaction_buffer)?;write_csv(&mut wtr, &mut transaction_buffer, utdrag_entry_order)?; - replacement in src/ica_csv.rs at line 159
write_csv(&mut wtr, &mut transaction_buffer)?;write_csv(&mut wtr, &mut transaction_buffer, utdrag_entry_order)?; - edit in src/ica_csv.rs at line 167
utdrag_entry_order: bool, - replacement in src/ica_csv.rs at line 170
for (counter, row) in buf.iter_mut().rev().enumerate() {row.set_number((counter + 1).to_string());if utdrag_entry_order {for (counter, row) in buf.iter_mut().enumerate() {row.set_number((counter + 1).to_string());}// Write CSV in original order, most recent firstwhile let Some(row) = buf.pop_front() {wtr.write_record(row.output())?;}} else {for (counter, row) in buf.iter_mut().rev().enumerate() {row.set_number((counter + 1).to_string());}// Write CSV in original order, most recent firstwhile let Some(row) = buf.pop_front() {wtr.write_record(row.output())?;} - edit in src/ica_csv.rs at line 187[3.7578]→[3.7578:7676](∅→∅),[3.7676]→[3.3939:3980](∅→∅),[3.3980]→[3.7708:7714](∅→∅),[3.7708]→[3.7708:7714](∅→∅)
// Write CSV in original order, most recent firstwhile let Some(row) = buf.pop_front() {wtr.write_record(row.output())?;}