Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #870 +/- ##
==========================================
+ Coverage 96.88% 96.90% +0.01%
==========================================
Files 335 336 +1
Lines 15916 15973 +57
==========================================
+ Hits 15421 15478 +57
Misses 494 494
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds two new DIAN (Colombia) addon extensions to document item identification scheme and VAT regime, updates the generated addon data and changelog, and aligns the EN16931 generated rules to rely on the existing “VATEX or exemption note” validation.
Changes:
- Add
co-dian-item-identificationandco-dian-regimeextension definitions to the DIAN addon (Go source + generated addon JSON). - Update
CHANGELOG.mdto document the new DIAN extensions. - Remove the EN16931 rule that always required
cef-vatexfor exempt taxes (consistent with existing EN16931 logic that allows VATEX or exemption notes).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| data/rules/eu-en16931.json | Removes the generated rule that forced VATEX on exempt tax combos (now relying on the existing “VATEX or exemption note” validation). |
| data/addons/co-dian-v2.json | Adds the two new DIAN extension definitions to the generated addon data. |
| CHANGELOG.md | Notes the two new DIAN extensions under Unreleased. |
| addons/co/dian/extensions.go | Implements the two new DIAN extension definitions in the source addon definition list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
44d6e27 to
6728147
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (2)
addons/co/dian/bill_invoices.go:173
codeis an optional invoice field, but this rule relies onis.Matchestreating empty strings as valid. Usingrules.AssertIfPresentmakes the optionality explicit and avoids accidental behavior changes ifis.Matchessemantics change later.
rules.Field("code",
rules.Assert("15", "invoice code must be a positive integer without leading zeroes",
is.Matches(`^[1-9][0-9]*$`),
),
),
addons/co/dian/bill_line.go:11
- The comment says DIAN rejects “zero-amount lines”, but the validation only checks that
quantityis positive. Either adjust the comment to match the rule, or validate a computed monetary field (e.g.,total) if that’s what DIAN actually requires.
// Code 01: DIAN rule FAW01 rejects zero-amount lines, so quantities must be positive
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
addons/co/dian/bill_invoices.go:172
- This rule relies on is.Matches treating an empty string as valid, so invoice codes can be blank (as your tests cover). The assertion message currently reads like it always requires a positive integer; consider clarifying that the constraint applies only when a code is provided.
// Code 15: DIAN numbering requires plain positive integers
rules.Field("code",
rules.Assert("15", "invoice code must be a positive integer without leading zeroes",
is.Matches(`^[1-9][0-9]*$`),
),
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
addons/co/dian/bill_line.go:11
- The comment says this rule targets “zero-amount lines”, but the validation enforces only that
quantityis positive (it doesn’t cover other ways a line amount could be zero). To avoid misleading future readers, reword the comment to match the actual constraint being enforced.
// Code 01: DIAN rule FAW01 rejects zero-amount lines, so quantities must be positive
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (2)
addons/co/dian/bill_invoices.go:173
- The invoice code format rule (15) applies to all DIAN invoices, including
proforma(which is explicitly allowed by rule 01). If proforma documents are intended to behave like drafts, this will incorrectly reject common non-numeric proforma codes (e.g.PROF-001). Consider scoping rule 15 tostandard,credit-note, anddebit-note(or explicitly excludingproforma) to match the other DIAN-specific constraints (e.g. rule 18 already skips proformas).
// Code 15: DIAN numbering requires plain positive integers
rules.Field("code",
rules.Assert("15", "invoice code must be a positive integer without leading zeroes",
is.Matches(`^[1-9][0-9]*$`),
),
),
addons/co/dian/bill_line.go:13
- The comment says DIAN rejects “zero-amount lines”, but the rule only enforces a positive
quantity. Sinceorg.Item.Pricecan be zero, a line can still have a zero amount even with a positive quantity. Either adjust the comment to reflect what’s actually validated, or extend validation to check the calculated line amount instead.
// Code 01: DIAN rule FAW01 rejects zero-amount lines, so quantities must be positive
rules.Field("quantity",
rules.Assert("01", "must be greater than 0", num.Positive),
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
addons/co/dian/bill_invoices.go:172
is.Matchesintentionally returns true for empty strings, so this assertion currently allows an empty invoice code even though the description says it must be a positive integer. If the intent is “validate format only when present” (as the tests suggest), make that explicit withrules.AssertIfPresentand update the message accordingly so we don’t rely on the surprising “empty matches” behavior ofis.Matches.
// Code 15: DIAN numbering requires plain positive integers
rules.Field("code",
rules.Assert("15", "invoice code must be a positive integer without leading zeroes",
is.Matches(`^[1-9][0-9]*$`),
),
addons/co/dian/bill_invoices.go:258
invoiceCreditSaleHasDueDatetreats any non-nildd.Dateas a valid due date. A non-nil but zero-value date (e.g.&cal.Date{}) would satisfy this rule even though it effectively carries no due date.
for _, dd := range inv.Payment.Terms.DueDates {
if dd != nil && dd.Date != nil {
return true
}
090294d to
bff7fa0
Compare
d7351c4 to
d5a719d
Compare
- co-dian-item-identification: product-coding standard for a line item's code (001 UNSPSC, 010 GTIN, 020 customs tariff, 999 taxpayer's own standard), for UBL StandardItemIdentification/ID@schemeID. - co-dian-tax-scheme: the tributo the party is responsible for, per DIAN Anexo Tecnico v1.8 table 13.2.6.2 (01 IVA, 04 INC, ZA IVA e INC, ZZ No aplica), for the UBL PartyTaxScheme/TaxScheme group. - Invoice rules 15-18: plain positive integer code, credit-note restrictions when the preceding document lacks a dian-cude stamp (no concept 2, period within one calendar month), and payment due date required on credit sales (DIAN rule IA04). - Line rule 01: quantity must be positive (DIAN rule FAW01). - Regenerate data/addons/co-dian-v2.json.
d5a719d to
b45eb8e
Compare
co-dian-item-identificationextension to carry the DIAN standard product code on line items.co-dian-tax-schemeextension to declare the party's tributo per DIAN table 13.2.6.2 (01IVA /04INC /ZAIVA e INC /ZZNo aplica), with the Anexo Técnico v1.8 PDF as structured source.15: invoice code must be a positive integer (empty draft codes still pass).16: credit notes without adian-cudestamp (91-22, sin referencia) cannot use credit code2(DIAN rule CBF03a).17: the period credited by a 91-22 note must stay within one calendar month (DIAN rule CAE02).18: a payment due date is required when the invoice is not fully paid (DIAN rule IA04).BILL-LINE-01: line quantities must be positive (DIAN rule FAW01 rejects zero-amount lines).Pre-Review Checklist
go generate .to ensure that the Schemas and Regime data are up to date.And if you are part of the org: