From 9462ce9aefc30d35d5d0a32d2f80fb6a3aac33a3 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 3 Oct 2012 11:54:06 +0530 Subject: [PATCH] Taxes and charges category issue fixed --- accounts/doctype/gl_control/gl_control.py | 2 +- .../purchase_register/purchase_register.py | 4 ++-- buying/doctype/purchase_common/purchase_common.js | 10 +++++----- stock/doctype/landed_cost_wizard/landed_cost_wizard.py | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/accounts/doctype/gl_control/gl_control.py b/accounts/doctype/gl_control/gl_control.py index d648ec76ae..470f813777 100644 --- a/accounts/doctype/gl_control/gl_control.py +++ b/accounts/doctype/gl_control/gl_control.py @@ -182,7 +182,7 @@ class DocType: if le_map['table_field']: for d in getlist(doclist,le_map['table_field']): # purchase_tax_details is the table of other charges in purchase cycle - if le_map['table_field'] != 'purchase_tax_details' or (le_map['table_field'] == 'purchase_tax_details' and d.fields.get('category') != 'For Valuation'): + if le_map['table_field'] != 'purchase_tax_details' or (le_map['table_field'] == 'purchase_tax_details' and d.fields.get('category') != 'Valuation'): self.make_single_entry(doc,d,le_map,cancel, merge_entries) else: self.make_single_entry(None,doc,le_map,cancel, merge_entries) diff --git a/accounts/search_criteria/purchase_register/purchase_register.py b/accounts/search_criteria/purchase_register/purchase_register.py index 5e77d5c43f..9c33e2aaa9 100644 --- a/accounts/search_criteria/purchase_register/purchase_register.py +++ b/accounts/search_criteria/purchase_register/purchase_register.py @@ -37,7 +37,7 @@ tax_acc = [c[0] for c in sql("""select distinct account_head from `tabPurchase Taxes and Charges` where parenttype = 'Purchase Invoice' and add_deduct_tax = 'Add' - and category in ('For Total', 'For Both') + and category in ('Total', 'Valuation and Total') and docstatus=1 order by account_head asc""")] @@ -82,7 +82,7 @@ for r in res: where parent = '%s' and parenttype = 'Purchase Invoice' and add_deduct_tax = 'Add' - and category in ('For Total', 'For Both') + and category in ('Total', 'Valuation and Total') group by account_head """ %(r[col_idx['ID']],)) diff --git a/buying/doctype/purchase_common/purchase_common.js b/buying/doctype/purchase_common/purchase_common.js index 3c99c613f4..f295aa00ef 100644 --- a/buying/doctype/purchase_common/purchase_common.js +++ b/buying/doctype/purchase_common/purchase_common.js @@ -498,7 +498,7 @@ cur_frm.cscript.calc_other_charges = function(doc , tname , fname , other_fname) tax[t].tax_amount += flt(tax_amount); var total_amount = flt(tax[t].tax_amount); total_tax_amount = flt(tax[t].total_tax_amount) + flt(total_amount); - if(tax[t].category != "For Valuation"){ + if(tax[t].category != "Valuation"){ set_multiple('Purchase Taxes and Charges', tax[t].name, { 'item_wise_tax_detail':tax[t].item_wise_tax_detail, 'amount':roundNumber(total_amount, 2), 'total':roundNumber(flt(total)+flt(tax[t].tax_amount), 2)}, other_fname); prev_total += flt(tax[t].total_amount); total += flt(tax[t].tax_amount); // for adding total to previous amount @@ -514,7 +514,7 @@ cur_frm.cscript.calc_other_charges = function(doc , tname , fname , other_fname) else $td(otc,i+1,t+1).innerHTML = '('+fmt_money(rate) + '%) ' +fmt_money(tax[t].total_amount); - if (tax[t].category != "For Total"){ + if (tax[t].category != "Total"){ item_tax += tax[t].total_amount; } } @@ -526,7 +526,7 @@ cur_frm.cscript.calc_other_charges = function(doc , tname , fname , other_fname) tax[t].tax_amount += flt(tax_amount); var total_amount = flt(tax[t].tax_amount); total_tax_amount = flt(tax[t].total_tax_amount) - flt(total_amount); - if(tax[t].category != "For Valuation"){ + if(tax[t].category != "Valuation"){ set_multiple('Purchase Taxes and Charges', tax[t].name, { 'item_wise_tax_detail':tax[t].item_wise_tax_detail, 'tax_amount':roundNumber(total_amount, 2), 'total':roundNumber(flt(total)-flt(tax[t].tax_amount), 2)}, other_fname); prev_total -= flt(tax[t].total_amount); total -= flt(tax[t].tax_amount); // for adding total to previous amount @@ -542,7 +542,7 @@ cur_frm.cscript.calc_other_charges = function(doc , tname , fname , other_fname) else $td(otc,i+1,t+1).innerHTML = '('+fmt_money(rate) + '%) ' +fmt_money(tax[t].total_amount); - if (tax[t].category != "For Total"){ + if (tax[t].category != "Total"){ item_tax -= tax[t].total_amount; } } @@ -608,7 +608,7 @@ cur_frm.cscript.calc_doc_values = function(doc, tname, fname, other_fname) { } var d = getchildren('Purchase Taxes and Charges', doc.name, other_fname,doc.doctype); for(var j = 0; j