Dolibarr / dolibarr

Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.
https://www.dolibarr.org
GNU General Public License v3.0
5.46k stars 2.79k forks source link

Margin module gets confused by negative values #23028

Open svewa opened 1 year ago

svewa commented 1 year ago

Bug

I have a position which comes at a negative price, and if I order the position with my supplier it also has a negative price for me. So If I enter the selling price and my procurement price at -1€ each, I end up with a procurement price of +1€, selling for -1€ netting me -2€. I'd expect it to be procurement for -1€ too resulting in 0€.

Environment Version

16.0.0

Environment OS

Ubuntu 22.4

Environment Web server

apache2.4.51

Environment PHP

8

Environment Database

No response

Environment URL(s)

No response

Expected and actual behavior

No response

Steps to reproduce the behavior

create a proposal, buying for -1€ and selling for -1€ (margins module enabled).

Attached files

Screenshot from 2022-11-28 16-01-12

ksar-ksar commented 1 year ago

Hello,

It is still the case with V18 ?

svewa commented 1 year ago

yes, still the case.

svewa commented 1 year ago

dolibarr

svewa commented 3 weeks ago

Issue did not change since v16. Screenshot was just taken after upgradint to 20.0.1 Screenshot from 2024-10-23 13-56-40