Discounts

199 views
Skip to first unread message

Slava

unread,
Jun 10, 2013, 7:43:12 AM6/10/13
to erpnext-u...@googlegroups.com
Hi there!
We're struggling to meet requirements of auditors and now we're stuck with discount issue. We need it to be shown in the invoice (as total discount amount) and we also need it to be accounted as expense, so we can print ledger of discounts. We're using discount column and find it very comfortable, because we often have different discounts in one invoice. Unfortunately this way doesn't give us possibility to see total discount and also to make discount ledger. 
One solution could be to put discount line into Taxes and Charges, put actual type and tick Tax included in Basic Rate, but the program doesn't allow this. 
Kindly suggest some solution.

Best wishes,
Slava

Umair Sayyed

unread,
Jun 10, 2013, 7:58:06 AM6/10/13
to ERPNext User's Forum
Slava,

The later work solution of adding a row in Tax and Other charges table should work for you. In Sales Tax & Other Charges master, you can only select Accounts of two types. Tax and Chargeable. Expense account is not available for selection on Sales but in Purchase tax master.

Hence, the Account Type of Discount ledger created under Expense Group should be "Chargeable". You can change the Account Type from the ledger master. Click on ledger and Edit to change it's account type.


Hope this helps.



--
You received this message because you are subscribed to the Google Groups "ERPNext User's Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-fo...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Thanks and Regards,
Umair Sayyed
www.erpnext.com

Anand Doshi

unread,
Jun 10, 2013, 7:59:41 AM6/10/13
to erpnext-u...@googlegroups.com
Hi Slava,

You can make a report to get the total discount value for each Invoice. 

You can use a query like:
select name, (
select qty * (ifnull(ref_rate, 0) - ifnull(base_ref_rate, 0)) 
from `tabSales Invoice Item` 
where `tabSales Invoice Item`.parent = `tabSales Invoice`.name
) from `tabSales Invoice` where docstatus=1

You can then create a Journal Voucher to book the total as an expense.

This seems, to me, a much simpler solution, unless you want to show the discount values in the Sales Invoice itself.

Thanks,
Anand.


Anand Doshi

unread,
Jun 10, 2013, 8:07:03 AM6/10/13
to Anand Doshi, erpnext-u...@googlegroups.com
Hi Slava,

Oops! Incorrect fields. Please find the corrected query here: http://pastebin.com/0TbKq8FG

Thanks,
Anand.

Slava

unread,
Jun 11, 2013, 1:21:05 AM6/11/13
to erpnext-u...@googlegroups.com
Dear Umar,
Account type was not a problem, it was Chargeable. The problem is that the software doesn't allow to choose Actual Type and Tax included in Basic Rate at the same time. I get a message < 'Is this Tax included in Basic Rate?' (i.e. Inclusive Price) is only valid for charges of type: * On Net Total * On Previous Row Amount * On Previous Row Total>. On Net Total we can't use because lines have different discounts.
And also if this box is ticked, discount will be not shown in the print form. Can these things be solved somehow?

Thanks,
Slava


To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

Umair Sayyed

unread,
Jun 11, 2013, 3:21:53 AM6/11/13
to ERPNext User's Forum
Hi Slava,

Functionally tax is always applicable on Net Total, Preview Row Total and Previous Row Amount. Tax Inclusive feature is available for these option and not available for Actual expense.

When check Include Tax in Basic Price, it updates the item's basic rate by the % of tax mentioned. Since we are entering discount in Actual, system cannot understand how to distribute it among multiple items.

If you are using Inclusive Tax feature, then discussed workaround for wholesome discount won't work. You should mention discount applicable on item level only.



To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-fo...@googlegroups.com.

Slava

unread,
Jun 11, 2013, 5:29:32 AM6/11/13
to erpnext-u...@googlegroups.com, Anand Doshi
Dear Anand, 
Thanks for report code!
Although it is useful it not at all a solution. If we already have discount in the invoice (in lines), how can we make a JV for discount and book it as expense? Than balance will not tally. Correct way (at least for us) would be to book discount in the invoice itself so then we see discount in the invoice:
Net Total1,497.50
Discount-404.32
Grand Total1,093.18
Rounded Total1,093.00
And each invoice makes 3 entries (without taxes) in the ledger: 3rd party-Sales, Discount-3rd party, 3rd party-Sales. 

