opcn1214-generator: parse.derivedMismatch rejects a valid file with bank codes 277/278 but no 280
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- backend
Hướng nghiên cứu
Start with packages/opcn1214-generator/src/validate/parse-rules.ts and trace derivedMismatches, then read the bank account parsing and generation paths in packages/opcn1214-generator. Run the parser and round-trip tests for codes 277, 278, and 280; add coverage for 277/278 without 280 and 280 without 277/278. Done means the specified behavior is decided and tested, and the unchanged-account case round-trips to identical bytes.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
packages/opcn1214-generator/src/validate/parse-rules.ts:147-152 (parse.derivedMismatch) compares each derived code of a parsed 1000 record with the value the generator would write. That is wrong for code 280. Code 280 isn't derived from 277/278. It is the filer's mark that the bank account changed:
- PDF p.20, code 280: "מקבל ערכים: 1 (במקרה ששונה חשבון הבנק וצורפה אסמכתא מתאימה)". It is filled when the account changed and a supporting document is attached.
- PDF p.19, on 277/278: "רק אם שדה 280 מלא, נלקחים הערכים שמולאו בקודים 277 278, אחרת פרטי חשבון בנק נלקחים מהתל"ם". Without 280, SHAAM takes the account from its own records.
So a file with 277/278 and no 280 is valid, and other software could easily write one. parse1214 throws on it: "Code 280 of record 1000 is absent; derived from the file it is 1."
Repro:
- Generate
minimalInput({ bankAccount: { bank: '12', branch: '345', account: '123456' } }). - Remove the 280 pair from the 1000 code section: shift the rest left and pad with
0.
Before H1 (#5073) this file parsed; now parse1214 throws. The reverse case, 280 = 1 with no 277/278, parses with no issue.
A related case: a 277 longer than 9 digits (p.19 allows at most 9) produces three mismatches, on 277, 278 and 280. The main.bankAccount.format notice that would explain them is dropped.
The input model has the same gap
denormalize (from D3, #5058) builds a bankAccount whenever any of 277/278/280 is present, and reads missing codes as zeros. So:
- 280 = 1 on its own parses to the account
000000000, with no issue; - 277/278 without 280 regenerates with 280 = 1. That changes the file's meaning: it asks SHAAM to replace the account it has.
bankAccount has no way to say "account details given, no change requested".
Fix
-
In
derivedMismatches, skip an absent 280 but still flag any 280 other than 1. The existing "a bank code 280 other than 1" test still passes with this change:for (const code of codes) { const actual = record.codes.get(code); const wanted = expected.codes.get(code); // 280 marks a changed bank account (p.20); without it SHAAM takes the account from its own // records and ignores 277/278 (p.19), so a file may hold 277/278 and no 280. if (actual === wanted || (code === '280' && actual === undefined)) { continue; } -
Let the input model express "account given, unchanged", for example with an explicit flag on
bankAccountthat drives 280. Then parse → generate keeps such a file byte for byte. -
Decide whether 280 = 1 without 277/278 should be reported, instead of becoming an all-zero account.
Done when
- A file with 277/278 and no 280 parses with no issue.
- That file round-trips (parse → generate) to the same bytes.
- 280 = 1 without 277/278 has a decided, tested behaviour.
Raised in the review of #5073 (H1). The input-model part belongs to D3 (#5058). Neither was posted before the PRs merged. Re-checked on main at 31245bc7f.
- Ngôn ngữ chính
- TypeScript
- Star
- 30
- Fork
- 10
- Merge trung bình
- 2 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 276
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Urigo/accounter-fullstack
-
Nested buttons from TooltipTrigger without asChildCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
Urigo/accounter-fullstack#5302 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
1214 annual-audit-workflow
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Urigo/accounter-fullstack#5257 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
1214 annual-audit-workflow
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Urigo/accounter-fullstack#5256 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
annual-audit-workflow
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 87/100
Urigo/accounter-fullstack#5252 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Urigo/accounter-fullstack#4919 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của Urigo/accounter-fullstack
Issue tương tự
-
Media browser returns "Not found" for repositories using the SHA-256 object formatCó thể đã có người làm @adamchodera đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Follow-ups from #312Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
janhesters/remixcn#318 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Interceptor LaunchTestProfile.sh: no Windows (Git Bash/MSYS) branch, test profile never launchesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
danielmiessler/LifeOS#3150 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Make the "%" unit spacing the same in the web and in A10Có thể đã có người làm @kragent66-glitch đã nhận hôm nay. Đang mởbug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
maiychrus25/OpenTea-DX-OS#226 · 1 bình luận ·