ERPNext Conference 2019* ERPNext.com Blog

Calculate total quantity from sales invoice item table (Bonus item for customer)


#1

Hi everyone!
This is my first post here. In our pharmaceutical business we give bonus item to customer if they purchase a certain number of items as shown in the screenshot below.


I’ve added the bonus column in sales invoice item table. What I want is that below the table total quantity will be calculated including the bonus quantity and the calculated total will be deducted from the stock. For example, in the screenshot it is showing 10. I want it to be 11 and 11 items should be deducted from stock. How can I achieve this?
Thanks in advance.


#2

You have to write custom script for Doctype Sales Invoice to add the Bonus quantity in Total Quantity.


#3

Thanks. But how can I find necessary variables?


#4

So it was adding before, what you need to do is to add the the bonus qty variable to total qty.
Hope this will help.


#5

@Faisal_Pasha Did you figured out the way to handle bonus?


#6

No. I didn’t do it after that.