I don't know how common is this requirement (we're audited by CAG India). If our case is unique and we need a customisation - pl let me know, how  can we order it.

Thanks,
Slava

Anand Doshi

unread,
Jun 11, 2013, 6:30:22 AM6/11/13
to Slava, erpnext-u...@googlegroups.com, Anand Doshi
Hi Slava,

In the current system, the discounted value of the item is booked as Income.

From what I understand, you are looking to book the non-discounted (price list) amount of item as Income and the discount amount (price list value - discounted amount) as an Expense, which effectively is same as above.

Is this a requirement by the tax system? Or do you just want to keep track of discounts?

Thanks,
Anand.

Slava

unread,
Jun 11, 2013, 6:53:21 AM6/11/13
to erpnext-u...@googlegroups.com, Slava, Anand Doshi
Anand,
Yes, your understanding is correct. This is the requirement of an external auditor.
Slava

Anand Doshi

unread,
Jun 11, 2013, 7:04:23 AM6/11/13
to Slava, erpnext-u...@googlegroups.com, Anand Doshi
In that case, unless you have standard discounts on each Item, you won't be able to maintain Item wise discount.

If you have standard discounts, you can create an account with name like "Discount 10". It should be of type Charge, so that it can be added to taxes and charges. However, it should come under expense in the chart of accounts.

If certain items don't have -10% discount but have -5%, you can add that in the Item Tax table of the Item form.

In the invoice, you can have a "Discount 10" tax entry, of type On Net Total. You shouldn't put it as "Included In Rate", since this isn't an inclusive tax. You want the full value of Item Amount to be booked as Income (Cr.) and the Discount as Expense (Dr).

Since the rate is negative, it will reduce the grand total, thus acting as discount. Also, since the value will be negative the GL Entry will be a debit entry (hence a positive expense entry).

Else, if you don't have standard discounts, you can have an Actual type tax with account like "Flat Discount" and a negative value.

I think this should work. 

Thanks,
Anand.

Slava

unread,
Jun 11, 2013, 7:31:57 AM6/11/13
to erpnext-u...@googlegroups.com, Slava, Anand Doshi
Yes, we have standard discounts. It would be real solution if each item can have specified discount. But as I just experimented if I have 5 items in the invoice and one of them has -5% specified in item table and I set -10% discount on net total, it doesn't make any change, all items get -10% discount. Where's my mistake?

Anand Doshi

unread,
Jun 11, 2013, 7:52:55 AM6/11/13
to Slava, erpnext-u...@googlegroups.com, Anand Doshi
Go to that particular Item and create a row in Item Tax table in the Item form for the discount account and rate as -5

Then try creating a new Sales Invoice and it should calculate discount at -5% only for that Item but at -10% for the rest of the items.

-Anand.

Slava

unread,
Jun 12, 2013, 1:18:20 AM6/12/13
to erpnext-u...@googlegroups.com, Slava, Anand Doshi
It works, just needed to create a new invoice. Thanks a lot, Anand!
As soon as you complete user manual I think you will have less queries like this :)

Best of luck,
Slava

Rushabh Mehta

unread,
Jun 12, 2013, 3:19:08 AM6/12/13
to ERPNext User's Forum
Slava,

You can also contribute to help us build the manual by writing a blog or something. We provide support to users on a voluntary basis, but it will really help us if users like yourself can take out a few minutes to write about their approach to solving a tricky situation.

best,
Rushabh




--
You received this message because you are subscribed to the Google Groups "ERPNext User's Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-fo...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--



Twitter: @rushabh_mehta

Slava

unread,
Jun 12, 2013, 6:14:40 AM6/12/13
to erpnext-u...@googlegroups.com
Rushabh,
I really appreciate what you guys doing and I would love to help you. I will think of what I can do.
Thanks,
Slava
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

robert

unread,
Jun 12, 2013, 3:46:50 PM6/12/13
to erpnext-u...@googlegroups.com
Glad to see that some one else puts the discount issue on the agenda (again). This quite a fundamental issue (see my old, more than a year ago postings). It also seems to be difficult to "repair".
If I give discounts the VAT is not correctly calculated and since the maximum deviation is may be an Euro or so I just "let it go"

