In this post, I will explain how to perform the calculations of the «mercancia» limits of the foreign trade complement.
Things you should know before.
- This post was written on February 19, 2020, you should verify that the validation rules are still valid in Anexo 20.
- The post deals with rule CCE216, only the calculation of limits of the «mercancia» node.
- The foreign trade complement is always expressed in USD.
- I will not use conversions between units of measurement.
- The numbers of decimals used for rounding are 2 in USD.
Example case:
I will use the following Cfdi for the tutorial:
Performing limit calculation:
I have coded a small console application to calculate the example and the utility class’s source code. The program takes the fixed inputs, it does not read the example file. You must be careful with the method you choose to read the file, if you take the cfdi data through serialization, the number of decimals may not match the original document. For example, 18.9000 in the cfdi can return in 18.9 in decimal or double object, for the program it is the same value for formulas no.
Points to consider.
The calculation of limits may vary depending on the language you use, the type of data or the accuracy of the calculations, this is more evident when handling numbers with many decimals.
References:
- NVL in SQL Server - 2023-11-01
- ¿Que es Cake Build? - 2023-02-22
- #How to fix error: MSB4019: The imported project «Microsoft.Data.Tools.Schema.SqlTasks.targets» was not found - 2023-02-20
2 comments On How to: Calculate limits on node «mercancías» of «Comercio Exterior» complement of Mexican invoices.
Pingback: How to: Write a 'ComercioExterior/Mercancia' node with 'ValorDolares' at 0. – Happy Devops ()
Pingback: How to calculate minimum value and maximum value of "Concepto" of "Comercio Exterior" complement of Cfdi in USD. – Happy Devops ()
Comments are closed.