Skip to content

invoice: one header per key in pdi and x12-210, 0.12.1 - #39

Merged
royashbrook merged 2 commits into
mainfrom
invoice-one-header-per-key
Nov 17, 2026
Merged

royashbrook merged 2 commits into
mainfrom
invoice-one-header-per-key

Conversation

@royashbrook

Copy link
Copy Markdown
Owner

the pdi and x12-210 formats wrote an invoice twice when two rows shared a key and disagreed on a header field. each copy carried every line and the full total.

  1. now a key with two headers fails the run. the error names the key and the fields that differ.
  2. the check runs before the output file is opened. so a failed run leaves no file and no destination is called.
  3. it is one small helper in fmt/invoice/template.ps1, called by both flat formats. dtn is untouched, it takes one object per invoice.
  4. output for input that was already right is byte for byte the same. the existing order and parity checks still pass.
  5. keys match without regard to case, same as the detail lookup always did. so A and a with different headers is a clash too.
  6. tests in tests/invoice-formats.ps1: a differing header field, a differing column no template uses, keys that differ only by case, a pdi Head field, and a whole run with a destination. controls: detail fields and pdi fields outside Head may still differ.
  7. version 0.12.1 for both modules.

fix #38

@royashbrook
royashbrook merged commit 6256cc7 into main Nov 17, 2026
6 checks passed
@royashbrook
royashbrook deleted the invoice-one-header-per-key branch November 17, 2026 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pdi and x12-210 write an invoice twice when a header field varies under one key

1 participant