Nevertheless I do feel that a system like ERPNEXT should allow to give discounts on either the VAT inclusive or VAT exclusive prices and than recalculate the VAT accordingly and allow the discounts to be recorded under an account head. This is not the case when discounts are applied directly in the ITEM table.

rgds Robert

Anand Doshi

unread,
Jun 13, 2013, 1:46:24 AM6/13/13
to erpnext-u...@googlegroups.com
Hi Robert,

We have added this in the issues list here: https://github.com/webnotes/erpnext/issues/471

In short,
When giving discounts, there should be an option that the non-discounted item price be recorded as income and the discount be recorded as an expense. 

This feature is available in other ERPs like OpenERP, because they require taxes to be defined for each Item. 
As opposed to that, the design of ERPNext is to have a tax table in the transaction itself, instead of defining for each item. 
We had thought of changing this design a few months back, but it was too big a change and the current design had a workaround, as we discussed with you and Slava.

May be we could just have another column to book expense for discounts, in the item table. This seems a more actionable task.

@Robert and @Slava
Thanks for sharing this scenario. I believe such discussions will further the maturity of the ERPNext project.

-Anand.

--
You received this message because you are subscribed to the Google Groups "ERPNext User's Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-fo...@googlegroups.com.

Sören H. Biere

unread,
Jun 13, 2013, 4:27:29 AM6/13/13
to erpnext-u...@googlegroups.com
Hi Anand, Robert & Slava,
 
I think a expense account for Discounts in Item Table would be a good way.
The big step to openerps-like tax in item is making the modelling worse if you have different taxes (like in germany)
depending on the POS. In Addition i descibe the scenarion with Default Discounts for Customer Groups, Customers or simply a Document totally discounted with a certain rate for its LifeCycle. 
 
So  i have a custom field for Default Discount in custom group that gets copied to its members
Default Discount (custom script) and may be overwritten there. In every DocType i have custom field Default discount Field that gets filled
with customers Default discount or may be manually filled or overwritten for this doc and populates over erpnext's mechanics from Quotation to Sales Order, Sales Invoice...
This Default Discount in the doc gets written to evey row in the items table if its unwritten.
So i have a customer with 10Percent Default Discount and every item gets 10% Discount untill i see an item thas i want to be only 5% and than i overwrite it and custom script
will never fill in Default Discount for this item again. At this opoint i use the max-discount field in items also to checked whether the automatically inserted Discount is to high an throw an alert.
 
Now all my Items have Default Tax - some 7% some with 19% and Documents Default tax master respects this. Now when i make an Invoice for a POS thats Needs to be totally 19% i get a different Sales Tax master to the Document, items Default tax isn't respected anylonger and erverything gets calculated fine with the discounts and 19% taxes.
 
I hope the descriptiopn of my scenario helps for your design discussion.
The hint in the Manual that says Sales Taxes .. could be used for Discounts ist missleading i think. 
 
 
Thanks, Sören
 

Sören H. Biere

unread,
Jun 13, 2013, 4:54:41 AM6/13/13
to erpnext-u...@googlegroups.com
As an example  i added my custom script for Sales Invoice.
I know that this is not a nice way of doing it but i really wanted to force the mechanics i doing what i needed for testing purpose:
The refresh function could be ígnored as i had to add a way of using gross as net prices for special customers.
(simplification of different Price Lists.)
 
In the update_fname_table the following is adding Discount to item table:
 
       if(doc.my_discount>0&&doc.my_discount<99&&flt(cl[i].adj_rate)==0) {
     set_multiple(tname, cl[i].name, {
      'adj_rate': doc.my_discount
     }, fname);
    }
 
At this point is refinement needed because there maybe one items that should be 0 Discount.
I Image a flag "no_discount" that could be added.
 
In the calc_doc_values there was a Little Adaption because of misscalculated net_totals on tax-included-item-prices
that i mentioned earlier:

 
Sales-Invoice-CustomScript.txt

robert

