Fix move money to correctly move between accounts/ccs with ranges and and consider cost output correctly, speed up process by using hashset for rule accounts/departments
This commit is contained in:
13
src/main.rs
13
src/main.rs
@@ -27,6 +27,9 @@ enum Commands {
|
||||
#[arg(short = 'a', long, value_name = "FILE")]
|
||||
accounts: PathBuf,
|
||||
|
||||
#[arg(short = 'c', long, value_name = "FILE")]
|
||||
cost_centres: PathBuf,
|
||||
|
||||
#[arg(short, long, value_name = "FILE")]
|
||||
output: Option<PathBuf>,
|
||||
|
||||
@@ -80,6 +83,7 @@ fn main() -> anyhow::Result<()> {
|
||||
rules,
|
||||
lines,
|
||||
accounts,
|
||||
cost_centres,
|
||||
output,
|
||||
use_numeric_accounts,
|
||||
flush_pass,
|
||||
@@ -87,6 +91,7 @@ fn main() -> anyhow::Result<()> {
|
||||
rules,
|
||||
lines,
|
||||
accounts,
|
||||
cost_centres,
|
||||
output,
|
||||
use_numeric_accounts,
|
||||
flush_pass,
|
||||
@@ -118,14 +123,16 @@ fn move_money(
|
||||
rules: PathBuf,
|
||||
lines: PathBuf,
|
||||
accounts: PathBuf,
|
||||
cost_centres: PathBuf,
|
||||
output: Option<PathBuf>,
|
||||
use_numeric_accounts: bool,
|
||||
flush_pass: bool,
|
||||
) -> anyhow::Result<()> {
|
||||
coster_rs::move_money(
|
||||
csv::Reader::from_path(rules)?,
|
||||
csv::Reader::from_path(lines)?,
|
||||
csv::Reader::from_path(accounts)?,
|
||||
&mut csv::Reader::from_path(rules)?,
|
||||
&mut csv::Reader::from_path(lines)?,
|
||||
&mut csv::Reader::from_path(accounts)?,
|
||||
&mut csv::Reader::from_path(cost_centres)?,
|
||||
&mut csv::Writer::from_path(output.unwrap_or(PathBuf::from("output.csv")))?,
|
||||
use_numeric_accounts,
|
||||
flush_pass,
|
||||
|
||||
Reference in New Issue
Block a user