# DC502

Source: https://xmlvalid.com/rules/DC502

> If the document currency is …, all currency codes for amounts should also be …; this document has amounts in ….

- Level: error
- Rule sets: MyInvois validations of LHDN (Malaysia) MyInvois SDK of 25 September 2026
- Context: `/*`
- Test: `$currency = '' or empty($others)`

## Why it fails

- The document is in a foreign currency, but some amounts were written in MYR (often the tax amounts, without TaxCurrencyCode).

## How to fix it

- Write every amount in the document currency; to report the tax in MYR, give TaxCurrencyCode MYR and the exchange rate in `cac:TaxExchangeRate`.

Validate a document against these rules: https://xmlvalid.com/validate
