Closed Leestex closed 6 months ago
Thanks for the report.
You are right about issue 1. This is just plain wrong https://github.com/premium-minds/billy/blob/5387f05e175cd93ebd5bdfe0698ac662377aee21/billy-portugal/src/main/java/com/premiumminds/billy/portugal/services/export/webservice/Client.java#L117
Your proposed solution, however is wrong. The Application Tax Number is not the same as the Business Tax Number.
Unfortunately, the solution requires a breaking change to the Client deleteInvoice
methods.
I believe you are incorrect about issue 2. The DeleteInvoiceRequest does not need a CashVATSchemeIndicator.
I’ve encountered issues with the
Client.deleteInvoice(...)
function in the Billy Portugal module, which is intended to facilitate the deletion of invoices from the Portugal Tax Service (AT). Specifically, there are two main problems that prevent the successful execution of this function.Issue 1: Incorrect Tax Registration Number
The method mistakenly uses the application’s
SoftwareCertificationNumber
as theTaxRegistrationNumber
in the SOAP request, leading to an error when interacting with the AT SOAP web service. The erroneous line is:https://github.com/premium-minds/billy/blob/5387f05e175cd93ebd5bdfe0698ac662377aee21/billy-portugal/src/main/java/com/premiumminds/billy/portugal/services/export/webservice/Client.java#L117
The AT service responds with a validation error:
A potential fix could involve using the
DeveloperCompanyTaxIdentifier
as theTaxRegistrationNumber
:(Note: Further review may be needed regarding type casting.)
Issue 2: Missing
CashVATSchemeIndicator
The
CashVATSchemeIndicator
is not set in thedeleteInvoice
SOAP request, unlike its presence in thesendInvoice
request: https://github.com/premium-minds/billy/blob/5387f05e175cd93ebd5bdfe0698ac662377aee21/billy-portugal/src/main/java/com/premiumminds/billy/portugal/services/export/webservice/Client.java#L225-L227 resulting in another error from the AT service:A possible solution involves adding a check and setting the CashVATSchemeIndicator similar to how it’s handled in the invoice sending process:
Are there any suggestions or fixes for these problems?