236053cd7f
Kategoriserer danske regnskabs-/ERP-skills, ERP-data-afstemnings-
skill og to devops-workflows (gitea-issue-agent, kanban-workflows)
som Radix-medlemmers AI-agenter kan dele.
Struktur:
skills/<kategori>/<skill-navn>/SKILL.md
skills/<kategori>/<skill-navn>/{references,templates,scripts}/
Indekseret af index.json (genereret af scripts/rebuild_index.py).
Kør `python3 scripts/rebuild_index.py --check` i CI for at fange
synkroniseringsfejl.
90 lines
3.6 KiB
Markdown
90 lines
3.6 KiB
Markdown
# Coop-Uniconta import UI + Payment_advice lessons
|
||
|
||
Use this reference when building or fixing a Coop/Uniconta reconciliation webapp import flow.
|
||
|
||
## Required import sources
|
||
|
||
The user expects five uploadable source types, not a generic two-source UI:
|
||
|
||
1. **Uniconta Coop Debitor / betalingsfordeling**
|
||
- Shows how Coop payments are allocated across invoices/credits.
|
||
- Primary bridge from payment to invoice lines.
|
||
2. **Uniconta/ERP fakturaliste — all Coop invoices for the year**
|
||
- Complete invoice/credit-note list for the relevant year.
|
||
- Primary source for "has Coop paid all invoices?".
|
||
3. **Coop kontoudtog**
|
||
- Account statement from Coop's system.
|
||
4. **Bankkontoudtog — all Coop postings**
|
||
- Bank statement filtered to Coop-related transactions.
|
||
5. **Coop Payment_advice documents**
|
||
- PDF and Excel files, uploaded continuously as they are collected.
|
||
- Needed to identify and explain regulations, fees, bonuses, fines, credits, and offsets.
|
||
|
||
If a UI only shows "Coop" and "Uniconta", treat that as a workflow bug even if the backend has more enum choices.
|
||
|
||
## Fiscal year and monthly reporting
|
||
|
||
- Fiscal year is calendar year: 1/1–31/12.
|
||
- Store/report month for every data source.
|
||
- Keep invoice month/year separate from payment month/year.
|
||
- Coop can have around 3 months of credit: December 2025 invoices may be paid in March 2026. Cross-year payment timing is expected and should be visible, not automatically flagged as an error.
|
||
|
||
## Payment_advice ingestion pattern
|
||
|
||
Implement Payment_advice as a real source early, even before final matching logic is known.
|
||
|
||
Recommended flexible model fields:
|
||
|
||
- source file
|
||
- accounting year (nullable when no date can be inferred)
|
||
- document date
|
||
- payment date
|
||
- document/bilag number
|
||
- voucher number
|
||
- invoice number
|
||
- amount
|
||
- classification: `unknown`, `payment`, `bonus`, `fee`, `fine`, `adjustment`, `credit`
|
||
- raw text
|
||
- raw JSON / raw row data
|
||
- raw sheet name / row index
|
||
|
||
## Parser approach
|
||
|
||
For Excel:
|
||
- Read all sheets.
|
||
- Store raw row JSON.
|
||
- Best-effort infer date from date-like columns (`Dato`, `Date`, `Betaling`, `Forfald`).
|
||
- Best-effort infer amount from amount-like columns (`Beløb`, `Amount`, `Total`, `Netto`, `Moms`); if multiple amounts appear, pick the largest absolute amount as a temporary headline amount.
|
||
- Extract invoice/voucher/document IDs from matching column names.
|
||
|
||
For PDF:
|
||
- Store file even if text extraction is poor.
|
||
- Try `pypdf` / `PyPDF2` text extraction if available.
|
||
- Infer date and amount from filename + extracted text.
|
||
- Mark whether text was extracted.
|
||
|
||
Do not reject Payment_advice uploads just because final parser rules are not complete. The key is preserving raw documents/data so later parser improvements can be applied.
|
||
|
||
## UI copy / workflow guidance
|
||
|
||
On the import page, list the five source types in the same order as the user's workflow. Explain that data is split into accounting years by date, and that Payment_advice can be uploaded gradually.
|
||
|
||
For monthly dashboard rows, include at least:
|
||
|
||
- Coop postings count/sum
|
||
- Uniconta postings count/sum
|
||
- Bank postings count/sum
|
||
- Invoice list count/sum
|
||
- Payment allocation count, debit, credit
|
||
- Payment_advice count/sum
|
||
- Payment_advice classifications per month
|
||
|
||
## Minimum regression tests
|
||
|
||
Add tests that verify:
|
||
|
||
1. The upload page renders all five source labels and accepts PDF for Payment_advice.
|
||
2. Payment_advice Excel import preserves raw row data and derives accounting year/month.
|
||
3. Payment_advice classification detects at least a bonus/regulation example.
|
||
4. Existing invoice/payment allocation tests still pass after adding the new source.
|