미확인 금액을 숨기지 않는 장부 검증기 / Reviewable ledger reconciliation
독립 합성 교육용 코드입니다. 실제 업체의 소스나 자료를 포함하지 않습니다.
Independent synthetic teaching code. No client source, records, credentials or external dependencies.

사용 / Use: Node.js에서 node test.mjs. 브라우저에서는 demo-ko.html 또는 demo-en.html을 엽니다.
Run node test.mjs in Node.js. Open either HTML demo locally. Its JavaScript is fully inlined; no server is needed.
Import {reconcileLedger} from './ledger.mjs' in your own ES module.
Contract: rows of {id, amount, settlements:[]}; unique ASCII IDs up to 40 chars, nonnegative safe integer KRW, at most 10000 rows and 10000 settlements per row. Empty array = known empty set. Missing amount or settlements is unknown, not zero. Input is not mutated.
Any issue => valid:false, totals:null. Details and issue codes support review. No invalid row is silently dropped into a completed aggregate. Duplicate IDs, negative/fractional/unsafe amounts, excessive settlement and aggregate overflow block totals.
입금 날짜·회계 인식·세금·환율·선수금 배분·반품 전표·권한·동시 수정·DB는 포함하지 않습니다.
Does not implement accounting recognition, dates, tax, FX, advance allocation, credit notes, permissions, concurrency or a database. Add a separate domain policy and server validation before production use.
