OCA / agreement

GNU Affero General Public License v3.0
8 stars 40 forks source link

Agreement Rebate - Issue in behaviour #36

Open SIC-brunorocha opened 4 months ago

SIC-brunorocha commented 4 months ago

Disclaimer

I believe I'm reporting a bug, based on what I suppose should be the behaviour of the module. The module documentation did not explain this, so I'm reporting so it can be addressed.

Module

agreement_rebate

Describe the bug

If a settlement is already made, the next does not take into the consideration that amount already returned to the client

To Reproduce

V16

Steps to reproduce the behaviour: 1.Define sections exemple: 0 --> 1k€ get 5% ; them 1001---> 5k€ get 10%, 10k gets 20% 2.Start invoicing the client

  1. The client ends hitting the 1000 mark and now as for example, 50 € to receive based on the rebate made.
  2. Settlement made and keep invoicing
  3. The next mark is achieved, and we invoiced 11.5k to the client, after rebase it gets 3400 € in favour of the client.
  4. [Bug] - The previous 50€ are not take into consideration

Expected behaviour

  1. Recalculate based on the settlement already made
SIC-brunorocha commented 4 months ago

Screenshot_2 Excel with a case study I used

pedrobaeza commented 4 months ago

The system is not prepared right now to do rebates over the same period, and that's why you get this. It will be simply to exclude the refund invoices coming from rebates, and it doesn't hurt any of the possible flows. Please propose a PR with that patch.