Debug: two invoices on charge 01a1ea63-391b… were classified as OTHER instead of INVOICE
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- backend
Research direction
Start by checking accounter_schema.documents for both IDs and tracing the stored files and charge through Deel sync, OCR, manual edits, and Green Invoice sync. Read packages/server/src/modules/deel/helpers/deel.helper.ts and packages/server/src/modules/app-providers/anthropic.ts; identify which path assigned OTHER, then add a regression test for that cause. Done means both records are INVOICE with the correct creditor and debtor, the charge ledger is regenerated, and the fix is merged.
Written by the indexing model from the issue text.
Description
Summary
Two documents on charge 01a1ea63-391b-79dc-9be9-be1d04d7bb72 were saved with type = OTHER ("Other document"). They are invoices and should have been INVOICE.
| Document ID | Charge ID |
|---|---|
01a1ea63-a06d-757e-aac7-ee24279b91c0 |
01a1ea63-391b-79dc-9be9-be1d04d7bb72 |
01a1ea63-5a60-7e9c-8a62-097e88150092 |
01a1ea63-391b-79dc-9be9-be1d04d7bb72 |
Because the type is OTHER, both documents have no creditor or debtor (figureOutSides returns {} for OTHER). They are also left out of VAT, ledger and match scoring as accounting documents.
Steps
- Find which path created the documents. Check
accounter_schema.documentsfor both IDs:file/imageURLs,file_hash, creation time, and whether a Deel or Green Invoice record is linked to them. Also check whether the charge has an email-ingestion record. - Check the path's type logic. These are the places in
packages/serverthat can setOTHER:- Deel sync:
src/modules/deel/helpers/deel.helper.ts, around line 198. It setsDocumentType.Otherwhenevermatch.breakdown_contract_type === 'prepaid_billing'. If these are Deel invoices, this is the most likely cause. Confirm whether that rule is right for these invoices. - OCR (upload, email ingestion, re-OCR):
src/modules/app-providers/anthropic.ts→extractInvoiceDetails. The model pickstypefromz.enum(DocumentType), so it may have returnedOTHERitself. Re-run OCR on the stored files and look at the rawtypereturned. Then check whether the prompt needs guidance on when to useOTHERversusINVOICE. - Manual edits: check whether the type was changed after insert (e.g. by
updateDocument). - Green Invoice sync:
src/modules/green-invoice/helpers/green-invoice.helper.tsmaps unknown types toUNPROCESSED, notOTHER, so this path is unlikely. Rule it out anyway.
- Deel sync:
- Fix the cause and add a regression test. Correct the two existing documents' types afterwards (with creditor and debtor) and regenerate the charge's ledger.
Acceptance criteria
- We know which path set
OTHERand why - The fix is merged, with a test covering this case
- Both documents are
INVOICE, with correct creditor and debtor
- Dominant language
- TypeScript
- Stars
- 30
- Forks
- 10
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 276
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Urigo/accounter-fullstack
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Urigo/accounter-fullstack#5302 ·
Maintainers usually reply within 2 days
-
1214 annual-audit-workflow
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Urigo/accounter-fullstack#5257 ·
Maintainers usually reply within 2 days
-
1214 annual-audit-workflow
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Urigo/accounter-fullstack#5256 ·
Maintainers usually reply within 2 days
-
annual-audit-workflow
Difficulty 1/5 1-3 hours Newbie friendliness 87/100
Urigo/accounter-fullstack#5252 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Urigo/accounter-fullstack#4919 ·
Maintainers usually reply within 2 days
All issues in Urigo/accounter-fullstack
Similar issues
-
area: integrations documentation priority: P2 size: XS
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
eddiejaoude/StackDash#798 ·
Maintainers usually reply within 1 day
-
bot:ai-assisted component:midnight-js status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
midnightntwrk/midnight-js#1790 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
area:vscode bug has repro platform:macos platform:vscode regression
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
anthropics/claude-code#113502 ·
-
Add: Rajdhani TV HDOpencheck:passed streams:add
Difficulty 1/5 Under an hour Newbie friendliness 77/100
Maintainers usually reply within 1 day