Customer invoices - Wrong "Remain to pay" amount (due to negative value)

Hi, my dolibarr (21.0.1) show incorrect values as picture:

This is caused by negative value in invoices

Kindly report, thanks

what are you trying to do? why is the order in negative?

how did you create this invoice?

hi, in orders there is some negative value due to: discount, refund, pre-paid items, …

Invoice was created in batch from this menu

image

okay, What if you do them one at a time?

I do that, and I do not have any price differences. Are you using products or services as the discount?

Hi, the PDF invoice file is fine. The wrong information is at: Billing|payment → Customer Invoices → List

You can see example as 1st image of my first post

Hi @juanvn86
This happened because according to the numbers shown you should probably have issued a credit note instead.
The amount shown in the invoice is not negative because its not allowed to be, an invoice total must always be greater than zero.

Your work flow is wrong
An invoice contains only value of goods and/or services and discounts

For pre-paid items you either have to add the payment(s) after invoicing or invoice separately each item(This happens because Dolibarr is made from French devs with France laws in mind and that’s why there is the Down payment invoice option, but this does not apply for many other countries like yours and mine. Imo should be an option to record payments and link them to an invoice later.)

Refund is given to customer only after invoicing and only in case you have received more than the invoice amount, if though customer is a ‘regular’ you can both agree to issue a credit note that can be used as a deposit for next invoice.

Thank sonikf, I get your point.

But I still think this is a showing/printing bug and can be fixed. Because the Vendor Invoice module works fine even contains the negative values inside (image attached).

Some correction: my Customer invoice’s total value is greater than zero and the total value (to be paid) is correct, the bug is: “the un-paid amount” is greater than the “invoice total value”.

I’m not a financial guys, I’m just want to make my small business as simple as posible. My situation is like this:

My customer: I will order 1000 items but I need a free sample for examination first.
Me: Okay, but I will charge first sample and deduct it value when you make 1000 items order.

Then:

  • Order 1 - 1 item: I charge him $50
    After 1 month, he agrees to make 1000 items order
  • Order 2 - 1000 items: I have to add a line to refund $50 to him (a negative value).
    Then this issue happened.

ok let me check if i can replicate your finding and i’ll get back to you.

in this case your work flow could be:
a. invoice 1 item->invoice 1000 items->credit note 1 item
b. invoice 1 item ->invoice 999 items for $50 + 1 item for $50 with 100% discount
You should check with an expert if option b is applicable in your country.