Why do you put a “discount” on the incoming invoice and sales invoice.
Discount can go on outgoing invoice but not on the incoming invoice. On incoming invoices need to be added margin in relative and absolute terms, because this is a calculation of the price of goods at the entrance to the stock.

You maybe offered discounts for early payments, say 5% if paid within 7 days.
So if you want to take up that offer then you need to calculate that discount on the invoice

The Supplier sends you an invoice for 100 with terms of 5% discount if paid within 7 days.
Supplier doesn’t know if you are going to pay 100 or 95 until they get the money
You may or may not have enough money within 7 days to pay.

These are all assumptions until an actual action occurs.
Accounting is full of assumptions - depreciation guesses the life of an asset, provisions like doubtful debts guesses that a percentage of accounts receivables wont be collected - the list goes on.

And why not - discounts are an incentive on both sides. Discounts don’t become penalties
Double entry accounting requires equal signs to balance.

If the supplier offers a variable discount then the customer takes the discount subject to meeting to the number of days payment terms being met.
You can’t have a supplier offering a variable discount and the customer paying a penalty (increase) as the customer may not take up the variable discount offer - so just pays the full cost.

Well, as you get the difference in price.
The difference between the price on incoming invoices and invoices, your price difference, or your earnings, and leads to a gross margin account (difference in price).

I ask you again, where you are in his books run discounts from suppliers by 5%.

If you are in your books, you post a discount when purchasing goods then have undervalued stocks in the warehouse. What is the point of view of illegal accounting.

This is not true, @Dado. If you paid less for whatever reason, the cost of inventory in your warehouse is less, no matter why you paid less. Remember, your cost of goods sold does not relate to their potential sale price. It could be lower for several reasons:

Lower offered price from supplier

Discount for rapid payment

Discount for buying larger bulk quantities

Stock purchased from bankrupt competitor at liquidation auction

All of these are legitimate savings to your company and will increase your margin.

If the product invoice cost is 10 and you pay 9.50 after taking time payment discount then your warehouse cost is 9.50. That’s not undervaluing your stock as its showing the actual cost of the stock. To show the stock at 10 could be overvaluing the stock.

If the supplier gave a fixed discount on the invoice then the product would be 9.50, the payment would be 9.50 and the warehouse value would be 9.50. Where is the undervaluing.

Alternatively, you could take up the variable discount as an Income - Discount Received

Yes, you’re right.
But this is not your discount, but discounts from suppliers.
You do not have the discount but the price difference was positive or negative.
If it is positive you’ll make a profit, if it is negative you ostvarujte loss.
To me wrong does not understand.
The biggest problem with softverma accounting for the management of stock in the warehouse.
I am interested in your software, or some things we need to correct.