Thursday, August 8, 2024
1 change · master
Resolved issues and error corrections
Peruvian invoices are now checked to avoid duplicate invoice names when companies share the same RUC. This prevents reporting collisions with SUNAT and helps businesses avoid submission errors or compliance issues.
Original PR description
In Peru, the name we use to report an invoice to SUNAT is composed from the sending company's RUC, the document type code and the numbers from the invoice name. To avoid collisions when sending to SUNAT, we want to prevent Peruvian invoices from having the same name if they belong to companies with the same RUC. Note: I wanted to implement this as a SQL constraint originally, but since some of the data that should be taken into account for the constraint (company fiscal country being Peru, company RUC) doesn't reside in the account.move table, I think the only option is to make this a Python constraint. This means it would not be added on upgrade, but would be active for all invoices in the new version. opw-3900393