Skip to content

Bug: inventory-entry fields accumulate whitespace fragments and unit names double when parsing batch-allocated vouchers #379

Description

@lamemustafa

Summary

Inventory-entry fields are corrupted when parsed from Tally XML for vouchers carrying inventory entries with batch allocations. This was found with an unreleased inventory reader that sits on the shared voucher-parsing path, while investigating the vouchers failure on inventory books (see #378).

Observed (read-only, TallyPrime 7.1 licensed, real inventory book, 2026-09-14)

  • Per-voucher inventory_entries[].amount and .billed_qty come back as the real value followed by roughly 40–60 repeated "\r\n " fragments. For example, "-8000.00\r\n \r\n …" on a single-line Purchase voucher.
  • This affects 10 of 10 inventory-bearing vouchers in a one-week test window. It is systematic, not intermittent.
  • Unit master names come back doubled ("KGSKGS", "nosnos").
  • A full-month window fails with agent_response_too_large.
  • Stock-item master opening qty/rate/value fields were not affected.
  • A direct XML Export (ALLINVENTORYENTRIES.LIST) for the same vouchers parses cleanly: plain numeric amounts, no duplication.

Likely cause (hypothesis)

Whitespace or text events between nested elements (inventory entry → batch allocations → accounting allocations) are appended to the preceding scalar field instead of being dropped. The same accumulation would also double a repeated name element. This would inflate response size and explain the related vouchers protocol failures.

Acceptance

  • Synthetic fixture with nested inventory entries, batch allocations and a unit master (no client data).
  • Parsed amount, qty and unit names equal the fixture values exactly; response size scales with voucher count.
  • Regression test covers indented (pretty-printed) and compact Tally responses.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions