etendosoftware / etendo_core

Etendo Classic source code
10 stars 11 forks source link

ETP-50: When you create a payment in from a cloned invoice, the collection comes out as an prepayment. #345

Closed juanfunes1996 closed 2 months ago

juanfunes1996 commented 7 months ago

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

  1. Go to the sales invoice window
  2. Select an invoice and click on the clone button.
  3. The new invoice will have in the dateinvoice and dateacct fields the dates it was cloned with the time it was cloned.
  4. Go to payment in window.
  5. Create a collection in and the collection date must be the same as the date of the cloned invoice.
  6. Go to the financial account of the payment In.
  7. Posts the transaction related to the payment.
  8. Accounting History will show that the field was posted as an prepayment.

https://github.com/etendosoftware/etendo_core/assets/143511686/4caecfc5-ca0e-49f0-abe4-a9e0b0139927

Captura desde 2024-03-26 10-22-41 Captura desde 2024-03-26 10-26-49

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:

valeg-etendo commented 2 months ago

[!IMPORTANT] Bug resolved in version 24.2.6.