unread,
Jun 13, 2013, 3:47:19 PM6/13/13
to erpnext-u...@googlegroups.com
The hint in the Manual that says Sales Taxes .. could be used for Discounts ist missleading i think. >>> agree 200%

** Like in Germany we have to VATs in NL, 6% and 21 % (yessss!!!). BUT my taxes work fine.

May be I can use Soeren's script.

One tip other tip Europeans may use. In the tax table all taxes are entered twice , positive and negative.
I buy a lot in Germany and that the Intereuropean tax template records the taxes in to account heads that level out to zero. So i do record the ïntercommunity VAT but the accounting sum is zero (since i do not pay vat when i buy in germany or elsewhere in the EU



On Monday, June 10, 2013 1:43:12 PM UTC+2, Slava wrote:

Rushabh Mehta

unread,
Jun 14, 2013, 5:26:40 AM6/14/13
to erpnext-u...@googlegroups.com
Robert, Soren,

This discussion has become very murky now :) From what we understand the issues are:

1. Ability to book the full rate as Income and discounted amount as Expense.
2. Ability to show net discount as a line-item below the item table and above the tax table and show the Price List Rate in the items table.

Am I correct?

best,
Rushabh


T: @rushabh_mehta

Anand Doshi

unread,
Jun 14, 2013, 5:27:43 AM6/14/13
to erpnext-u...@googlegroups.com
Hi Sören,

The net total issue has been resolved in our upcoming release.

We have added a new field net_total_export to store net total with inclusive tax, and the field net_total will store net total exclusive of tax.

Though this doesn't completely remove the ambiguity, it does make it more specific.

Thanks,
Anand.


--
You received this message because you are subscribed to the Google Groups "ERPNext User's Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-fo...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
<Sales-Invoice-CustomScript.txt>

Sören H. Biere

unread,
Jun 14, 2013, 5:36:55 AM6/14/13
to erpnext-u...@googlegroups.com
Hi Anand,
 
thank you very much. That ist the same as i understood your last answer in the other thread.
As soon as i got the new release is out  i will remove my customization.
I only wanted to explain the little modification as anyone may struggle with the issue of needing a sum without tax printed
and makes use of price-list-rates with tax included.
 
Best regards,
Sören

Sören H. Biere

unread,
Jun 14, 2013, 5:59:44 AM6/14/13
to erpnext-u...@googlegroups.com
:-) Hi Rushabh,
 
1. i agree.
2. i agree.
 
As i have seen in the threads around the most questions deal with some kind of default discount
and get tax problems with the, in then manual mentioned, solution using Sales Tax Masters.
So maybe it would be usefull to give a hint that if default discounts are needed, someone either has to
 - make custom solution with cust. fields & script
 - get custom configuration from yours
 - or offering some kind of Default Discount field in Docs in a future release (will never meet everones needs, but is an extendable startingpoint)
Only in my opinion all discounts,whatever they may come from (customer, custom Group, item),  should take the way over the docs item tables adj_rate column
as this allows later adjustment of Default discounts per item.
 
I think tha was what Slava (and me) struggled with:
"Yes, we have standard discounts. It would be real solution if each item can have specified discount. But as I just experimented if I have 5 items in the invoice and one of them has -5% specified in item table and I set -10% discount on net total, it doesn't make any change, all items get -10% discount. Where's my mistake?"
 
Best regards Sören
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+unsub...@googlegroups.com.

Rushabh Mehta

unread,
Jun 15, 2013, 1:19:11 AM6/15/13
to ERPNext User's Forum
Soren / Robert / Slava,

Thanks for summarising - we will surely work on these in the upcoming release.

I think if #1 and #2 are fixed then it solves a big problem. #2 is actually a print format (visualization) issue. A custom print format should be able to fix this. For #1 we will need to updated the backend code.

Standard discounts for each product is a new issue (#3) though it beats me why would you have a standard discount rather than have a reduced price (?)

I think there is more to it too, like volume based discounting. A more comprehensive solution certainly needs to be worked at.

I have updated Anand's issue on GitHub (https://github.com/webnotes/erpnext/issues/471)

Please add comments there if I am missing anything. Once we have full clarity, we can work on this.

best,
Rushabh




To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-fo...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply all
Reply to author
Forward
0 new messages