Fix batch count showing 0 in generate command output
- Save original batch count before processing loop - Use saved count in final output message - Fixes issue #3: 'across 0 batches' bug
This commit is contained in:
@@ -333,7 +333,8 @@ async fn main() -> anyhow::Result<()> {
|
||||
clean_csv_file(input_path, &temp_cleaned_path)?;
|
||||
|
||||
let mut batches = read_csv_file_by_batch(&temp_cleaned_path)?;
|
||||
println!("Found {} batches in CSV", batches.len());
|
||||
let batch_count = batches.len();
|
||||
println!("Found {} batches in CSV", batch_count);
|
||||
|
||||
let mut total_customers = 0usize;
|
||||
let generated_date = Utc::now().format("%Y-%m-%d %H:%M").to_string();
|
||||
@@ -405,7 +406,7 @@ async fn main() -> anyhow::Result<()> {
|
||||
println!(
|
||||
"\nGenerated {} customer invoices across {} batches in {:?}",
|
||||
total_customers,
|
||||
batches.len(),
|
||||
batch_count,
|
||||
base_output_dir
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user