When cloning a sales invoice, the dateinvoice and dateacct fields are saved with the date the invoice was cloned but have the information of the hour, minute and second it was cloned, which generates a payment as an prepayment.
Steps to reproduce the error
Go to the sales invoice window
Select an invoice and click on the clone button.
The new invoice will have in the dateinvoice and dateacct fields the dates it was cloned with the time it was cloned.
Go to payment in window.
Create a collection in and the collection date must be the same as the date of the cloned invoice.
Go to the financial account of the payment In.
Posts the transaction related to the payment.
Accounting History will show that the field was posted as an prepayment.
In the cloned invoice the fields must have the date that was cloned but the time must be 00:00:0.00. This way when posting the payment it will not be generated as prepayment (see attached image).
Affected Version
¿Latest/Specific?
Version number:
Etendo Core: 23.4.5
Solution Design (optional)
Attached is a patch for the CloneInvoiceHook class with the solution to the bug. In the task
Error's description
When cloning a sales invoice, the dateinvoice and dateacct fields are saved with the date the invoice was cloned but have the information of the hour, minute and second it was cloned, which generates a payment as an prepayment.
Steps to reproduce the error
https://github.com/etendosoftware/etendo_core/assets/143511686/4caecfc5-ca0e-49f0-abe4-a9e0b0139927
Required Configurations (if necessary)
Expected behavior
In the cloned invoice the fields must have the date that was cloned but the time must be 00:00:0.00. This way when posting the payment it will not be generated as prepayment (see attached image).
Affected Version
¿Latest/Specific? Version number: Etendo Core: 23.4.5
Solution Design (optional)
Attached is a patch for the CloneInvoiceHook class with the solution to the bug. In the task
Other test cases
Given: When: Then: