changed the description of rate fields depending on margin type and if ignore pricing is unchecked returned the rate=0

This commit is contained in:
mbauskar 2016-01-18 15:19:29 +05:30 committed by rohitwaghchaure
parent 8c8fa17a9b
commit ea60c635ab
2 changed files with 11 additions and 0 deletions

View File

@ -89,3 +89,8 @@ cur_frm.cscript.selling = function() {
cur_frm.cscript.buying = function() {
cur_frm.cscript.set_options_for_applicable_for();
}
//Dynamically change the description based on type of margin
cur_frm.cscript.type = function(doc){
cur_frm.set_df_property('rate', 'description', doc.type=='Percentage'?'In Percentage %':'In Amount')
}

View File

@ -126,6 +126,12 @@ def get_pricing_rule_for_item(args):
})
if args.ignore_pricing_rule or not args.item_code:
# if ignore pricing rule then set the rate or amount field to zero
if item_details.doctype in ["Quotation Item", "Sales Order Item"]:
item_details.update({
"type":"Percentage",
"rate_or_amount": 0.00
})
return item_details
if not (args.item_group and args.brand):