Observed some… “unexpected” behavior today. I sold a product yesterday, today the customer wanted to exchange it for something else. I cloned the original sales invoice #1983, which had a laptop product for $700 and $100 discount for a total of $600. On the cloned invoice I set quantity on the original product to “-1” and added the other products he was buying. At the end, I noticed the pricing seemed way off. Turns out the $100 discount on the product was being added the wrong way. It was taking the $700 price and ADDING $100, so it was giving him a $800 refund, or $200 extra dollars! I the new cloned invoice is #1985. I have attached both. This is in Manager cloud v. 21.3.97.

After messing with it further, I realize now I should do a credit note or something instead to handle the refund first. Discounts worked fine that way. But still, it seems bad that a discount works backwards on a sales invoice with negative quantity. Please consider fixing this behavior. I wonder if it has burned me other times without realizing it.

It does not work backwards. You need to understand that a clone is not a reversal just because you enter a negative quantity. Cloning just makes a duplicate of a previous transaction on a new form, ready for editing and eventual creation. That is why, when you clone a sales invoice, the button at the bottom is a Create button, not an Update button.

So, in your situation, you had two things occurring on your new sales invoice:

A quantity being multiplied by a unit price (-1 x 700 = -700) and

An exact amount discount (100) being subtracted from the result to yield the line item amount (-700 -100 = -800).

The -800 figure was treated as a credit. Since it was negative, it reduced the income account to which it was posted. A credit note on the other hand, whether created manually or by copying from the sales invoice, would have had all positive numbers. And the result [(1 x 700) -100 = 600] would have been debited to the income account, also reducing its balance, but only by the desired 600.

Note that both the sales invoice and credit note perform the calculation the same way, that is: quantity times unit price minus discount. The key difference between the two approaches is that, when you properly use a credit note, the discount is subtracted from a positive amount and then debited. When you incorrectly try to do the same thing with a negative sales invoice quantity, the discount is subtracted from a number that is already negative and then credited. Looked at another way, you are giving the customer the discount twice, even though the item was returned.

Having said all that, it is possible to accomplish the same thing correctly with a sales invoice. This could be attractive when the customer is buying additional items in addition to returning something from a prior transaction. But, in addition to making the quantity negative, you must also make the discount negative.

I guess the root cause of this issue, then, is it was not obvious that the discount had to also be made negative. It did not occur to me to try making the discount also negative. That’s not normally how discounts work, so it didn’t occur to me. To me this is a UX (user experience) problem considering it didn’t intuitively work the way I think most people would expect it to. I understand what the app did, but that was very different than what was expected.

That is because you are used to discounts being applied on positive numbers to reduce a price.

Well, if you are going to reverse something, you have to reverse all of it. Instead, you reapplied the discount. If you had used a credit note, where every aspect of it is automatically reversed (debit for credit), it would have seemed more intuitive, but the accounting would have been identical. Accounting isn’t always intuitive. Sometimes, it seems merciless, because every mistake is punished twice over.

Looking at your 2 PDF files as you righty concluded the mistake is with how a discount can be applied. To help with the logic look at the steps you did before, ie. You had qty = +1 x 700 with a +1 x discount of 100 resulting rightly in 600. Now you changed the multiplier so qty = -1 x 700 = -700 The logic would follow that -1 would also be the multiplier for the discount. So -1 * 100 = -100 and adding that to - 700 would give as in PDF -800. So if to follow the logic the discount also needs to be a negative number as two negatives would create a positive so -1 * -100 = 100. The result would be -700 + 100 = -600. I think this was concluded but it is not counterintuitive as claimed. What would be strange is if the multiplier of -1 would have only be applied to the principal and not to the discount. As the principal was a positive number with multiplier 1 and turned into a negative number with mulitplier -1 it follows that the discount, although listed as a positive number but as is taken away is actually a negative one that the result of 2 negatives would result in a positive 100.

My initial expectation was that a discount would always first modify the unit price, then that amount be added/subtracted based on positive or negative quantity. But I see how that might result in unexpected discounts depending if it was a discount percentage or exact amount, especially for quantities greater than 1.

I did figure it out with a credit note, so I guess that’s better, but certainly it takes more steps to accomplish.

After cloning you change qty from 1 to -1 and you kept the Unit price at +700 and discount at +100 the caluclated total shows then -800 while it should have been -600. If you want to keep using this method just changed the discount as if multiplyig with -100 as the -1 mulitplies with the +700. You will see if you change the discount to -100 the total changes to -600. Obvioulsy much better to use Credit note but if you wanted a shortcut as you applied before than this is an option also.