Add account type option to allocat overheads

This commit is contained in:
piv
2023-03-04 09:32:26 +10:30
parent e68d44afd5
commit 4c2b9f6915

View File

@@ -58,6 +58,9 @@ enum Commands {
#[arg(short, long)] #[arg(short, long)]
use_numeric_accounts: bool, use_numeric_accounts: bool,
#[arg(long, default_value = "E")]
account_type: String,
#[arg(short, long, value_name = "FILE")] #[arg(short, long, value_name = "FILE")]
output: Option<PathBuf>, output: Option<PathBuf>,
}, },
@@ -81,6 +84,7 @@ fn main() -> anyhow::Result<()> {
areas, areas,
cost_centres, cost_centres,
use_numeric_accounts, use_numeric_accounts,
account_type,
output, output,
} => allocate_overheads( } => allocate_overheads(
lines, lines,
@@ -89,6 +93,7 @@ fn main() -> anyhow::Result<()> {
areas, areas,
cost_centres, cost_centres,
use_numeric_accounts, use_numeric_accounts,
account_type,
output, output,
), ),
} }
@@ -119,6 +124,7 @@ fn allocate_overheads(
areas: PathBuf, areas: PathBuf,
cost_centres: PathBuf, cost_centres: PathBuf,
use_numeric_accounts: bool, use_numeric_accounts: bool,
account_type: String,
output: Option<PathBuf>, output: Option<PathBuf>,
) -> anyhow::Result<()> { ) -> anyhow::Result<()> {
coster_rs::reciprocal_allocation( coster_rs::reciprocal_allocation(
@@ -131,7 +137,7 @@ fn allocate_overheads(
use_numeric_accounts, use_numeric_accounts,
false, false,
true, true,
"E".to_owned(), account_type,
) )
} }