contract icon indicating copy to clipboard operation
contract copied to clipboard

[16.0][BUG] contract: 'last_date_invoiced' is not calculating correctly on the lines.

Open flalexg opened this issue 1 year ago • 0 comments

Module

contract

Describe the bug

The field last_date_invoiced is not computing correctly.

To Reproduce

Affected versions: 16.0

Steps to reproduce the behavior:

  1. We create a contract with 2 lines
  2. We set the start date a 1/1/24 and a recurrence of every 1 week, with the invoing type as pre-paid.
  3. We generate an invoice. First error.
  4. Copy the existing contract, add 2 lines and generate an invoice. Second error

First error image

If we look, the Date of Next Invoice is set correctly at 8/1/24.

The 'Last Date Invoiced' on the first line is correctly set at 7/1/24, but on the second line is set at 14/1/24.

Second error

If we copy the previous contract and we add 2 more lines, when we generate the first Invoice, the field 'Last Date Invoiced' of the copied lines is not set and the lines aren't added at the invoice. image image

Expected behavior The expected behaviour on the first error should be setting on all the lines the same 'Last Date Invoiced' because the recurrence is set in a global level and not in a line leve.

Additional context Add any other context about the problem here. (e.g. OS, Python version, ...)

flalexg avatar Mar 21 '24 15:03 flalexg