Vauxoo / cfdilib

Electronic document signature -- lib
http://cfdi.org
ISC License
5 stars 8 forks source link

[IMP] cfdilib: Removed automatic `NA` assignation to empty values #74

Closed luistorresm closed 6 years ago

luistorresm commented 6 years ago

CFDI 3.3 have a extensive catalog, then when is validated the xsd all the attributes are validated that the value assigned is found in the catalogs.

Before of this change, if the attribute in the dict values was empty, this was updated to set NA, but in CFDI 3.3, is validated that the value exist in the catalog, and take many time in compare the value.

Example in the attribute 'ClaveProdServ' that have 52828 records.

Now, if the value is empty only not add the attribute and do not take many time because only validate that the attribute is not found.

Why not only add a validation like if attribute '!=' 'NA', because the catalog to Unit Codes have the record NA - Miligramo por kilogramo and We could ignore that value.

Here a time:

captura de pantalla 2018-01-08 a la s 11 10 37
luistorresm commented 6 years ago

@nhomar

Could you merge this PR, please?

Regards