From 111a08690076eb55043a0b2e7371f5fe4ae59237 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 2 Oct 2012 18:30:07 +0530 Subject: [PATCH 1/7] floating point issue fixed tax calculation --- .../purchase_common/purchase_common.js | 147 +++++++++--------- 1 file changed, 75 insertions(+), 72 deletions(-) diff --git a/buying/doctype/purchase_common/purchase_common.js b/buying/doctype/purchase_common/purchase_common.js index 33c05df546..3c99c613f4 100644 --- a/buying/doctype/purchase_common/purchase_common.js +++ b/buying/doctype/purchase_common/purchase_common.js @@ -469,16 +469,18 @@ cur_frm.cscript.calc_other_charges = function(doc , tname , fname , other_fname) //-------------------------- $td(otc,i+1,0).innerHTML = cl[i].item_code; - var tax = getchildren('Purchase Taxes and Charges', doc.name, other_fname,doc.doctype); var total = net_total; for(var t=0;t Date: Tue, 2 Oct 2012 19:13:04 +0530 Subject: [PATCH 2/7] added 'fixed' property to background so that it does not scroll --- public/js/startup.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/js/startup.js b/public/js/startup.js index 2d3e2585af..fe9507fcf8 100644 --- a/public/js/startup.js +++ b/public/js/startup.js @@ -143,7 +143,8 @@ erpnext.startup.set_periodic_updates = function() { } erpnext.set_user_background = function(src) { - set_style(repl('#body_div { background: url("files/%(src)s") repeat;}', {src:src})) + set_style(repl('#body_div { background: url("files/%(src)s") repeat fixed;}', + {src:src})) } // subject, sender, description From 86e240177e69862d886007f2735c0e6ae50ec892 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 2 Oct 2012 19:33:53 +0530 Subject: [PATCH 3/7] removed install erpnext -- created a gist, as installation to be independent of repository --- install_erpnext.py | 163 --------------------------------------------- 1 file changed, 163 deletions(-) delete mode 100644 install_erpnext.py diff --git a/install_erpnext.py b/install_erpnext.py deleted file mode 100644 index 0577d6af04..0000000000 --- a/install_erpnext.py +++ /dev/null @@ -1,163 +0,0 @@ -#!/usr/bin/python -from __future__ import unicode_literals -import os, commands - -# ask for root mysql password -import getpass - -root_pwd = None -while not root_pwd: - root_pwd = getpass.getpass("MySQL Root user's Password: ") - -# test root connection -op = commands.getoutput("mysql -u root -p%s -e 'exit'" % \ - root_pwd.replace('$', '\$').replace(' ', '\ ')) -if "access denied" in op.lower(): - raise Exception("Incorrect MySQL Root user's password") - -# ask for new dbname -new_dbname = None -while not new_dbname: - new_dbname = raw_input("New ERPNext Database Name: ") - -# ask for new dbpassword -new_dbpassword = None -while not new_dbpassword: - new_dbpassword = raw_input("New ERPNext Database's Password: ") - -# get erpnext path -erpnext_path = os.path.dirname(os.path.abspath(__file__)) -os.chdir(erpnext_path) - -# setup backups -if not os.path.exists(os.path.join(erpnext_path, 'backups')): - os.makedirs('backups') - os.symlink(os.path.join(erpnext_path, 'backups'), - os.path.join(erpnext_path, 'public', 'backups')) - -# setup files -if not os.path.exists(os.path.join(erpnext_path, 'files')): - os.makedirs('files') - os.symlink(os.path.join(erpnext_path, 'files'), - os.path.join(erpnext_path, 'public', 'files')) - -# setup logs -if not os.path.exists(os.path.join(erpnext_path, 'logs')): - os.makedirs('logs') - os.system('touch logs/error_log.txt') - -# setup lib -- framework repo with read only access -# change this if you have your own fork -if not os.path.exists(os.path.join(erpnext_path, 'lib')): - os.system('git clone https://github.com/webnotes/wnframework.git lib') - -# setup symlinks in public -if not os.path.exists(os.path.join(erpnext_path, 'public', 'js', 'lib')): - os.symlink(os.path.join(erpnext_path, 'lib', 'js', 'lib'), - os.path.join(erpnext_path, 'public', 'js', 'lib')) -if not os.path.exists(os.path.join(erpnext_path, 'public', 'images', 'lib')): - os.symlink(os.path.join(erpnext_path, 'lib', 'images'), - os.path.join(erpnext_path, 'public', 'images', 'lib')) - -# extract master -if os.path.exists(os.path.join(erpnext_path, 'data', 'master.sql.gz')): - os.system('gunzip data/master.sql.gz') - -# setup conf -if not os.path.exists(os.path.join(erpnext_path, 'conf.py')): - # read template conf file - with open(os.path.join(erpnext_path, 'lib', 'conf', 'conf.py'), 'r') as template: - content = template.read() - - # manipulate content - import re - - # set new_dbname, new_dbpassword, files_path, backup_path, log_file_name - content = re.sub("db_name.*", "db_name = '%s'" % new_dbname, content) - content = re.sub("db_password.*", "db_password = '%s'" % new_dbpassword, content) - content = re.sub("files_path.*", "files_path = '%s'" % \ - os.path.join(erpnext_path, 'files'), content) - content = re.sub("backup_path.*", "backup_path = '%s'" % \ - os.path.join(erpnext_path, 'backups'), content) - content = re.sub("log_file_name.*", "log_file_name = '%s'" % \ - os.path.join(erpnext_path, 'logs', 'error_log.txt'), content) - - - # write conf file - with open(os.path.join(erpnext_path, 'conf.py'), 'w') as new_conf: - new_conf.write(content) - -# install db -import sys -sys.path.append('.') -sys.path.append('lib') -sys.path.append('app') - -from webnotes.install_lib.install import Installer -inst = Installer('root', root_pwd) -inst.import_from_db(new_dbname, source_path=os.path.join(erpnext_path, 'data', 'master.sql'), verbose = 1) - -# apply patches -os.chdir(erpnext_path) -os.system("lib/wnf.py --update origin master") - -# set filemode false -os.system("git config core.filemode false") -os.chdir(os.path.join(erpnext_path, 'lib')) -os.system("git config core.filemode false") - -steps_remaining = """ -Notes: ------- - -sample apache conf file -#----------------------------------------------------------- -SetEnv PYTHON_EGG_CACHE /var/www - -# you can change 99 to any other port - -Listen 99 -NameVirtualHost *:99 - - ServerName localhost - DocumentRoot {path to erpnext's folder}/public - AddHandler cgi-script .cgi .xml .py - - - # directory specific options - Options -Indexes +FollowSymLinks +ExecCGI - - # directory's index file - DirectoryIndex web.py - - # rewrite rule - RewriteEngine on - - # condition 1: - # ignore login-page.html, app.html, blank.html, unsupported.html - RewriteCond %{REQUEST_URI} ^((?!app\.html|blank\.html|unsupported\.html).)*$ - - # condition 2: if there are no slashes - # and file is .html or does not containt a . - RewriteCond %{REQUEST_URI} ^(?!.+/)((.+\.html)|([^.]+))$ - - # rewrite if both of the above conditions are true - RewriteRule ^(.+)$ web.py?page=$1 [NC,L] - - AllowOverride all - Order Allow,Deny - Allow from all - - -#----------------------------------------------------------- - -To Do: - -* Configure apache/http conf file to point to public folder -* chown recursively all files in your folder to apache user -* login using: user="Administrator" and password="admin" - -""" - -print steps_remaining - From 2e6e0963d0be07b96a52a7838c283453a95938f7 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 3 Oct 2012 09:18:16 +0530 Subject: [PATCH 4/7] do not send email digests to expired accounts --- setup/doctype/email_digest/email_digest.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setup/doctype/email_digest/email_digest.py b/setup/doctype/email_digest/email_digest.py index 421ae64e8c..9c5a24f1cc 100644 --- a/setup/doctype/email_digest/email_digest.py +++ b/setup/doctype/email_digest/email_digest.py @@ -338,8 +338,14 @@ class DocType: def send(): from webnotes.model.code import get_obj + from webnotes.utils import getdate now_date = now_datetime().date() + import conf + if hasattr(conf, "expires_on") and now_date > getdate(conf.expires_on): + # do not send email digests to expired accounts + return + for ed in webnotes.conn.sql("""select name from `tabEmail Digest` where enabled=1 and docstatus<2""", as_list=1): ed_obj = get_obj('Email Digest', ed[0]) From bc06c7c17c131ff52d5f9c38672b9fee6954849f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 3 Oct 2012 11:13:12 +0530 Subject: [PATCH 5/7] Fixes in GL Mapper --- .../Purchase Invoice with write off.txt | 36 +++--- .../Purchase Invoice/Purchase Invoice.txt | 113 +++++++++++++++++- 2 files changed, 130 insertions(+), 19 deletions(-) diff --git a/accounts/GL Mapper/Purchase Invoice with write off/Purchase Invoice with write off.txt b/accounts/GL Mapper/Purchase Invoice with write off/Purchase Invoice with write off.txt index 9cb6116cee..acbe877a93 100644 --- a/accounts/GL Mapper/Purchase Invoice with write off/Purchase Invoice with write off.txt +++ b/accounts/GL Mapper/Purchase Invoice with write off/Purchase Invoice with write off.txt @@ -3,24 +3,24 @@ # These values are common in all dictionaries { - 'creation': '2012-04-23 11:43:56', - 'docstatus': 0, - 'modified': '2012-04-23 11:43:56', - 'modified_by': u'Administrator', - 'owner': u'Administrator' + u'creation': '2012-04-30 19:55:05', + u'docstatus': 0, + u'modified': '2012-10-03 11:08:09', + u'modified_by': u'Administrator', + u'owner': u'Administrator' }, # These values are common for all GL Mapper { 'doc_type': u'Purchase Invoice with write off', - 'doctype': 'GL Mapper', - 'name': '__common__' + u'doctype': u'GL Mapper', + u'name': u'__common__' }, # These values are common for all GL Mapper Detail { - 'doctype': u'GL Mapper Detail', - 'name': '__common__', + u'doctype': u'GL Mapper Detail', + u'name': u'__common__', 'parent': u'Purchase Invoice with write off', 'parentfield': u'fields', 'parenttype': u'GL Mapper' @@ -28,8 +28,8 @@ # GL Mapper, Purchase Invoice with write off { - 'doctype': 'GL Mapper', - 'name': u'Purchase Invoice with write off' + u'doctype': u'GL Mapper', + u'name': u'Purchase Invoice with write off' }, # GL Mapper Detail @@ -41,7 +41,7 @@ 'cost_center': u'cost_center', 'credit': u'value:0', 'debit': u'amount', - 'doctype': u'GL Mapper Detail', + u'doctype': u'GL Mapper Detail', 'fiscal_year': u'parent:fiscal_year', 'is_opening': u'parent:is_opening', 'posting_date': u'parent:posting_date', @@ -59,9 +59,9 @@ 'aging_date': u'parent:aging_date', 'company': u'parent:company', 'cost_center': u'cost_center', - 'credit': u"value:d.fields.get('category') != 'For Valuation' and d.fields.get('add_deduct_tax') == 'Deduct' and d.fields.get('tax_amount') or 0", - 'debit': u"value:d.fields.get('category') != 'For Valuation' and d.fields.get('add_deduct_tax') == 'Add' and d.fields.get('tax_amount') or 0", - 'doctype': u'GL Mapper Detail', + 'credit': u"value:d.fields.get('category') != 'Valuation' and d.fields.get('add_deduct_tax') == 'Deduct' and d.fields.get('tax_amount') or 0", + 'debit': u"value:d.fields.get('category') != 'Valuation' and d.fields.get('add_deduct_tax') == 'Add' and d.fields.get('tax_amount') or 0", + u'doctype': u'GL Mapper Detail', 'fiscal_year': u'parent:fiscal_year', 'is_opening': u'parent:is_opening', 'posting_date': u'parent:posting_date', @@ -80,7 +80,7 @@ 'company': u'company', 'credit': u'ded_amount', 'debit': u'value:0', - 'doctype': u'GL Mapper Detail', + u'doctype': u'GL Mapper Detail', 'fiscal_year': u'fiscal_year', 'is_opening': u'is_opening', 'posting_date': u'posting_date', @@ -100,7 +100,7 @@ 'company': u'company', 'credit': u'total_amount_to_pay', 'debit': u'value:0', - 'doctype': u'GL Mapper Detail', + u'doctype': u'GL Mapper Detail', 'fiscal_year': u'fiscal_year', 'is_opening': u'is_opening', 'posting_date': u'posting_date', @@ -119,7 +119,7 @@ 'cost_center': u'write_off_cost_center', 'credit': u'write_off_amount', 'debit': u'value:0', - 'doctype': u'GL Mapper Detail', + u'doctype': u'GL Mapper Detail', 'fiscal_year': u'fiscal_year', 'is_opening': u'is_opening', 'posting_date': u'posting_date', diff --git a/accounts/GL Mapper/Purchase Invoice/Purchase Invoice.txt b/accounts/GL Mapper/Purchase Invoice/Purchase Invoice.txt index 7fcf199579..61851d979c 100644 --- a/accounts/GL Mapper/Purchase Invoice/Purchase Invoice.txt +++ b/accounts/GL Mapper/Purchase Invoice/Purchase Invoice.txt @@ -1 +1,112 @@ -[{'doc_type': 'Purchase Invoice', 'modified_by': 'nabin@webnotestech.com', 'name': 'Purchase Invoice', 'parent': None, 'creation': '2009-03-12 12:09:24', 'modified': '2010-05-26 16:48:58', 'module': 'Accounts', 'doctype': 'GL Mapper', 'idx': None, 'parenttype': None, 'owner': 'Administrator', 'docstatus': 0, 'parentfield': None}, {'creation': '2009-03-12 12:09:24', 'voucher_type': 'parent:doctype', 'doctype': 'GL Mapper Detail', 'owner': 'Administrator', 'cost_center': 'cost_center', 'voucher_no': 'parent:name', 'modified_by': 'nabin@webnotestech.com', 'against_voucher': None, 'table_field': 'entries', 'transaction_date': 'parent:voucher_date', 'debit': 'amount', 'docstatus': 0, 'parent': 'Purchase Invoice', 'company': 'parent:company', 'aging_date': 'parent:aging_date', 'fiscal_year': 'parent:fiscal_year', 'is_advance': None, 'remarks': 'parent:remarks', 'account': 'expense_head', 'name': 'GLMDetail00002', 'idx': 1, 'against_voucher_type': None, 'modified': '2010-05-26 16:48:58', 'against': 'parent:credit_to', 'credit': 'value:0', 'parenttype': 'GL Mapper', 'is_opening': 'parent:is_opening', 'posting_date': 'parent:posting_date', 'parentfield': 'fields'}, {'creation': '2009-03-12 12:09:24', 'voucher_type': 'parent:doctype', 'doctype': 'GL Mapper Detail', 'owner': 'Administrator', 'cost_center': 'cost_center', 'voucher_no': 'parent:name', 'modified_by': 'nabin@webnotestech.com', 'against_voucher': None, 'table_field': 'purchase_tax_details', 'transaction_date': 'parent:voucher_date', 'debit': "value:d.fields.get('category') != 'For Valuation' and d.fields.get('add_deduct_tax') == 'Add' and d.fields.get('tax_amount') or 0", 'docstatus': 0, 'parent': 'Purchase Invoice', 'company': 'parent:company', 'aging_date': 'parent:aging_date', 'fiscal_year': 'parent:fiscal_year', 'is_advance': None, 'remarks': 'parent:remarks', 'account': 'account_head', 'name': 'GLMDetail00003', 'idx': 2, 'against_voucher_type': None, 'modified': '2010-05-26 16:48:58', 'against': 'parent:credit_to', 'credit': "value:d.fields.get('category') != 'For Valuation' and d.fields.get('add_deduct_tax') == 'Deduct' and d.fields.get('tax_amount') or 0", 'parenttype': 'GL Mapper', 'is_opening': 'parent:is_opening', 'posting_date': 'parent:posting_date', 'parentfield': 'fields'}, {'creation': '2009-03-12 12:09:24', 'voucher_type': 'doctype', 'doctype': 'GL Mapper Detail', 'owner': 'Administrator', 'cost_center': '', 'voucher_no': 'name', 'modified_by': 'nabin@webnotestech.com', 'against_voucher': None, 'table_field': '', 'transaction_date': 'voucher_date', 'debit': 'value:0', 'docstatus': 0, 'parent': 'Purchase Invoice', 'company': 'company', 'aging_date': 'aging_date', 'fiscal_year': 'fiscal_year', 'is_advance': None, 'remarks': 'remarks', 'account': 'tax_code', 'name': 'GLMDetail00004', 'idx': 3, 'against_voucher_type': None, 'modified': '2010-05-26 16:48:58', 'against': 'credit_to', 'credit': 'ded_amount', 'parenttype': 'GL Mapper', 'is_opening': 'is_opening', 'posting_date': 'posting_date', 'parentfield': 'fields'}, {'creation': '2009-03-12 12:09:24', 'voucher_type': 'doctype', 'doctype': 'GL Mapper Detail', 'owner': 'Administrator', 'cost_center': '', 'voucher_no': 'name', 'modified_by': 'nabin@webnotestech.com', 'against_voucher': 'name', 'table_field': '', 'transaction_date': 'voucher_date', 'debit': 'value:0', 'docstatus': 0, 'parent': 'Purchase Invoice', 'company': 'company', 'aging_date': 'aging_date', 'fiscal_year': 'fiscal_year', 'is_advance': None, 'remarks': 'remarks', 'account': 'credit_to', 'name': 'GLMDetail00005', 'idx': 4, 'against_voucher_type': "value:'Purchase Invoice'", 'modified': '2010-05-26 16:48:58', 'against': 'against_expense_account', 'credit': 'total_amount_to_pay', 'parenttype': 'GL Mapper', 'is_opening': 'is_opening', 'posting_date': 'posting_date', 'parentfield': 'fields'}] \ No newline at end of file +# GL Mapper, Purchase Invoice +[ + + # These values are common in all dictionaries + { + u'creation': '2012-04-30 19:55:04', + u'docstatus': 0, + u'modified': '2012-10-03 11:07:26', + u'modified_by': u'Administrator', + u'owner': u'Administrator' + }, + + # These values are common for all GL Mapper + { + 'doc_type': u'Purchase Invoice', + u'doctype': u'GL Mapper', + u'name': u'__common__' + }, + + # These values are common for all GL Mapper Detail + { + u'doctype': u'GL Mapper Detail', + u'name': u'__common__', + 'parent': u'Purchase Invoice', + 'parentfield': u'fields', + 'parenttype': u'GL Mapper' + }, + + # GL Mapper, Purchase Invoice + { + u'doctype': u'GL Mapper', + u'name': u'Purchase Invoice' + }, + + # GL Mapper Detail + { + 'account': u'expense_head', + 'against': u'parent:credit_to', + 'aging_date': u'parent:aging_date', + 'company': u'parent:company', + 'cost_center': u'cost_center', + 'credit': u'value:0', + 'debit': u'amount', + u'doctype': u'GL Mapper Detail', + 'fiscal_year': u'parent:fiscal_year', + 'is_opening': u'parent:is_opening', + 'posting_date': u'parent:posting_date', + 'remarks': u'parent:remarks', + 'table_field': u'entries', + 'transaction_date': u'parent:voucher_date', + 'voucher_no': u'parent:name', + 'voucher_type': u'parent:doctype' + }, + + # GL Mapper Detail + { + 'account': u'account_head', + 'against': u'parent:credit_to', + 'aging_date': u'parent:aging_date', + 'company': u'parent:company', + 'cost_center': u'cost_center', + 'credit': u"value:d.fields.get('category') != 'Valuation' and d.fields.get('add_deduct_tax') == 'Deduct' and d.fields.get('tax_amount') or 0", + 'debit': u"value:d.fields.get('category') != 'Valuation' and d.fields.get('add_deduct_tax') == 'Add' and d.fields.get('tax_amount') or 0", + u'doctype': u'GL Mapper Detail', + 'fiscal_year': u'parent:fiscal_year', + 'is_opening': u'parent:is_opening', + 'posting_date': u'parent:posting_date', + 'remarks': u'parent:remarks', + 'table_field': u'purchase_tax_details', + 'transaction_date': u'parent:voucher_date', + 'voucher_no': u'parent:name', + 'voucher_type': u'parent:doctype' + }, + + # GL Mapper Detail + { + 'account': u'tax_code', + 'against': u'credit_to', + 'aging_date': u'aging_date', + 'company': u'company', + 'credit': u'ded_amount', + 'debit': u'value:0', + u'doctype': u'GL Mapper Detail', + 'fiscal_year': u'fiscal_year', + 'is_opening': u'is_opening', + 'posting_date': u'posting_date', + 'remarks': u'remarks', + 'transaction_date': u'voucher_date', + 'voucher_no': u'name', + 'voucher_type': u'doctype' + }, + + # GL Mapper Detail + { + 'account': u'credit_to', + 'against': u'against_expense_account', + 'against_voucher': u'name', + 'against_voucher_type': u"value:'Purchase Invoice'", + 'aging_date': u'aging_date', + 'company': u'company', + 'credit': u'total_amount_to_pay', + 'debit': u'value:0', + u'doctype': u'GL Mapper Detail', + 'fiscal_year': u'fiscal_year', + 'is_opening': u'is_opening', + 'posting_date': u'posting_date', + 'remarks': u'remarks', + 'transaction_date': u'voucher_date', + 'voucher_no': u'name', + 'voucher_type': u'doctype' + } +] \ No newline at end of file From cd2f40ffefe06d46ccef849fbce8c48dbc249e2a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 3 Oct 2012 11:17:37 +0530 Subject: [PATCH 6/7] reload purchase invoice gl mapper --- patches/october_2012/reload_gl_mapper.py | 5 +++++ patches/patch_list.py | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 patches/october_2012/reload_gl_mapper.py diff --git a/patches/october_2012/reload_gl_mapper.py b/patches/october_2012/reload_gl_mapper.py new file mode 100644 index 0000000000..8d364ec8eb --- /dev/null +++ b/patches/october_2012/reload_gl_mapper.py @@ -0,0 +1,5 @@ +def execute(): + import webnotes + from webnotes.modules import reload_doc + reload_doc("accounts", "GL Mapper", "Purchase Invoice") + reload_doc("accounts", "GL Mapper", "Purchase Invoice with write off") \ No newline at end of file diff --git a/patches/patch_list.py b/patches/patch_list.py index 340665bf1e..d874e4d08e 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -611,4 +611,8 @@ patch_list = [ 'patch_module': 'patches.october_2012', 'patch_file': 'update_permission', }, + { + 'patch_module': 'patches.october_2012', + 'patch_file': 'reload_gl_mapper', + }, ] From 9462ce9aefc30d35d5d0a32d2f80fb6a3aac33a3 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 3 Oct 2012 11:54:06 +0530 Subject: [PATCH 7/7] 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