Add exclude negative allocation statistics option to overhead allocation
This commit is contained in:
@@ -60,6 +60,9 @@ enum Commands {
|
||||
#[arg(long, default_value = "E")]
|
||||
account_type: String,
|
||||
|
||||
#[arg(short, long)]
|
||||
exclude_negative_allocation_statistics: bool,
|
||||
|
||||
#[arg(short, long, value_name = "FILE")]
|
||||
output: Option<PathBuf>,
|
||||
},
|
||||
@@ -94,6 +97,7 @@ fn main() -> anyhow::Result<()> {
|
||||
cost_centres,
|
||||
use_numeric_accounts,
|
||||
account_type,
|
||||
exclude_negative_allocation_statistics,
|
||||
output,
|
||||
} => allocate_overheads(
|
||||
lines,
|
||||
@@ -103,6 +107,7 @@ fn main() -> anyhow::Result<()> {
|
||||
cost_centres,
|
||||
use_numeric_accounts,
|
||||
account_type,
|
||||
exclude_negative_allocation_statistics,
|
||||
output,
|
||||
),
|
||||
}
|
||||
@@ -136,6 +141,7 @@ fn allocate_overheads(
|
||||
cost_centres: PathBuf,
|
||||
use_numeric_accounts: bool,
|
||||
account_type: String,
|
||||
exclude_negative_allocation_statistics: bool,
|
||||
output: Option<PathBuf>,
|
||||
) -> anyhow::Result<()> {
|
||||
coster_rs::reciprocal_allocation(
|
||||
@@ -146,7 +152,7 @@ fn allocate_overheads(
|
||||
csv::Reader::from_path(cost_centres)?,
|
||||
&mut csv::Writer::from_path(output.unwrap_or(PathBuf::from("alloc_output.csv")))?,
|
||||
use_numeric_accounts,
|
||||
false,
|
||||
exclude_negative_allocation_statistics,
|
||||
true,
|
||||
account_type,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user