Discount and Tax again

71 views
Skip to first unread message

Sören H. Biere

unread,
May 16, 2013, 1:06:01 PM5/16/13
to erpnext-u...@googlegroups.com
Hi,
i can figure out the cause for some observed behaviour.
I try to add an Discount to a single item on a form with already entered Default chrges master and items with same tax acounts and Prices including the tax.
 
If i have a Sales Order,Quotation or else and add an Discount in the Sales Order Item table i get the
right 90€ Basic_rate for my 100€ item.
The i pull my taxes from a master to the table an everythings calculated fine. for one of my items the gross sum is 90€.
 
When I use a Default Sales tax master and my Sales order form is prefilled with the tax (item tax account and included_in_print_rate)
the 10% Discount i add to my 100€ item changes the ref_rate to 111,11 and Basic_rate remains a 100€.
 
Shoulnd it be possible to add Discount to items including tax?
 
Best regards,
Sören

Sören H. Biere

unread,
May 16, 2013, 4:32:17 PM5/16/13
to erpnext-u...@googlegroups.com
Ok, i found the function
cur_frm.cscript.consider_incl_rate
on sales_common but I still don't i it should be possible somehow to have Discounts even if
tax is included?
 
Should'nt the inclusion of tax and Discount not be seperated somehow?
What was intended throught this connection?
 
Best regards,
Sören

Anand Doshi

unread,
May 16, 2013, 11:16:15 PM5/16/13
to erpnext-u...@googlegroups.com, erpnext-u...@googlegroups.com
Hi Soren,

It does allow discounts. 
It could be due to the order in which data entry was done. 

As far as I remember,
If the ref_rate is 0 and basic rate is 100
And you enter 10 as discount,
then it will calculate ref_rate as 110

Now if both ref_rate and basic rate are set
And then you specify discount
Then it should change the value of basic rate 

This behaviour was set because most often users don't use price lists. 
Hence they don't enter value in ref rate but enter in basic rate. 
So when they enter discount they expect that ref rate be calculated if it is 0. 

Sent from my phone
--
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.
 
 

Sören H. Biere

unread,
May 17, 2013, 1:42:54 AM5/17/13
to erpnext-u...@googlegroups.com
Hi Anand,
 
thank you very much again.
 
But the case where ref_rate is > 0 is hardly reachable in sales_common on line 754 to 765.
Would'nt it make more sense to change to this like i tried in my custom script:

  } else if(consider_incl_rate) {
   if((flt(cl[i].ref_rate) > 0) && (flt(cl[i].adj_rate) > 0)) {
    var export_rate = flt(cl[i].ref_rate) * flt(1 - flt(cl[i].adj_rate / 100));
    set_multiple(tname, cl[i].name, { 'export_rate': flt(export_rate) }, fname);
   }
   else if(flt(cl[i].export_rate) > 0) {
    // calculate basic rate based on taxes
    // then calculate and set basic_rate, base_ref_rate, ref_rate, amount, export_amount
    var ref_rate = flt(cl[i].adj_rate)!=flt(100) ?
     flt((100 * flt(cl[i].export_rate))/flt(100 - flt(cl[i].adj_rate))) :
     flt(0)
    set_multiple(tname, cl[i].name, { 'ref_rate': ref_rate }, fname);
   }
 
 
If one uses Price lists always both fields are filled but if i enter manually i could respekt to  first add add adj_rate and then the Export rate to calculate the empty ref_rate.
Those are already observing the table.
 
Do you have a better Idea to serve booth Needs, of clients using Price_list and those who enter manually? 
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+unsub...@googlegroups.com.

Anand Doshi

unread,
May 17, 2013, 1:51:33 AM5/17/13
to erpnext-u...@googlegroups.com
Hi Soren,

I am rewriting the client side calculation code. I will try to incorporate your suggestions. We will be dropping a mail before its release so that you can remove the custom script.

Thanks,
Anand.

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,
May 17, 2013, 2:37:21 AM5/17/13
to erpnext-u...@googlegroups.com
Thanks very much!

robert

unread,
May 18, 2013, 3:21:25 AM5/18/13
to erpnext-u...@googlegroups.com
Hi Soren, Glad to see another Euro using customer. The issue on discount and tax is as old as I use Erpnext now, some 1,5 years. The problem seems to be deep rooted in some old code.

In general the team in India is doing wonderful things and are very responsive to issues.

I my view, the whole part of charges and discounts should be redone, inclusive the non-intuitive (decriptive) naming as "total"and "for valuation"
Unfortunately i do not master Java allowing me to do custom-scripting.

Regards Robert Becht from NL


On Thursday, May 16, 2013 7:06:01 PM UTC+2, Sören H. Biere wrote:

Sören H. Biere

unread,
May 18, 2013, 4:18:59 PM5/18/13
to erpnext-u...@googlegroups.com
Hi Robert,
 
great your respondig, maybe we can share some experience.
I neither have much experience with js and py, but when i can throw a look at it i can deal with it.
At the moment i've found a nice solution for the german system with different tax-rates and discounts
for customergroups,customers and items with prices both inclusive and exclusive tax.
All is nicely possible with custom fields and custom script.
 
What are you up to configure respectively where are the problem?
 
As I'm really new to erpnext i don't really have a good overview and as the erpnextteam is offering payed implementations
i can't really give support but maybe we can destill some nice-to-have features and changes.
 
 
Best regards
Sören

Rushabh Mehta

unread,
May 19, 2013, 1:57:42 AM5/19/13
to ERPNext User's Forum
Soren,

Will be great if you can share your solution.

Regarding implementation. There is reasonable amount of documentation out there and the product is completely free unlike many other ERPs which have only part of the product free and many modules paid. I think our commercial support costs are also reasonable and we are very prompt in giving support on the forums. I think its fair to charge for a one-to-one implementation.

If you have any questions, please feel free to ask!

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

robert

unread,
May 24, 2013, 10:47:30 AM5/24/13
to erpnext-u...@googlegroups.com
Hi Soeren, right now abroad, but we can talk once back early june, rgds robert
Reply all
Reply to author
Forward
0 new messages