CV302

The rule sets below word this rule differently; each wording is shown with its rule set.

error: the document is invalid

Why it fails

  • A code written by its name or with spaces (Kuala Lumpur instead of 14, MY instead of MYS).
  • A unit of measure from another list, such as PCS or UNIT; MyInvois takes UN/ECE Recommendation 20 codes (C62 for one, HUR for an hour).
  • A classification without its leading zeros (3 instead of 003).

How to fix it

Take the code from the code tables of the MyInvois SDK (Codes): classification, MSIC, state, country, currency, tax type, payment mode and unit of measure.

What the rule checks

As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element.

Message

ItemCode … does not exist in CodeType EInvoiceTypes: the e-invoice type (InvoiceTypeCode) is 01 (invoice), 02 (credit note), 03 (debit note), 04 (refund note), or 11 to 14 for the self-billed ones.

Context
/*
Test
$type = my:codes('type')

Checked with MyInvois e-Invoice

Message

ItemCode … does not exist in CodeType CurrencyCodes: the document currency (cbc:DocumentCurrencyCode) is not in MyInvois's currency codes.

Context
/*
Test
$currency = ('', my:codes('currency'))

Checked with MyInvois e-Invoice

Message

ItemCode … does not exist in CodeType PaymentMethods: the payment mode (PaymentMeansCode) is one of 01 to 08.

Context
/*
Test
every $p in cac:PaymentMeans/cbc:PaymentMeansCode satisfies normalize-space($p) = my:codes('payment')

Checked with MyInvois e-Invoice

Message

ItemCode … does not exist in CodeType MSICSubCategoryCodes: the MSIC code (cbc:IndustryClassificationCode) is not in the Malaysia Standard Industrial Classification codes.

Context
/*/cac:AccountingSupplierParty/cac:Party | /*/cac:AccountingCustomerParty/cac:Party
Test
$msic = ('', my:codes('msic'))

Checked with MyInvois e-Invoice

Message

ItemCode … does not exist in CodeType CountryCodes: a country is an ISO 3166-1 three-letter code, such as MYS (the …'s address).

Context
/*/cac:AccountingSupplierParty/cac:Party | /*/cac:AccountingCustomerParty/cac:Party
Test
$country = ('', my:codes('country'))

Checked with MyInvois e-Invoice

Message

ItemCode … does not exist in CodeType StateCodes: a state (cbc:CountrySubentityCode) is one of 01 to 17 (the …'s address).

Context
/*/cac:AccountingSupplierParty/cac:Party | /*/cac:AccountingCustomerParty/cac:Party
Test
$state = ('', my:codes('state'))

Checked with MyInvois e-Invoice

Message

ItemCode … does not exist in CodeType ClassificationCodes: a line's classification is one of 001 to 045.

Context
/*/cac:InvoiceLine
Test
every $c in $classes satisfies normalize-space($c) = my:codes('classification')

Checked with MyInvois e-Invoice

Message

ItemCode … does not exist in CodeType UnitTypes: the unit of measure (unitCode) is a UN/ECE Recommendation 20 code from MyInvois's list.

Context
/*/cac:InvoiceLine
Test
$unit = ('', my:codes('unit'))

Checked with MyInvois e-Invoice

Message

ItemCode … does not exist in CodeType CountryCodes: the country of origin is an ISO 3166-1 three-letter code.

Context
/*/cac:InvoiceLine
Test
$origin = ('', my:codes('country'))

Checked with MyInvois e-Invoice

Message

ItemCode … does not exist in CodeType TaxTypes: the tax type (cac:TaxCategory/cbc:ID) is 01 to 06, or E for a tax exemption.

Context
cac:TaxSubtotal
Test
$category = ('', my:codes('tax'))

Checked with MyInvois e-Invoice