From bdebd71bd7b903ca5d698bc2cb677f13e7821941 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 15:21:40 +0530 Subject: [PATCH 01/31] default_print_format field added --- patches/patch.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index f5f88469dd..c1e0d5f043 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 352 +last_patch = 353 #------------------------------------------- @@ -290,3 +290,6 @@ def execute(patch_no): ch = addchild(dt_obj.doc, 'formats', 'DocFormat', 1) ch.format = 'Delivery Note Packing List Wise' ch.save(1) + elif patch_no == 353: + reload_doc('doctype', 'core', 'doctype') + sql("update `tabDocType` set default_print_format = 'Standard'") From d89d59bcb2a02492fc846a299d33ea65bd3babcb Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 15:57:51 +0530 Subject: [PATCH 02/31] patch fixed --- patches/patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index c1e0d5f043..5534848afc 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -292,4 +292,4 @@ def execute(patch_no): ch.save(1) elif patch_no == 353: reload_doc('doctype', 'core', 'doctype') - sql("update `tabDocType` set default_print_format = 'Standard'") + sql("update `tabDocType` set default_print_format = 'Standard' where name = 'Delivery Note'") From 067559ca9d1f93dffcf9d85a4ca42f1b25bb1e12 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 16:04:55 +0530 Subject: [PATCH 03/31] fixed patch --- patches/patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index 5534848afc..f89ffc8604 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -291,5 +291,5 @@ def execute(patch_no): ch.format = 'Delivery Note Packing List Wise' ch.save(1) elif patch_no == 353: - reload_doc('doctype', 'core', 'doctype') + reload_doc('core', 'doctype', 'doctype') sql("update `tabDocType` set default_print_format = 'Standard' where name = 'Delivery Note'") From 332d56db387db1aafe751e87b0e793f1ebaf9631 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 16:05:29 +0530 Subject: [PATCH 04/31] fixed patch --- patches/patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index e4b38d0f62..e5586f8bc8 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -306,7 +306,7 @@ def execute(patch_no): reload_doc('hr', 'doctype', 'salary_slip') delete_doc('DocType', 'Salary Control Panel') elif patch_no == 356: - reload_doc('doctype', 'core', 'doctype') + reload_doc('core', 'doctype', 'doctype') sql("update `tabDocType` set default_print_format = 'Standard' where name = 'Delivery Note'") elif patch_no == 357: sql("delete from `tabDocField` where (fieldname in ('client_string', 'server_code_error', 'server_code_compiled', 'server_code', 'server_code_core', 'client_script', 'client_script_core', 'dt_template', change_log) or label = 'Template') and parent = 'DocType'") From 99c1edc86f1b9bb0a55373bf7437340270c29a5f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 16:10:25 +0530 Subject: [PATCH 05/31] fixed patch --- patches/patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index e5586f8bc8..6ca01714f7 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -309,4 +309,4 @@ def execute(patch_no): reload_doc('core', 'doctype', 'doctype') sql("update `tabDocType` set default_print_format = 'Standard' where name = 'Delivery Note'") elif patch_no == 357: - sql("delete from `tabDocField` where (fieldname in ('client_string', 'server_code_error', 'server_code_compiled', 'server_code', 'server_code_core', 'client_script', 'client_script_core', 'dt_template', change_log) or label = 'Template') and parent = 'DocType'") + sql("delete from `tabDocField` where (fieldname in ('client_string', 'server_code_error', 'server_code_compiled', 'server_code', 'server_code_core', 'client_script', 'client_script_core', 'dt_template', 'change_log') or label = 'Template') and parent = 'DocType'") From ce419c5f7c72803e9240eeac5ea2a8066137dbe0 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 17:09:15 +0530 Subject: [PATCH 06/31] fixed escape seq error in dn --- stock/doctype/delivery_note/delivery_note.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stock/doctype/delivery_note/delivery_note.py b/stock/doctype/delivery_note/delivery_note.py index e5acd163a7..6d48914429 100644 --- a/stock/doctype/delivery_note/delivery_note.py +++ b/stock/doctype/delivery_note/delivery_note.py @@ -443,8 +443,8 @@ class DocType(TransactionBase): # ========================================== def update_pack_nett_weight(self): for d in getlist(self.doclist, 'delivery_note_details'): - if d.item_name: - item_wt = sql("select nett_weight from `tabItem` where item_name = '%s'" % (d.item_name)) + if d.item_code: + item_wt = sql("select nett_weight from `tabItem` where name = %s", (d.item_code)) d.pack_nett_wt = item_wt and flt(item_wt[0][0])*flt(d.qty) or 0 # ========================================== From 3465d969c0b95145d810c4cf3f9527079a868470 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 17:50:51 +0530 Subject: [PATCH 07/31] print hide packing_list related flds in dn --- patches/patch.py | 5 +- stock/doctype/delivery_note/delivery_note.txt | 174 ++++-------------- .../delivery_note_detail.txt | 78 +++----- 3 files changed, 65 insertions(+), 192 deletions(-) diff --git a/patches/patch.py b/patches/patch.py index f89ffc8604..07868bd836 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 353 +last_patch = 354 #------------------------------------------- @@ -293,3 +293,6 @@ def execute(patch_no): elif patch_no == 353: reload_doc('core', 'doctype', 'doctype') sql("update `tabDocType` set default_print_format = 'Standard' where name = 'Delivery Note'") + elif patch_no == 354: + reload_doc('stock', 'doctype', 'delivery_note') + reload_doc('stock', 'doctype', 'delivery_note_detail') diff --git a/stock/doctype/delivery_note/delivery_note.txt b/stock/doctype/delivery_note/delivery_note.txt index 1ab19e070c..a3897ec17b 100644 --- a/stock/doctype/delivery_note/delivery_note.txt +++ b/stock/doctype/delivery_note/delivery_note.txt @@ -5,7 +5,7 @@ { 'creation': '2011-04-18 15:58:20', 'docstatus': 0, - 'modified': '2011-08-23 15:26:57', + 'modified': '2011-09-07 17:36:34', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -21,8 +21,9 @@ # These values are common for all DocType { - '_last_update': '1313665263', + '_last_update': '1314093417', 'colour': 'White:FFF', + 'default_print_format': 'Standard', 'doctype': 'DocType', 'document_type': 'Transaction', 'in_create': 0, @@ -36,7 +37,7 @@ 'show_in_menu': 0, 'subject': 'To %(customer_name)s on %(transaction_date)s | %(per_billed)s% billed', 'tag_fields': 'billing_status', - 'version': 449 + 'version': 450 }, # These values are common for all DocFormat @@ -71,7 +72,6 @@ 'cancel': 1, 'create': 1, 'doctype': 'DocPerm', - 'idx': 1, 'permlevel': 0, 'role': 'Material User', 'submit': 1, @@ -84,7 +84,6 @@ 'cancel': 1, 'create': 1, 'doctype': 'DocPerm', - 'idx': 2, 'permlevel': 0, 'role': 'Sales User', 'submit': 1, @@ -97,7 +96,6 @@ 'cancel': 1, 'create': 1, 'doctype': 'DocPerm', - 'idx': 3, 'permlevel': 0, 'role': 'Material Master Manager', 'submit': 1, @@ -110,7 +108,6 @@ 'cancel': 1, 'create': 1, 'doctype': 'DocPerm', - 'idx': 4, 'permlevel': 0, 'role': 'Material Manager', 'submit': 1, @@ -120,7 +117,6 @@ # DocPerm { 'doctype': 'DocPerm', - 'idx': 5, 'permlevel': 1, 'role': 'All' }, @@ -128,21 +124,18 @@ # DocPerm { 'doctype': 'DocPerm', - 'idx': 6, 'permlevel': 2, 'role': 'All' }, # DocFormat { - 'doctype': 'DocFormat', - 'idx': 1 + 'doctype': 'DocFormat' }, # DocFormat { - 'doctype': 'DocFormat', - 'idx': 2 + 'doctype': 'DocFormat' }, # DocField @@ -150,7 +143,6 @@ 'colour': 'White:FFF', 'doctype': 'DocField', 'fieldtype': 'Section Break', - 'idx': 1, 'label': 'Basic Info', 'oldfieldtype': 'Section Break', 'permlevel': 0 @@ -160,7 +152,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Column Break', - 'idx': 2, 'oldfieldtype': 'Column Break', 'permlevel': 0, 'trigger': 'Client', @@ -174,7 +165,6 @@ 'doctype': 'DocField', 'fieldname': 'naming_series', 'fieldtype': 'Select', - 'idx': 3, 'label': 'Series', 'no_copy': 1, 'oldfieldname': 'naming_series', @@ -190,7 +180,6 @@ 'doctype': 'DocField', 'fieldname': 'customer', 'fieldtype': 'Link', - 'idx': 4, 'in_filter': 1, 'label': 'Customer', 'oldfieldname': 'customer', @@ -208,7 +197,6 @@ 'doctype': 'DocField', 'fieldname': 'customer_address', 'fieldtype': 'Link', - 'idx': 5, 'in_filter': 1, 'label': 'Shipping Address', 'options': 'Address', @@ -221,7 +209,6 @@ 'doctype': 'DocField', 'fieldname': 'contact_person', 'fieldtype': 'Link', - 'idx': 6, 'in_filter': 1, 'label': 'Contact Person', 'options': 'Contact', @@ -234,7 +221,6 @@ 'doctype': 'DocField', 'fieldname': 'customer_name', 'fieldtype': 'Data', - 'idx': 7, 'label': 'Customer Name', 'permlevel': 1 }, @@ -244,7 +230,6 @@ 'doctype': 'DocField', 'fieldname': 'address_display', 'fieldtype': 'Small Text', - 'idx': 8, 'label': 'Shipping Address', 'permlevel': 1 }, @@ -254,7 +239,6 @@ 'doctype': 'DocField', 'fieldname': 'contact_display', 'fieldtype': 'Small Text', - 'idx': 9, 'label': 'Contact', 'permlevel': 1 }, @@ -264,7 +248,6 @@ 'doctype': 'DocField', 'fieldname': 'contact_mobile', 'fieldtype': 'Text', - 'idx': 10, 'label': 'Mobile No', 'permlevel': 1 }, @@ -274,7 +257,6 @@ 'doctype': 'DocField', 'fieldname': 'contact_email', 'fieldtype': 'Text', - 'idx': 11, 'label': 'Contact Email', 'permlevel': 1, 'print_hide': 1 @@ -284,7 +266,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Column Break', - 'idx': 12, 'oldfieldtype': 'Column Break', 'permlevel': 0 }, @@ -297,7 +278,6 @@ 'doctype': 'DocField', 'fieldname': 'transaction_date', 'fieldtype': 'Date', - 'idx': 13, 'in_filter': 1, 'label': 'Voucher Date', 'no_copy': 1, @@ -316,7 +296,6 @@ 'doctype': 'DocField', 'fieldname': 'status', 'fieldtype': 'Select', - 'idx': 14, 'in_filter': 1, 'label': 'Status', 'no_copy': 1, @@ -338,7 +317,6 @@ 'doctype': 'DocField', 'fieldname': 'per_billed', 'fieldtype': 'Currency', - 'idx': 15, 'in_filter': 1, 'label': '% Amount Billed', 'no_copy': 1, @@ -357,7 +335,6 @@ 'doctype': 'DocField', 'fieldname': 'per_installed', 'fieldtype': 'Currency', - 'idx': 16, 'in_filter': 1, 'label': '% Installed', 'no_copy': 1, @@ -368,13 +345,42 @@ 'search_index': 1 }, + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'po_no', + 'fieldtype': 'Data', + 'hidden': 1, + 'label': 'P.O. No', + 'no_copy': 0, + 'oldfieldname': 'po_no', + 'oldfieldtype': 'Data', + 'permlevel': 1, + 'print_hide': 1, + 'width': '100px' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'po_date', + 'fieldtype': 'Data', + 'hidden': 1, + 'label': 'P.O. Date', + 'no_copy': 0, + 'oldfieldname': 'po_date', + 'oldfieldtype': 'Data', + 'permlevel': 1, + 'print_hide': 1, + 'width': '100px' + }, + # DocField { 'allow_on_submit': 0, 'doctype': 'DocField', 'fieldname': 'amended_from', 'fieldtype': 'Data', - 'idx': 17, 'label': 'Amended From', 'no_copy': 1, 'oldfieldname': 'amended_from', @@ -390,7 +396,6 @@ 'doctype': 'DocField', 'fieldname': 'amendment_date', 'fieldtype': 'Date', - 'idx': 18, 'label': 'Amendment Date', 'no_copy': 1, 'oldfieldname': 'amendment_date', @@ -406,7 +411,6 @@ 'fieldname': 'territory', 'fieldtype': 'Link', 'hidden': 0, - 'idx': 19, 'in_filter': 1, 'label': 'Territory', 'options': 'Territory', @@ -421,7 +425,6 @@ 'doctype': 'DocField', 'fieldname': 'customer_group', 'fieldtype': 'Link', - 'idx': 20, 'in_filter': 1, 'label': 'Customer Group', 'options': 'Customer Group', @@ -434,7 +437,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Section Break', - 'idx': 21, 'label': 'Transporter Info', 'permlevel': 0 }, @@ -445,7 +447,6 @@ 'doctype': 'DocField', 'fieldname': 'transporter_name', 'fieldtype': 'Data', - 'idx': 22, 'label': 'Transporter Name', 'no_copy': 0, 'oldfieldname': 'transporter_name', @@ -464,7 +465,6 @@ 'doctype': 'DocField', 'fieldname': 'lr_no', 'fieldtype': 'Data', - 'idx': 23, 'label': 'LR No', 'no_copy': 0, 'oldfieldname': 'lr_no', @@ -483,7 +483,6 @@ 'doctype': 'DocField', 'fieldname': 'lr_date', 'fieldtype': 'Date', - 'idx': 24, 'label': 'LR Date', 'no_copy': 0, 'oldfieldname': 'lr_date', @@ -497,7 +496,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Column Break', - 'idx': 25, 'permlevel': 0, 'width': '50%' }, @@ -507,7 +505,6 @@ 'doctype': 'DocField', 'fieldname': 'challan_no', 'fieldtype': 'Data', - 'idx': 26, 'label': 'Challan No', 'oldfieldname': 'challan_no', 'oldfieldtype': 'Data', @@ -519,7 +516,6 @@ 'doctype': 'DocField', 'fieldname': 'challan_date', 'fieldtype': 'Date', - 'idx': 27, 'label': 'Challan Date', 'oldfieldname': 'challan_date', 'oldfieldtype': 'Date', @@ -531,7 +527,6 @@ 'colour': 'White:FFF', 'doctype': 'DocField', 'fieldtype': 'Section Break', - 'idx': 28, 'label': 'Items', 'oldfieldtype': 'Section Break', 'permlevel': 0 @@ -544,7 +539,6 @@ 'doctype': 'DocField', 'fieldname': 'sales_order_no', 'fieldtype': 'Link', - 'idx': 29, 'label': 'Sales Order No', 'no_copy': 0, 'oldfieldname': 'sales_order_no', @@ -559,7 +553,6 @@ 'doctype': 'DocField', 'fieldtype': 'Button', 'hidden': 0, - 'idx': 30, 'label': 'Get Items', 'oldfieldtype': 'Button', 'options': 'pull_sales_order_details', @@ -574,7 +567,6 @@ 'doctype': 'DocField', 'fieldname': 'price_list_name', 'fieldtype': 'Select', - 'idx': 31, 'label': 'Price List', 'oldfieldname': 'price_list_name', 'oldfieldtype': 'Select', @@ -589,7 +581,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Column Break', - 'idx': 32, 'permlevel': 0, 'width': '50%' }, @@ -601,7 +592,6 @@ 'doctype': 'DocField', 'fieldname': 'currency', 'fieldtype': 'Select', - 'idx': 33, 'label': 'Currency', 'oldfieldname': 'currency', 'oldfieldtype': 'Select', @@ -619,7 +609,6 @@ 'doctype': 'DocField', 'fieldname': 'conversion_rate', 'fieldtype': 'Currency', - 'idx': 34, 'label': 'Conversion Rate', 'no_copy': 0, 'oldfieldname': 'conversion_rate', @@ -633,7 +622,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Section Break', - 'idx': 35, 'permlevel': 0 }, @@ -642,7 +630,6 @@ 'doctype': 'DocField', 'fieldname': 'delivery_note_details', 'fieldtype': 'Table', - 'idx': 36, 'label': 'Delivery Note Details', 'no_copy': 0, 'oldfieldname': 'delivery_note_details', @@ -657,7 +644,6 @@ 'doctype': 'DocField', 'fieldname': 'net_total', 'fieldtype': 'Currency', - 'idx': 37, 'label': 'Net Total*', 'no_copy': 0, 'oldfieldname': 'net_total', @@ -672,7 +658,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Button', - 'idx': 38, 'label': 'Re-Calculate Values', 'oldfieldtype': 'Button', 'permlevel': 0, @@ -683,7 +668,6 @@ { 'doctype': 'DocField', 'fieldtype': 'HTML', - 'idx': 39, 'label': 'Note', 'oldfieldtype': 'HTML', 'options': 'NOTE :* In Base Currency', @@ -696,7 +680,6 @@ 'colour': 'White:FFF', 'doctype': 'DocField', 'fieldtype': 'Section Break', - 'idx': 40, 'label': 'Taxes', 'oldfieldtype': 'Section Break', 'permlevel': 0 @@ -709,7 +692,6 @@ 'doctype': 'DocField', 'fieldname': 'charge', 'fieldtype': 'Link', - 'idx': 41, 'label': 'Charge', 'oldfieldname': 'charge', 'oldfieldtype': 'Link', @@ -722,7 +704,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Button', - 'idx': 42, 'label': 'Get Charges', 'oldfieldtype': 'Button', 'permlevel': 0, @@ -735,7 +716,6 @@ 'doctype': 'DocField', 'fieldname': 'other_charges', 'fieldtype': 'Table', - 'idx': 43, 'label': 'Other Charges', 'no_copy': 0, 'oldfieldname': 'other_charges', @@ -749,7 +729,6 @@ 'doctype': 'DocField', 'fieldname': 'other_charges_total', 'fieldtype': 'Currency', - 'idx': 44, 'label': 'Charges Total', 'oldfieldname': 'other_charges_total', 'oldfieldtype': 'Currency', @@ -762,7 +741,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Button', - 'idx': 45, 'label': 'Calculate Charges', 'oldfieldtype': 'Button', 'permlevel': 0, @@ -774,7 +752,6 @@ { 'doctype': 'DocField', 'fieldtype': 'HTML', - 'idx': 46, 'label': 'Other Charges Calculation', 'oldfieldtype': 'HTML', 'permlevel': 0 @@ -785,7 +762,6 @@ 'colour': 'White:FFF', 'doctype': 'DocField', 'fieldtype': 'Section Break', - 'idx': 47, 'label': 'Totals', 'oldfieldtype': 'Section Break', 'permlevel': 0, @@ -797,7 +773,6 @@ 'doctype': 'DocField', 'fieldname': 'grand_total', 'fieldtype': 'Currency', - 'idx': 48, 'label': 'Grand Total', 'no_copy': 0, 'oldfieldname': 'grand_total', @@ -813,7 +788,6 @@ 'doctype': 'DocField', 'fieldname': 'rounded_total', 'fieldtype': 'Currency', - 'idx': 49, 'label': 'Rounded Total', 'no_copy': 0, 'oldfieldname': 'rounded_total', @@ -830,7 +804,6 @@ 'doctype': 'DocField', 'fieldname': 'in_words', 'fieldtype': 'Data', - 'idx': 50, 'label': 'In Words', 'no_copy': 0, 'oldfieldname': 'in_words', @@ -844,7 +817,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Column Break', - 'idx': 51, 'oldfieldtype': 'Column Break', 'permlevel': 0 }, @@ -854,7 +826,6 @@ 'doctype': 'DocField', 'fieldname': 'grand_total_export', 'fieldtype': 'Currency', - 'idx': 52, 'label': 'Grand Total (Export)', 'no_copy': 0, 'oldfieldname': 'grand_total_export', @@ -870,7 +841,6 @@ 'doctype': 'DocField', 'fieldname': 'rounded_total_export', 'fieldtype': 'Currency', - 'idx': 53, 'label': 'Rounded Total (Export)', 'no_copy': 0, 'oldfieldname': 'rounded_total_export', @@ -887,7 +857,6 @@ 'doctype': 'DocField', 'fieldname': 'in_words_export', 'fieldtype': 'Data', - 'idx': 54, 'label': 'In Words (Export)', 'no_copy': 0, 'oldfieldname': 'in_words_export', @@ -901,7 +870,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Section Break', - 'idx': 55, 'label': 'Terms', 'oldfieldtype': 'Section Break', 'permlevel': 0 @@ -912,7 +880,6 @@ 'doctype': 'DocField', 'fieldname': 'tc_name', 'fieldtype': 'Link', - 'idx': 56, 'label': 'Select Terms', 'oldfieldname': 'tc_name', 'oldfieldtype': 'Link', @@ -926,7 +893,6 @@ 'colour': 'White:FFF', 'doctype': 'DocField', 'fieldtype': 'Button', - 'idx': 57, 'label': 'Get Terms', 'oldfieldtype': 'Button', 'options': 'get_tc_details', @@ -939,7 +905,6 @@ 'colour': 'White:FFF', 'doctype': 'DocField', 'fieldtype': 'HTML', - 'idx': 58, 'label': 'Terms HTML', 'oldfieldtype': 'HTML', 'options': 'You can add Terms and Notes that will be printed in the Transaction', @@ -953,7 +918,6 @@ 'doctype': 'DocField', 'fieldname': 'terms', 'fieldtype': 'Text Editor', - 'idx': 59, 'label': 'Term Details', 'oldfieldname': 'terms', 'oldfieldtype': 'Text Editor', @@ -966,7 +930,6 @@ 'description': 'Filling in Additional Information about the Delivery Note will help you analyze your data better.', 'doctype': 'DocField', 'fieldtype': 'Section Break', - 'idx': 60, 'label': 'More Info', 'oldfieldtype': 'Section Break', 'permlevel': 0 @@ -979,7 +942,6 @@ 'doctype': 'DocField', 'fieldname': 'company', 'fieldtype': 'Link', - 'idx': 61, 'in_filter': 1, 'label': 'Company', 'oldfieldname': 'company', @@ -997,7 +959,6 @@ 'doctype': 'DocField', 'fieldname': 'fiscal_year', 'fieldtype': 'Select', - 'idx': 62, 'in_filter': 1, 'label': 'Fiscal Year', 'oldfieldname': 'fiscal_year', @@ -1018,7 +979,6 @@ 'doctype': 'DocField', 'fieldname': 'posting_date', 'fieldtype': 'Date', - 'idx': 63, 'in_filter': 1, 'label': 'Posting Date', 'no_copy': 1, @@ -1038,7 +998,6 @@ 'doctype': 'DocField', 'fieldname': 'posting_time', 'fieldtype': 'Time', - 'idx': 64, 'in_filter': 0, 'label': 'Posting Time', 'oldfieldname': 'posting_time', @@ -1057,7 +1016,6 @@ 'doctype': 'DocField', 'fieldname': 'project_name', 'fieldtype': 'Link', - 'idx': 65, 'in_filter': 1, 'label': 'Project Name', 'oldfieldname': 'project_name', @@ -1076,7 +1034,6 @@ 'fieldname': 'to_warehouse', 'fieldtype': 'Link', 'hidden': 0, - 'idx': 66, 'label': 'To Warehouse', 'no_copy': 1, 'oldfieldname': 'to_warehouse', @@ -1090,7 +1047,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Column Break', - 'idx': 67, 'oldfieldtype': 'Column Break', 'permlevel': 0, 'width': '50%' @@ -1102,7 +1058,6 @@ 'fieldname': 'billing_status', 'fieldtype': 'Select', 'hidden': 1, - 'idx': 68, 'label': 'Billing Status', 'no_copy': 1, 'options': '\nNot Billed\nPartly Billed\nFully Billed', @@ -1116,51 +1071,17 @@ 'fieldname': 'installation_status', 'fieldtype': 'Select', 'hidden': 1, - 'idx': 69, 'label': 'Installation Status', 'permlevel': 0, 'print_hide': 1 }, - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'po_no', - 'fieldtype': 'Data', - 'hidden': 1, - 'idx': 70, - 'label': 'P.O. No', - 'no_copy': 0, - 'oldfieldname': 'po_no', - 'oldfieldtype': 'Data', - 'permlevel': 1, - 'print_hide': 1, - 'width': '100px' - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'po_date', - 'fieldtype': 'Data', - 'hidden': 1, - 'idx': 71, - 'label': 'P.O. Date', - 'no_copy': 0, - 'oldfieldname': 'po_date', - 'oldfieldtype': 'Data', - 'permlevel': 1, - 'print_hide': 1, - 'width': '100px' - }, - # DocField { 'allow_on_submit': 1, 'doctype': 'DocField', 'fieldname': 'letter_head', 'fieldtype': 'Select', - 'idx': 72, 'label': 'Letter Head', 'oldfieldname': 'letter_head', 'oldfieldtype': 'Link', @@ -1174,7 +1095,6 @@ 'doctype': 'DocField', 'fieldname': 'source', 'fieldtype': 'Select', - 'idx': 73, 'label': 'Source', 'oldfieldname': 'source', 'oldfieldtype': 'Select', @@ -1190,7 +1110,6 @@ 'doctype': 'DocField', 'fieldname': 'campaign', 'fieldtype': 'Link', - 'idx': 74, 'label': 'Campaign', 'oldfieldname': 'campaign', 'oldfieldtype': 'Link', @@ -1206,7 +1125,6 @@ 'doctype': 'DocField', 'fieldname': 'select_print_heading', 'fieldtype': 'Link', - 'idx': 75, 'label': 'Select Print Heading', 'no_copy': 1, 'oldfieldname': 'select_print_heading', @@ -1224,7 +1142,6 @@ 'doctype': 'DocField', 'fieldname': 'print_without_amount', 'fieldtype': 'Check', - 'idx': 76, 'label': 'Print Without Amount', 'oldfieldname': 'print_without_amount', 'oldfieldtype': 'Check', @@ -1238,7 +1155,6 @@ 'doctype': 'DocField', 'fieldname': 'instructions', 'fieldtype': 'Text', - 'idx': 77, 'label': 'Instructions', 'oldfieldname': 'instructions', 'oldfieldtype': 'Text', @@ -1253,7 +1169,6 @@ 'fieldname': 'cancel_reason', 'fieldtype': 'Data', 'hidden': 0, - 'idx': 78, 'label': 'Cancel Reason', 'no_copy': 1, 'oldfieldname': 'cancel_reason', @@ -1269,7 +1184,6 @@ 'fieldname': 'excise_page', 'fieldtype': 'Data', 'hidden': 1, - 'idx': 79, 'label': 'Excise Page Number', 'oldfieldname': 'excise_page', 'oldfieldtype': 'Data', @@ -1282,7 +1196,6 @@ 'colour': 'White:FFF', 'doctype': 'DocField', 'fieldtype': 'Section Break', - 'idx': 80, 'label': 'Sales Team', 'oldfieldtype': 'Section Break', 'permlevel': 0, @@ -1293,7 +1206,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Column Break', - 'idx': 81, 'permlevel': 0, 'width': '50%' }, @@ -1303,7 +1215,6 @@ 'doctype': 'DocField', 'fieldname': 'sales_partner', 'fieldtype': 'Link', - 'idx': 82, 'label': 'Sales Partner', 'no_copy': 0, 'oldfieldname': 'sales_partner', @@ -1320,7 +1231,6 @@ 'doctype': 'DocField', 'fieldname': 'commission_rate', 'fieldtype': 'Currency', - 'idx': 83, 'label': 'Commission Rate (%)', 'no_copy': 0, 'oldfieldname': 'commission_rate', @@ -1337,7 +1247,6 @@ 'doctype': 'DocField', 'fieldname': 'total_commission', 'fieldtype': 'Currency', - 'idx': 84, 'label': 'Total Commission', 'no_copy': 0, 'oldfieldname': 'total_commission', @@ -1351,7 +1260,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Column Break', - 'idx': 85, 'permlevel': 0, 'width': '50%' }, @@ -1361,7 +1269,6 @@ 'doctype': 'DocField', 'fieldname': 'sales_team', 'fieldtype': 'Table', - 'idx': 86, 'label': 'Sales Team1', 'oldfieldname': 'sales_team', 'oldfieldtype': 'Table', @@ -1375,7 +1282,6 @@ 'doctype': 'DocField', 'fieldtype': 'Section Break', 'hidden': 1, - 'idx': 87, 'label': 'Supplier Details', 'oldfieldtype': 'Section Break', 'options': 'Simple', @@ -1388,7 +1294,6 @@ 'fieldname': 'supplier', 'fieldtype': 'Link', 'hidden': 1, - 'idx': 88, 'label': 'Supplier', 'oldfieldname': 'supplier', 'oldfieldtype': 'Link', @@ -1403,7 +1308,6 @@ 'fieldname': 'supplier_address', 'fieldtype': 'Text', 'hidden': 1, - 'idx': 89, 'label': 'Supplier Address', 'oldfieldname': 'supplier_address', 'oldfieldtype': 'Text', @@ -1418,7 +1322,6 @@ 'fieldname': 'purchase_receipt_no', 'fieldtype': 'Link', 'hidden': 1, - 'idx': 90, 'label': 'Purchase Receipt No', 'no_copy': 1, 'oldfieldname': 'purchase_receipt_no', @@ -1435,7 +1338,6 @@ 'fieldname': 'purchase_order_no', 'fieldtype': 'Link', 'hidden': 1, - 'idx': 91, 'label': 'Purchase Order', 'no_copy': 1, 'oldfieldname': 'purchase_order_no', @@ -1449,7 +1351,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Section Break', - 'idx': 92, 'label': 'Packing List', 'oldfieldtype': 'Section Break', 'permlevel': 0 @@ -1460,7 +1361,6 @@ 'doctype': 'DocField', 'fieldname': 'packing_details', 'fieldtype': 'Table', - 'idx': 93, 'label': 'Packing Details', 'oldfieldname': 'packing_details', 'oldfieldtype': 'Table', @@ -1474,7 +1374,6 @@ 'allow_on_submit': 1, 'doctype': 'DocField', 'fieldtype': 'Button', - 'idx': 94, 'label': 'Repair Delivery Note', 'oldfieldtype': 'Button', 'options': 'repair_delivery_note', @@ -1488,7 +1387,6 @@ 'fieldname': 'print_packing_slip', 'fieldtype': 'Text', 'hidden': 1, - 'idx': 95, 'in_filter': 0, 'label': 'Print Packing Slip', 'permlevel': 0, diff --git a/stock/doctype/delivery_note_detail/delivery_note_detail.txt b/stock/doctype/delivery_note_detail/delivery_note_detail.txt index a8fea209c4..be7b98f771 100644 --- a/stock/doctype/delivery_note_detail/delivery_note_detail.txt +++ b/stock/doctype/delivery_note_detail/delivery_note_detail.txt @@ -5,7 +5,7 @@ { 'creation': '2010-08-08 17:08:58', 'docstatus': 0, - 'modified': '2011-08-22 12:11:51', + 'modified': '2011-09-07 17:34:13', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -21,7 +21,7 @@ 'section_style': 'Tray', 'server_code_error': ' ', 'show_in_menu': 0, - 'version': 38 + 'version': 40 }, # These values are common for all DocField @@ -44,7 +44,6 @@ 'doctype': 'DocField', 'fieldname': 'item_code', 'fieldtype': 'Link', - 'idx': 1, 'in_filter': 1, 'label': 'Item Code', 'oldfieldname': 'item_code', @@ -63,7 +62,6 @@ 'doctype': 'DocField', 'fieldname': 'item_name', 'fieldtype': 'Data', - 'idx': 2, 'label': 'Item Name', 'oldfieldname': 'item_name', 'oldfieldtype': 'Data', @@ -78,7 +76,6 @@ 'doctype': 'DocField', 'fieldname': 'description', 'fieldtype': 'Small Text', - 'idx': 3, 'label': 'Description', 'oldfieldname': 'description', 'oldfieldtype': 'Small Text', @@ -87,12 +84,26 @@ 'width': '300px' }, + # DocField + { + 'default': '0.00', + 'doctype': 'DocField', + 'fieldname': 'qty', + 'fieldtype': 'Currency', + 'label': 'Quantity', + 'oldfieldname': 'qty', + 'oldfieldtype': 'Currency', + 'permlevel': 0, + 'reqd': 1, + 'trigger': 'Client', + 'width': '100px' + }, + # DocField { 'doctype': 'DocField', 'fieldname': 'stock_uom', 'fieldtype': 'Data', - 'idx': 4, 'label': 'UOM', 'oldfieldname': 'stock_uom', 'oldfieldtype': 'Data', @@ -102,29 +113,12 @@ 'width': '50px' }, - # DocField - { - 'default': '0.00', - 'doctype': 'DocField', - 'fieldname': 'qty', - 'fieldtype': 'Currency', - 'idx': 5, - 'label': 'Quantity', - 'oldfieldname': 'qty', - 'oldfieldtype': 'Currency', - 'permlevel': 0, - 'reqd': 1, - 'trigger': 'Client', - 'width': '100px' - }, - # DocField { 'default': '0.00', 'doctype': 'DocField', 'fieldname': 'ref_rate', 'fieldtype': 'Currency', - 'idx': 6, 'label': 'Ref Rate', 'no_copy': 0, 'oldfieldname': 'ref_rate', @@ -142,7 +136,6 @@ 'doctype': 'DocField', 'fieldname': 'adj_rate', 'fieldtype': 'Float', - 'idx': 7, 'label': 'Discount (%)', 'oldfieldname': 'adj_rate', 'oldfieldtype': 'Float', @@ -157,7 +150,6 @@ 'doctype': 'DocField', 'fieldname': 'export_rate', 'fieldtype': 'Currency', - 'idx': 8, 'label': 'Rate', 'oldfieldname': 'export_rate', 'oldfieldtype': 'Currency', @@ -173,7 +165,6 @@ 'doctype': 'DocField', 'fieldname': 'export_amount', 'fieldtype': 'Currency', - 'idx': 9, 'label': 'Amount', 'oldfieldname': 'export_amount', 'oldfieldtype': 'Currency', @@ -188,7 +179,6 @@ 'doctype': 'DocField', 'fieldname': 'base_ref_rate', 'fieldtype': 'Currency', - 'idx': 10, 'label': 'Ref Rate*', 'oldfieldname': 'base_ref_rate', 'oldfieldtype': 'Currency', @@ -203,7 +193,6 @@ 'doctype': 'DocField', 'fieldname': 'basic_rate', 'fieldtype': 'Currency', - 'idx': 11, 'label': 'Rate*', 'oldfieldname': 'basic_rate', 'oldfieldtype': 'Currency', @@ -219,7 +208,6 @@ 'doctype': 'DocField', 'fieldname': 'amount', 'fieldtype': 'Currency', - 'idx': 12, 'label': 'Amount*', 'oldfieldname': 'amount', 'oldfieldtype': 'Currency', @@ -234,7 +222,6 @@ 'doctype': 'DocField', 'fieldname': 'warehouse', 'fieldtype': 'Link', - 'idx': 13, 'label': 'Warehouse', 'oldfieldname': 'warehouse', 'oldfieldtype': 'Link', @@ -250,7 +237,6 @@ 'doctype': 'DocField', 'fieldname': 'serial_no', 'fieldtype': 'Text', - 'idx': 14, 'in_filter': 1, 'label': 'Serial No', 'no_copy': 1, @@ -266,7 +252,6 @@ 'doctype': 'DocField', 'fieldname': 'batch_no', 'fieldtype': 'Link', - 'idx': 15, 'label': 'Batch No', 'oldfieldname': 'batch_no', 'oldfieldtype': 'Link', @@ -280,7 +265,6 @@ 'doctype': 'DocField', 'fieldname': 'item_group', 'fieldtype': 'Link', - 'idx': 16, 'label': 'Item Group', 'oldfieldname': 'item_group', 'oldfieldtype': 'Link', @@ -294,7 +278,6 @@ 'doctype': 'DocField', 'fieldname': 'brand', 'fieldtype': 'Link', - 'idx': 17, 'label': 'Brand Name', 'oldfieldname': 'brand', 'oldfieldtype': 'Link', @@ -309,9 +292,9 @@ 'doctype': 'DocField', 'fieldname': 'pack_no', 'fieldtype': 'Data', - 'idx': 18, 'label': 'Pack No', - 'permlevel': 0 + 'permlevel': 0, + 'print_hide': 1 }, # DocField @@ -319,9 +302,9 @@ 'doctype': 'DocField', 'fieldname': 'pack_gross_wt', 'fieldtype': 'Float', - 'idx': 19, 'label': 'Pack Gross Wt', - 'permlevel': 0 + 'permlevel': 0, + 'print_hide': 1 }, # DocField @@ -329,10 +312,10 @@ 'doctype': 'DocField', 'fieldname': 'weight_uom', 'fieldtype': 'Link', - 'idx': 20, 'label': 'Weight UOM', 'options': 'UOM', - 'permlevel': 0 + 'permlevel': 0, + 'print_hide': 1 }, # DocField @@ -340,9 +323,9 @@ 'doctype': 'DocField', 'fieldname': 'pack_nett_wt', 'fieldtype': 'Float', - 'idx': 21, 'label': 'Pack Nett Wt', - 'permlevel': 0 + 'permlevel': 0, + 'print_hide': 1 }, # DocField @@ -350,7 +333,6 @@ 'doctype': 'DocField', 'fieldname': 'no_of_packs', 'fieldtype': 'Int', - 'idx': 22, 'label': 'No of Packs', 'oldfieldname': 'no_of_packs', 'oldfieldtype': 'Int', @@ -364,7 +346,6 @@ 'doctype': 'DocField', 'fieldname': 'pack_unit', 'fieldtype': 'Data', - 'idx': 23, 'label': 'Pack Unit', 'oldfieldname': 'pack_unit', 'oldfieldtype': 'Data', @@ -378,7 +359,6 @@ 'doctype': 'DocField', 'fieldname': 'installed_qty', 'fieldtype': 'Currency', - 'idx': 24, 'label': 'Installed Qty', 'no_copy': 1, 'oldfieldname': 'installed_qty', @@ -393,7 +373,6 @@ 'doctype': 'DocField', 'fieldname': 'actual_qty', 'fieldtype': 'Currency', - 'idx': 25, 'label': 'Available Qty at Warehouse', 'no_copy': 1, 'oldfieldname': 'actual_qty', @@ -408,7 +387,6 @@ 'doctype': 'DocField', 'fieldname': 'billed_amt', 'fieldtype': 'Currency', - 'idx': 26, 'label': 'Billed Amt', 'no_copy': 1, 'permlevel': 1, @@ -423,7 +401,6 @@ 'fieldname': 'prevdoc_docname', 'fieldtype': 'Data', 'hidden': 0, - 'idx': 27, 'in_filter': 1, 'label': 'Against Document No', 'no_copy': 1, @@ -441,7 +418,6 @@ 'fieldname': 'prevdoc_doctype', 'fieldtype': 'Data', 'hidden': 1, - 'idx': 28, 'in_filter': 1, 'label': 'Document Type', 'oldfieldname': 'prevdoc_doctype', @@ -458,7 +434,6 @@ 'fieldname': 'prevdoc_date', 'fieldtype': 'Date', 'hidden': 1, - 'idx': 29, 'in_filter': 1, 'label': 'Against Document Date', 'oldfieldname': 'prevdoc_date', @@ -473,7 +448,6 @@ 'fieldname': 'prevdoc_detail_docname', 'fieldtype': 'Data', 'hidden': 1, - 'idx': 30, 'in_filter': 1, 'label': 'Against Document Detail No', 'oldfieldname': 'prevdoc_detail_docname', @@ -490,7 +464,6 @@ 'fieldname': 'item_tax_rate', 'fieldtype': 'Small Text', 'hidden': 1, - 'idx': 31, 'label': 'Item Tax Rate', 'oldfieldname': 'item_tax_rate', 'oldfieldtype': 'Small Text', @@ -504,7 +477,6 @@ 'doctype': 'DocField', 'fieldname': 'page_break', 'fieldtype': 'Check', - 'idx': 32, 'label': 'Page Break', 'oldfieldname': 'page_break', 'oldfieldtype': 'Check', From 4b8c84db9ada4912e518deb56a79079c455b4fb8 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 8 Sep 2011 11:50:45 +0530 Subject: [PATCH 08/31] removed single quote from sql query in auth_control and fixes in company renaming --- .../authorization_control.py | 332 +++++++++--------- setup/doctype/company/company.py | 5 +- 2 files changed, 169 insertions(+), 168 deletions(-) diff --git a/setup/doctype/authorization_control/authorization_control.py b/setup/doctype/authorization_control/authorization_control.py index 4036ecf594..cce90422e1 100644 --- a/setup/doctype/authorization_control/authorization_control.py +++ b/setup/doctype/authorization_control/authorization_control.py @@ -18,179 +18,177 @@ convert_to_lists = webnotes.conn.convert_to_lists from utilities.transaction_base import TransactionBase class DocType(TransactionBase): - def __init__(self, d, dl): - self.doc, self.doclist = d, dl + def __init__(self, d, dl): + self.doc, self.doclist = d, dl - # Get Names of all Approving Users and Roles - # ------------------------------------------- - def get_appr_user_role(self, det, doctype_name, total, based_on, condition, item, company): - amt_list, appr_users, appr_roles = [], [], [] - users, roles = '','' - if det: - for x in det: - amt_list.append(flt(x[0])) - max_amount = max(amt_list) - - app_dtl = sql("select approving_user, approving_role from `tabAuthorization Rule` where transaction = '%s' and (value = '%s' or value > '%s') and docstatus != 2 and based_on = '%s' and company = '%s' %s" % (doctype_name, flt(max_amount), total, based_on, company, condition)) - if not app_dtl: - app_dtl = sql("select approving_user, approving_role from `tabAuthorization Rule` where transaction = '%s' and (value = '%s' or value > '%s') and docstatus != 2 and based_on = '%s' and ifnull(company,'') = '' %s" % (doctype_name, flt(max_amount), total, based_on, condition)) - for d in app_dtl: - if(d[0]): appr_users.append(d[0]) - if(d[1]): appr_roles.append(d[1]) - - if not has_common(appr_roles, webnotes.user.get_roles()) and not has_common(appr_users, session['user']): - msg, add_msg = '','' - if max_amount: - dcc = TransactionBase().get_company_currency(self.doc.company) - if based_on == 'Grand Total': msg = "since Grand Total exceeds %s. %s" % (dcc, flt(max_amount)) - elif based_on == 'Itemwise Discount': msg = "since Discount exceeds %s for Item Code : %s" % (cstr(max_amount)+'%', item) - elif based_on == 'Average Discount' or based_on == 'Customerwise Discount': msg = "since Discount exceeds %s" % (cstr(max_amount)+'%') - - if appr_users: add_msg = "Users : "+cstr(appr_users) - if appr_roles: add_msg = "Roles : "+cstr(appr_roles) - if appr_users and appr_roles: add_msg = "Users : "+cstr(appr_users)+" or "+"Roles : "+cstr(appr_roles) - msgprint("You do not have an authority to submit this %s %s. Please send for approval to %s" % (doctype_name, msg, add_msg)) - raise Exception + # Get Names of all Approving Users and Roles + # ------------------------------------------- + def get_appr_user_role(self, det, doctype_name, total, based_on, condition, item, company): + amt_list, appr_users, appr_roles = [], [], [] + users, roles = '','' + if det: + for x in det: + amt_list.append(flt(x[0])) + max_amount = max(amt_list) + + app_dtl = sql("select approving_user, approving_role from `tabAuthorization Rule` where transaction = %s and (value = %s or value > %s) and docstatus != 2 and based_on = %s and company = %s %s", (doctype_name, flt(max_amount), total, based_on, company, condition)) + if not app_dtl: + app_dtl = sql("select approving_user, approving_role from `tabAuthorization Rule` where transaction = %s and (value = %s or value > %s) and docstatus != 2 and based_on = %s and ifnull(company,'') = '' %s", (doctype_name, flt(max_amount), total, based_on, condition)) + for d in app_dtl: + if(d[0]): appr_users.append(d[0]) + if(d[1]): appr_roles.append(d[1]) + + if not has_common(appr_roles, webnotes.user.get_roles()) and not has_common(appr_users, session['user']): + msg, add_msg = '','' + if max_amount: + dcc = TransactionBase().get_company_currency(self.doc.company) + if based_on == 'Grand Total': msg = "since Grand Total exceeds %s. %s" % (dcc, flt(max_amount)) + elif based_on == 'Itemwise Discount': msg = "since Discount exceeds %s for Item Code : %s" % (cstr(max_amount)+'%', item) + elif based_on == 'Average Discount' or based_on == 'Customerwise Discount': msg = "since Discount exceeds %s" % (cstr(max_amount)+'%') + + if appr_users: add_msg = "Users : "+cstr(appr_users) + if appr_roles: add_msg = "Roles : "+cstr(appr_roles) + if appr_users and appr_roles: add_msg = "Users : "+cstr(appr_users)+" or "+"Roles : "+cstr(appr_roles) + msgprint("You do not have an authority to submit this %s %s. Please send for approval to %s" % (doctype_name, msg, add_msg)) + raise Exception - # Check if authorization rule is set specific to user - # ---------------------------------------------------- - def validate_auth_rule(self, doctype_name, total, based_on, cond, company, item = ''): - chk = 1 - add_cond1,add_cond2 = '','' - if based_on == 'Itemwise Discount': - add_cond1 += " and master_name = '"+cstr(item)+"'" - itemwise_exists = sql("select value from `tabAuthorization Rule` where transaction = '%s' and value <= '%s' and based_on = '%s' and company = '%s' and docstatus != 2 %s %s" % (doctype_name, total, based_on, company, cond, add_cond1)) - if not itemwise_exists: - itemwise_exists = sql("select value from `tabAuthorization Rule` where transaction = '%s' and value <= '%s' and based_on = '%s' and ifnull(company,'') = '' and docstatus != 2 %s %s" % (doctype_name, total, based_on, cond, add_cond1)) - if itemwise_exists: - self.get_appr_user_role(itemwise_exists, doctype_name, total, based_on, cond+add_cond1, item,company) - chk = 0 - if chk == 1: - if based_on == 'Itemwise Discount': add_cond2 += " and ifnull(master_name,'') = ''" - appr = sql("select value from `tabAuthorization Rule` where transaction = '%s' and value <= '%s' and based_on = '%s' and company = '%s' and docstatus != 2 %s %s" % (doctype_name, total, based_on, company, cond, add_cond2)) - if not appr: - appr = sql("select value from `tabAuthorization Rule` where transaction = '%s' and value <= '%s' and based_on = '%s' and ifnull(company,'') = '' and docstatus != 2 %s %s" % (doctype_name, total, based_on, cond, add_cond2)) - self.get_appr_user_role(appr, doctype_name, total, based_on, cond+add_cond2, item, company) - - - # Bifurcate Authorization based on type - # -------------------------------------- - def bifurcate_based_on_type(self, doctype_name, total, av_dis, based_on, doc_obj, val, company): - add_cond = '' - auth_value = av_dis - if val == 1: add_cond += " and system_user = '"+session['user']+"'" - elif val == 2: add_cond += " and system_role IN %s" % ("('"+"','".join(webnotes.user.get_roles())+"')") - else: add_cond += " and ifnull(system_user,'') = '' and ifnull(system_role,'') = ''" - if based_on == 'Grand Total': auth_value = total - elif based_on == 'Customerwise Discount': - if doc_obj: - if doc_obj.doc.doctype == 'Receivable Voucher': customer = doc_obj.doc.customer - else: customer = doc_obj.doc.customer_name - add_cond = " and master_name = '"+cstr(customer)+"'" - if based_on == 'Itemwise Discount': - if doc_obj: - for t in getlist(doc_obj.doclist, doc_obj.fname): - self.validate_auth_rule(doctype_name, t.adj_rate, based_on, add_cond, company,t.item_code ) - else: - self.validate_auth_rule(doctype_name, auth_value, based_on, add_cond, company) + # Check if authorization rule is set specific to user + # ---------------------------------------------------- + def validate_auth_rule(self, doctype_name, total, based_on, cond, company, item = ''): + chk = 1 + add_cond1,add_cond2 = '','' + if based_on == 'Itemwise Discount': + add_cond1 += " and master_name = '"+cstr(item)+"'" + itemwise_exists = sql("select value from `tabAuthorization Rule` where transaction = %s and value <= %s and based_on = %s and company = %s and docstatus != 2 %s %s", (doctype_name, total, based_on, company, cond, add_cond1)) + if not itemwise_exists: + itemwise_exists = sql("select value from `tabAuthorization Rule` where transaction = %s and value <= %s and based_on = %s and ifnull(company,'') = '' and docstatus != 2 %s %s", (doctype_name, total, based_on, cond, add_cond1)) + if itemwise_exists: + self.get_appr_user_role(itemwise_exists, doctype_name, total, based_on, cond+add_cond1, item,company) + chk = 0 + if chk == 1: + if based_on == 'Itemwise Discount': add_cond2 += " and ifnull(master_name,'') = ''" + appr = sql("select value from `tabAuthorization Rule` where transaction = %s and value <= %s and based_on = %s and company = %s and docstatus != 2 %s %s", (doctype_name, total, based_on, company, cond, add_cond2)) + if not appr: + appr = sql("select value from `tabAuthorization Rule` where transaction = %s and value <= %s and based_on = %s and ifnull(company,'') = '' and docstatus != 2 %s %s", (doctype_name, total, based_on, cond, add_cond2)) + self.get_appr_user_role(appr, doctype_name, total, based_on, cond+add_cond2, item, company) + + + # Bifurcate Authorization based on type + # -------------------------------------- + def bifurcate_based_on_type(self, doctype_name, total, av_dis, based_on, doc_obj, val, company): + add_cond = '' + auth_value = av_dis + if val == 1: add_cond += " and system_user = '"+session['user']+"'" + elif val == 2: add_cond += " and system_role IN %s" % ("('"+"','".join(webnotes.user.get_roles())+"')") + else: add_cond += " and ifnull(system_user,'') = '' and ifnull(system_role,'') = ''" + if based_on == 'Grand Total': auth_value = total + elif based_on == 'Customerwise Discount': + if doc_obj: + if doc_obj.doc.doctype == 'Receivable Voucher': customer = doc_obj.doc.customer + else: customer = doc_obj.doc.customer_name + add_cond = " and master_name = '"+cstr(customer)+"'" + if based_on == 'Itemwise Discount': + if doc_obj: + for t in getlist(doc_obj.doclist, doc_obj.fname): + self.validate_auth_rule(doctype_name, t.adj_rate, based_on, add_cond, company,t.item_code ) + else: + self.validate_auth_rule(doctype_name, auth_value, based_on, add_cond, company) - # Check Approving Authority for transactions other than expense voucher and Appraisal - # ------------------------- - def validate_approving_authority(self, doctype_name,company, total, doc_obj = ''): - if doctype_name == 'Payable Voucher': doctype_name = 'Purchase Invoice' - elif doctype_name == 'Receivable Voucher': doctype_name = 'Sales Invoice' - av_dis = 0 - if doc_obj: - ref_rate, basic_rate = 0, 0 - for d in getlist(doc_obj.doclist, doc_obj.fname): - if d.base_ref_rate and d.basic_rate: - ref_rate += flt(d.base_ref_rate) - basic_rate += flt(d.basic_rate) - if ref_rate: av_dis = 100 - flt(basic_rate * 100 / ref_rate) + # Check Approving Authority for transactions other than expense voucher and Appraisal + # ------------------------- + def validate_approving_authority(self, doctype_name,company, total, doc_obj = ''): + if doctype_name == 'Payable Voucher': doctype_name = 'Purchase Invoice' + elif doctype_name == 'Receivable Voucher': doctype_name = 'Sales Invoice' + av_dis = 0 + if doc_obj: + ref_rate, basic_rate = 0, 0 + for d in getlist(doc_obj.doclist, doc_obj.fname): + if d.base_ref_rate and d.basic_rate: + ref_rate += flt(d.base_ref_rate) + basic_rate += flt(d.basic_rate) + if ref_rate: av_dis = 100 - flt(basic_rate * 100 / ref_rate) - final_based_on = ['Grand Total','Average Discount','Customerwise Discount','Itemwise Discount'] - # Individual User - # ================ - # Check for authorization set for individual user - - based_on = [x[0] for x in sql("select distinct based_on from `tabAuthorization Rule` where transaction = '%s' and system_user = '%s' and (company = '%s' or ifnull(company,'')='') and docstatus != 2" %(doctype_name, session['user'], company))] - - for d in based_on: - self.bifurcate_based_on_type(doctype_name, total, av_dis, d, doc_obj, 1, company) - - # Remove user specific rules from global authorization rules - for r in based_on: - if r in final_based_on and r != 'Itemwise Discount': final_based_on.remove(r) - - # Specific Role - # =============== - # Check for authorization set on particular roles - #based_on = [x[0] for x in sql("select based_on from `tabAuthorization Rule` where transaction = '%s' and system_role IN %s and based_on IN %s and docstatus != 2" %(doctype_name, "('"+"','".join(session['data']['profile']['roles'])+"')", "('"+"','".join(final_based_on)+"')"))] - based_on = [x[0] for x in sql("select based_on from `tabAuthorization Rule` where transaction = '%s' and system_role IN %s and based_on IN %s and (company = '%s' or ifnull(company,'')='') and docstatus != 2" %(doctype_name, "('"+"','".join(webnotes.user.get_roles())+"')", "('"+"','".join(final_based_on)+"')",company))] - for d in based_on: - self.bifurcate_based_on_type(doctype_name, total, av_dis, d, doc_obj, 2, company) - - # Remove role specific rules from global authorization rules - for r in based_on: - if r in final_based_on and r != 'Itemwise Discount': final_based_on.remove(r) - - # Global Rule - # ============= - # Check for global authorization - for g in final_based_on: - self.bifurcate_based_on_type(doctype_name, total, av_dis, g, doc_obj, 0, company) - - #======================================================================================================================== - # payroll related check - def get_value_based_rule(self,doctype_name,employee,total_claimed_amount,company): - val_lst =[] - val = sql("select value from `tabAuthorization Rule` where transaction=%s and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and ifnull(value,0)< %s and company = %s and docstatus!=2",(doctype_name,employee,employee,total_claimed_amount,company)) - if not val: - val = sql("select value from `tabAuthorization Rule` where transaction=%s and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and ifnull(value,0)< %s and ifnull(company,'') = '' and docstatus!=2",(doctype_name,employee,employee,total_claimed_amount)) + final_based_on = ['Grand Total','Average Discount','Customerwise Discount','Itemwise Discount'] + # Individual User + # ================ + # Check for authorization set for individual user + + based_on = [x[0] for x in sql("select distinct based_on from `tabAuthorization Rule` where transaction = %s and system_user = %s and (company = %s or ifnull(company,'')='') and docstatus != 2", (doctype_name, session['user'], company))] + + for d in based_on: + self.bifurcate_based_on_type(doctype_name, total, av_dis, d, doc_obj, 1, company) + + # Remove user specific rules from global authorization rules + for r in based_on: + if r in final_based_on and r != 'Itemwise Discount': final_based_on.remove(r) + + # Specific Role + # =============== + # Check for authorization set on particular roles + based_on = [x[0] for x in sql("select based_on from `tabAuthorization Rule` where transaction = %s and system_role IN %s and based_on IN %s and (company = %s or ifnull(company,'')='') and docstatus != 2", (doctype_name, "('"+"','".join(webnotes.user.get_roles())+"')", "('"+"','".join(final_based_on)+"')",company))] + for d in based_on: + self.bifurcate_based_on_type(doctype_name, total, av_dis, d, doc_obj, 2, company) + + # Remove role specific rules from global authorization rules + for r in based_on: + if r in final_based_on and r != 'Itemwise Discount': final_based_on.remove(r) + + # Global Rule + # ============= + # Check for global authorization + for g in final_based_on: + self.bifurcate_based_on_type(doctype_name, total, av_dis, g, doc_obj, 0, company) + + #======================================================================================================================== + # payroll related check + def get_value_based_rule(self,doctype_name,employee,total_claimed_amount,company): + val_lst =[] + val = sql("select value from `tabAuthorization Rule` where transaction=%s and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and ifnull(value,0)< %s and company = %s and docstatus!=2",(doctype_name,employee,employee,total_claimed_amount,company)) + if not val: + val = sql("select value from `tabAuthorization Rule` where transaction=%s and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and ifnull(value,0)< %s and ifnull(company,'') = '' and docstatus!=2",(doctype_name, employee, employee, total_claimed_amount)) - - if val: - val_lst = [y[0] for y in val] - else: - val_lst.append(0) - - max_val = max(val_lst) - rule = sql("select name, to_emp, to_designation, approving_role, approving_user from `tabAuthorization Rule` where transaction=%s and company = %s and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and ifnull(value,0)= %s and docstatus!=2",(doctype_name,company,employee,employee,flt(max_val)), as_dict=1) - if not rule: - rule = sql("select name, to_emp, to_designation, approving_role, approving_user from `tabAuthorization Rule` where transaction=%s and ifnull(company,'') = '' and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and ifnull(value,0)= %s and docstatus!=2",(doctype_name,employee,employee,flt(max_val)), as_dict=1) + if val: + val_lst = [y[0] for y in val] + else: + val_lst.append(0) + + max_val = max(val_lst) + rule = sql("select name, to_emp, to_designation, approving_role, approving_user from `tabAuthorization Rule` where transaction=%s and company = %s and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and ifnull(value,0)= %s and docstatus!=2",(doctype_name,company,employee,employee,flt(max_val)), as_dict=1) + if not rule: + rule = sql("select name, to_emp, to_designation, approving_role, approving_user from `tabAuthorization Rule` where transaction=%s and ifnull(company,'') = '' and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and ifnull(value,0)= %s and docstatus!=2",(doctype_name,employee,employee,flt(max_val)), as_dict=1) - return rule - - #--------------------------------------------------------------------------------------------------------------------- - # related to payroll module only - def get_approver_name(self, doctype_name, total, doc_obj=''): - app_user=[] - app_specific_user =[] - rule ={} - - if doc_obj: - if doctype_name == 'Expense Voucher': - rule = self.get_value_based_rule(doctype_name,doc_obj.doc.employee,doc_obj.doc.total_claimed_amount, doc_obj.doc.company) - elif doctype_name == 'Appraisal': - rule = sql("select name, to_emp, to_designation, approving_role, approving_user from `tabAuthorization Rule` where transaction=%s and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and company = %s and docstatus!=2",(doctype_name,doc_obj.doc.employee, doc_obj.doc.employee, doc_obj.doc.company),as_dict=1) - if not rule: - rule = sql("select name, to_emp, to_designation, approving_role, approving_user from `tabAuthorization Rule` where transaction=%s and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and ifnull(company,'') = '' and docstatus!=2",(doctype_name,doc_obj.doc.employee, doc_obj.doc.employee),as_dict=1) - - if rule: - for m in rule: - if m['to_emp'] or m['to_designation']: - if m['approving_user']: - app_specific_user.append(m['approving_user']) - elif m['approving_role']: - user_lst = [z[0] for z in sql("select distinct t1.name from `tabProfile` t1, `tabUserRole` t2 where t2.role=%s and t2.parent=t1.name and t1.name !='Administrator' and t1.name != 'Guest' and t1.docstatus !=2",m['approving_role'])] - for x in user_lst: - if not x in app_user: - app_user.append(x) - - if len(app_specific_user) >0: - return app_specific_user - else: - return app_user + return rule + + #--------------------------------------------------------------------------------------------------------------------- + # related to payroll module only + def get_approver_name(self, doctype_name, total, doc_obj=''): + app_user=[] + app_specific_user =[] + rule ={} + + if doc_obj: + if doctype_name == 'Expense Voucher': + rule = self.get_value_based_rule(doctype_name,doc_obj.doc.employee,doc_obj.doc.total_claimed_amount, doc_obj.doc.company) + elif doctype_name == 'Appraisal': + rule = sql("select name, to_emp, to_designation, approving_role, approving_user from `tabAuthorization Rule` where transaction=%s and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and company = %s and docstatus!=2",(doctype_name,doc_obj.doc.employee, doc_obj.doc.employee, doc_obj.doc.company),as_dict=1) + if not rule: + rule = sql("select name, to_emp, to_designation, approving_role, approving_user from `tabAuthorization Rule` where transaction=%s and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and ifnull(company,'') = '' and docstatus!=2",(doctype_name,doc_obj.doc.employee, doc_obj.doc.employee),as_dict=1) + + if rule: + for m in rule: + if m['to_emp'] or m['to_designation']: + if m['approving_user']: + app_specific_user.append(m['approving_user']) + elif m['approving_role']: + user_lst = [z[0] for z in sql("select distinct t1.name from `tabProfile` t1, `tabUserRole` t2 where t2.role=%s and t2.parent=t1.name and t1.name !='Administrator' and t1.name != 'Guest' and t1.docstatus !=2",m['approving_role'])] + for x in user_lst: + if not x in app_user: + app_user.append(x) + + if len(app_specific_user) >0: + return app_specific_user + else: + return app_user diff --git a/setup/doctype/company/company.py b/setup/doctype/company/company.py index 783a158588..a2e333d41c 100644 --- a/setup/doctype/company/company.py +++ b/setup/doctype/company/company.py @@ -248,4 +248,7 @@ class DocType: # on rename # --------- def on_rename(self,newdn,olddn): - sql("update `tabCompany` set company_name = '%s' where name = '%s'" %(newdn,olddn)) + sql("update `tabCompany` set company_name = '%s' where name = '%s'" %(newdn,olddn)) + sql("update `tabSingles` set value = %s where doctype='Manage Account' and field = 'default_company' and value = %s", (newdn, olddn)) + if get_defaults('company') == olddn: + set_default('company', newdn) From d030b52394f3362693a6772b8cc2fb8ab9c1057f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 8 Sep 2011 13:51:58 +0530 Subject: [PATCH 09/31] fixed in auth control --- .../authorization_control/authorization_control.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/setup/doctype/authorization_control/authorization_control.py b/setup/doctype/authorization_control/authorization_control.py index cce90422e1..d0494301c8 100644 --- a/setup/doctype/authorization_control/authorization_control.py +++ b/setup/doctype/authorization_control/authorization_control.py @@ -32,9 +32,9 @@ class DocType(TransactionBase): amt_list.append(flt(x[0])) max_amount = max(amt_list) - app_dtl = sql("select approving_user, approving_role from `tabAuthorization Rule` where transaction = %s and (value = %s or value > %s) and docstatus != 2 and based_on = %s and company = %s %s", (doctype_name, flt(max_amount), total, based_on, company, condition)) + app_dtl = sql("select approving_user, approving_role from `tabAuthorization Rule` where transaction = %s and (value = %s or value > %s) and docstatus != 2 and based_on = %s and company = %s %s" % ('%s', '%s', '%s', '%s', '%s', condition), (doctype_name, flt(max_amount), total, based_on, company)) if not app_dtl: - app_dtl = sql("select approving_user, approving_role from `tabAuthorization Rule` where transaction = %s and (value = %s or value > %s) and docstatus != 2 and based_on = %s and ifnull(company,'') = '' %s", (doctype_name, flt(max_amount), total, based_on, condition)) + app_dtl = sql("select approving_user, approving_role from `tabAuthorization Rule` where transaction = %s and (value = %s or value > %s) and docstatus != 2 and based_on = %s and ifnull(company,'') = '' %s" % ('%s', '%s', '%s', '%s', condition), (doctype_name, flt(max_amount), total, based_on)) for d in app_dtl: if(d[0]): appr_users.append(d[0]) if(d[1]): appr_roles.append(d[1]) @@ -61,17 +61,17 @@ class DocType(TransactionBase): add_cond1,add_cond2 = '','' if based_on == 'Itemwise Discount': add_cond1 += " and master_name = '"+cstr(item)+"'" - itemwise_exists = sql("select value from `tabAuthorization Rule` where transaction = %s and value <= %s and based_on = %s and company = %s and docstatus != 2 %s %s", (doctype_name, total, based_on, company, cond, add_cond1)) + itemwise_exists = sql("select value from `tabAuthorization Rule` where transaction = %s and value <= %s and based_on = %s and company = %s and docstatus != 2 %s %s" % ('%s', '%s', '%s', '%s', cond, add_cond1), (doctype_name, total, based_on, company)) if not itemwise_exists: - itemwise_exists = sql("select value from `tabAuthorization Rule` where transaction = %s and value <= %s and based_on = %s and ifnull(company,'') = '' and docstatus != 2 %s %s", (doctype_name, total, based_on, cond, add_cond1)) + itemwise_exists = sql("select value from `tabAuthorization Rule` where transaction = %s and value <= %s and based_on = %s and ifnull(company,'') = '' and docstatus != 2 %s %s" % ('%s', '%s', '%s', cond, add_cond1), (doctype_name, total, based_on)) if itemwise_exists: self.get_appr_user_role(itemwise_exists, doctype_name, total, based_on, cond+add_cond1, item,company) chk = 0 if chk == 1: if based_on == 'Itemwise Discount': add_cond2 += " and ifnull(master_name,'') = ''" - appr = sql("select value from `tabAuthorization Rule` where transaction = %s and value <= %s and based_on = %s and company = %s and docstatus != 2 %s %s", (doctype_name, total, based_on, company, cond, add_cond2)) + appr = sql("select value from `tabAuthorization Rule` where transaction = %s and value <= %s and based_on = %s and company = %s and docstatus != 2 %s %s" % ('%s', '%s', '%s', '%s', cond, add_cond2), (doctype_name, total, based_on, company)) if not appr: - appr = sql("select value from `tabAuthorization Rule` where transaction = %s and value <= %s and based_on = %s and ifnull(company,'') = '' and docstatus != 2 %s %s", (doctype_name, total, based_on, cond, add_cond2)) + appr = sql("select value from `tabAuthorization Rule` where transaction = %s and value <= %s and based_on = %s and ifnull(company,'') = '' and docstatus != 2 %s %s"% ('%s', '%s', '%s', cond, add_cond2), (doctype_name, total, based_on)) self.get_appr_user_role(appr, doctype_name, total, based_on, cond+add_cond2, item, company) @@ -128,7 +128,7 @@ class DocType(TransactionBase): # Specific Role # =============== # Check for authorization set on particular roles - based_on = [x[0] for x in sql("select based_on from `tabAuthorization Rule` where transaction = %s and system_role IN %s and based_on IN %s and (company = %s or ifnull(company,'')='') and docstatus != 2", (doctype_name, "('"+"','".join(webnotes.user.get_roles())+"')", "('"+"','".join(final_based_on)+"')",company))] + based_on = [x[0] for x in sql("select based_on from `tabAuthorization Rule` where transaction = %s and system_role IN (%s) and based_on IN (%s) and (company = %s or ifnull(company,'')='') and docstatus != 2", (doctype_name, "'"+"','".join(webnotes.user.get_roles())+"'", "'"+"','".join(final_based_on)+"'",company))] for d in based_on: self.bifurcate_based_on_type(doctype_name, total, av_dis, d, doc_obj, 2, company) From 269115f191ca19fd727fba20a1524693db912518 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 8 Sep 2011 14:43:23 +0530 Subject: [PATCH 10/31] print hide packing list related flds --- patches/patch.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index f2748196f5..f1c0fd866e 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 358 +last_patch = 359 #------------------------------------------- @@ -313,3 +313,5 @@ def execute(patch_no): elif patch_no == 358: reload_doc('stock', 'doctype', 'delivery_note') reload_doc('stock', 'doctype', 'delivery_note_detail') + elif patch_no == 359: + sql("update `tabDocField` set print_hide =1 where fieldname in ('pack_no', 'pack_gross_wt', 'weight_uom', 'pack_nett_wt') and parent = 'Delivery Note Detail'") From 43032187712e80644034a0ac0be9723e9f5c4ee2 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 8 Sep 2011 14:47:35 +0530 Subject: [PATCH 11/31] print hide packing list related flds --- patches/patch.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index 07868bd836..748296a887 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 354 +last_patch = 355 #------------------------------------------- @@ -296,3 +296,5 @@ def execute(patch_no): elif patch_no == 354: reload_doc('stock', 'doctype', 'delivery_note') reload_doc('stock', 'doctype', 'delivery_note_detail') + elif patch_no == 355: + sql("update `tabDocField` set print_hide =1 where fieldname in ('pack_no', 'pack_gross_wt', 'weight_uom', 'pack_nett_wt') and parent = 'Delivery Note Detail'") From a06c2ceaffda6309696f547fb2a9ea05ffbad91f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 8 Sep 2011 17:58:54 +0530 Subject: [PATCH 12/31] fixed null issue in update_cp --- setup/doctype/manage_account/manage_account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/doctype/manage_account/manage_account.py b/setup/doctype/manage_account/manage_account.py index a0ed2fadd2..651794fa16 100644 --- a/setup/doctype/manage_account/manage_account.py +++ b/setup/doctype/manage_account/manage_account.py @@ -29,7 +29,7 @@ class DocType: set_default(defkey, defvalue) if defkey == 'fiscal_year': - ysd = sql("select year_start_date from `tabFiscal Year` where name=%s", defvalue) + ysd = sql("select year_start_date from `tabFiscal Year` where name=%s", cstr(defvalue)) ysd = ysd and ysd[0][0] or '' if ysd: set_default('year_start_date', ysd.strftime('%Y-%m-%d')) From 8f494265ba97896536731810016897106adc9774 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 8 Sep 2011 19:09:39 +0530 Subject: [PATCH 13/31] fixed issue in reposting --- accounts/doctype/fiscal_year/fiscal_year.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accounts/doctype/fiscal_year/fiscal_year.py b/accounts/doctype/fiscal_year/fiscal_year.py index 6b2dfdedec..48d7d91cde 100644 --- a/accounts/doctype/fiscal_year/fiscal_year.py +++ b/accounts/doctype/fiscal_year/fiscal_year.py @@ -133,8 +133,8 @@ class DocType: # build dict p = { - 'debit': flt(entry[2]) - ,'credit':flt(entry[3]) + 'debit': entry[4]=='No' and flt(entry[2]) or 0 + ,'credit': entry[4]=='No' and flt(entry[3]) or 0 ,'opening': entry[4]=='Yes' and diff or 0 # end date conditino only if it is not opening From f06796941790c1879b25de826e58656982e3893c Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 9 Sep 2011 12:14:45 +0530 Subject: [PATCH 14/31] error fixed in sales browser control --- setup/doctype/sales_browser_control/sales_browser_control.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup/doctype/sales_browser_control/sales_browser_control.py b/setup/doctype/sales_browser_control/sales_browser_control.py index d4c4a1316b..e9f8242450 100644 --- a/setup/doctype/sales_browser_control/sales_browser_control.py +++ b/setup/doctype/sales_browser_control/sales_browser_control.py @@ -131,7 +131,7 @@ class DocType: r = eval(args) - if r['lft'] == 0: + if r['lft'] == 0 and r['action'] != 'Create': n = sql("select lft,rgt from `tab%s` where name = '%s'"%(r['node_title'],r['nm'])) r['lft'] = n[0][0] r['rgt'] = n[0][1] @@ -212,4 +212,4 @@ class DocType: if res: msgprint("'%s' record is already exist."%(r['nm'])) return 'true' - return 'false' \ No newline at end of file + return 'false' From 14db227234d0036148052b0c13c84b3922e93f9e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 9 Sep 2011 12:56:33 +0530 Subject: [PATCH 15/31] added condition of sales and service item in quotation item code get_query --- selling/doctype/quotation/quotation.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/selling/doctype/quotation/quotation.js b/selling/doctype/quotation/quotation.js index b3dcde681a..0732e45dc6 100644 --- a/selling/doctype/quotation/quotation.js +++ b/selling/doctype/quotation/quotation.js @@ -312,10 +312,11 @@ cur_frm.cscript.validate = function(doc,cdt,cdn){ //================ Last Quoted Price and Last Sold Price suggestion ====================== cur_frm.fields_dict['quotation_details'].grid.get_field('item_code').get_query= function(doc, cdt, cdn) { var d = locals[cdt][cdn]; + var cond = (doc.order_type == 'Maintenance')? " and tabItem.is_service_item = 'Yes'" : " and tabItem.is_sales_item = 'Yes'" if(doc.customer) return repl("SELECT i.name,i.item_code,concat('Last quoted at - ',cast(quote_rate as char)) as quote_rate,concat('Last sold at - ',cast(sales_rate as char)) as sales_rate FROM\ (\ - select item_code,name from tabItem where tabItem.%(key)s like '%s'\ + select item_code,name from tabItem where tabItem.%(key)s like '%s' %(cond)s\ )i\ left join\ (\ @@ -336,7 +337,7 @@ cur_frm.fields_dict['quotation_details'].grid.get_field('item_code').get_query= (\ select rd.item_code,max(voucher_date) as voucher_date from `tabRV Detail` rd, `tabReceivable Voucher` r where r.name=rd.parent and r.docstatus=1 and customer='%(cust)s' group by rd.item_code\ )m where r.item_code=m.item_code and r.voucher_date=m.voucher_date\ - )s on i.item_code=s.item_code ORDER BY item_code LIMIT 50",{cust:doc.customer}); + )s on i.item_code=s.item_code ORDER BY item_code LIMIT 50",{cust:doc.customer, cond:cond}); else - return "SELECT name, item_code FROM tabItem WHERE `tabItem`.%(key)s LIKE '%s' ORDER BY tabItem.item_code DESC LIMIT 50"; -} \ No newline at end of file + return repl("SELECT name, item_code FROM tabItem WHERE `tabItem`.%(key)s LIKE '%s' %(cond)s ORDER BY tabItem.item_code DESC LIMIT 50", {cond:cond}); +} From 56e02b70bdd892678893962b1e0691be4d226b6d Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 9 Sep 2011 13:04:48 +0530 Subject: [PATCH 16/31] print hide print_packing_list field in DN --- patches/patch.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index f1c0fd866e..c085504ebb 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 359 +last_patch = 360 #------------------------------------------- @@ -315,3 +315,5 @@ def execute(patch_no): reload_doc('stock', 'doctype', 'delivery_note_detail') elif patch_no == 359: sql("update `tabDocField` set print_hide =1 where fieldname in ('pack_no', 'pack_gross_wt', 'weight_uom', 'pack_nett_wt') and parent = 'Delivery Note Detail'") + elif patch_no == 360: + sql("update `tabDocField` set print_hide =1 where fieldname = 'print_packing_slip' and parent = 'Delivery Note'") From 00be94860b5f30f2c15cb9c559bb7d028c0eabc4 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 9 Sep 2011 13:13:06 +0530 Subject: [PATCH 17/31] some file checked out from master --- accounts/doctype/fiscal_year/fiscal_year.py | 4 ++-- patches/patch.py | 4 +++- selling/doctype/quotation/quotation.js | 9 +++++---- setup/doctype/manage_account/manage_account.py | 2 +- .../sales_browser_control/sales_browser_control.py | 4 ++-- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/accounts/doctype/fiscal_year/fiscal_year.py b/accounts/doctype/fiscal_year/fiscal_year.py index 6b2dfdedec..48d7d91cde 100644 --- a/accounts/doctype/fiscal_year/fiscal_year.py +++ b/accounts/doctype/fiscal_year/fiscal_year.py @@ -133,8 +133,8 @@ class DocType: # build dict p = { - 'debit': flt(entry[2]) - ,'credit':flt(entry[3]) + 'debit': entry[4]=='No' and flt(entry[2]) or 0 + ,'credit': entry[4]=='No' and flt(entry[3]) or 0 ,'opening': entry[4]=='Yes' and diff or 0 # end date conditino only if it is not opening diff --git a/patches/patch.py b/patches/patch.py index 748296a887..3a297beb80 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 355 +last_patch = 356 #------------------------------------------- @@ -298,3 +298,5 @@ def execute(patch_no): reload_doc('stock', 'doctype', 'delivery_note_detail') elif patch_no == 355: sql("update `tabDocField` set print_hide =1 where fieldname in ('pack_no', 'pack_gross_wt', 'weight_uom', 'pack_nett_wt') and parent = 'Delivery Note Detail'") + elif patch_no == 356: + sql("update `tabDocField` set print_hide =1 where fieldname = 'print_packing_slip' and parent = 'Delivery Note'") diff --git a/selling/doctype/quotation/quotation.js b/selling/doctype/quotation/quotation.js index b3dcde681a..0732e45dc6 100644 --- a/selling/doctype/quotation/quotation.js +++ b/selling/doctype/quotation/quotation.js @@ -312,10 +312,11 @@ cur_frm.cscript.validate = function(doc,cdt,cdn){ //================ Last Quoted Price and Last Sold Price suggestion ====================== cur_frm.fields_dict['quotation_details'].grid.get_field('item_code').get_query= function(doc, cdt, cdn) { var d = locals[cdt][cdn]; + var cond = (doc.order_type == 'Maintenance')? " and tabItem.is_service_item = 'Yes'" : " and tabItem.is_sales_item = 'Yes'" if(doc.customer) return repl("SELECT i.name,i.item_code,concat('Last quoted at - ',cast(quote_rate as char)) as quote_rate,concat('Last sold at - ',cast(sales_rate as char)) as sales_rate FROM\ (\ - select item_code,name from tabItem where tabItem.%(key)s like '%s'\ + select item_code,name from tabItem where tabItem.%(key)s like '%s' %(cond)s\ )i\ left join\ (\ @@ -336,7 +337,7 @@ cur_frm.fields_dict['quotation_details'].grid.get_field('item_code').get_query= (\ select rd.item_code,max(voucher_date) as voucher_date from `tabRV Detail` rd, `tabReceivable Voucher` r where r.name=rd.parent and r.docstatus=1 and customer='%(cust)s' group by rd.item_code\ )m where r.item_code=m.item_code and r.voucher_date=m.voucher_date\ - )s on i.item_code=s.item_code ORDER BY item_code LIMIT 50",{cust:doc.customer}); + )s on i.item_code=s.item_code ORDER BY item_code LIMIT 50",{cust:doc.customer, cond:cond}); else - return "SELECT name, item_code FROM tabItem WHERE `tabItem`.%(key)s LIKE '%s' ORDER BY tabItem.item_code DESC LIMIT 50"; -} \ No newline at end of file + return repl("SELECT name, item_code FROM tabItem WHERE `tabItem`.%(key)s LIKE '%s' %(cond)s ORDER BY tabItem.item_code DESC LIMIT 50", {cond:cond}); +} diff --git a/setup/doctype/manage_account/manage_account.py b/setup/doctype/manage_account/manage_account.py index a0ed2fadd2..651794fa16 100644 --- a/setup/doctype/manage_account/manage_account.py +++ b/setup/doctype/manage_account/manage_account.py @@ -29,7 +29,7 @@ class DocType: set_default(defkey, defvalue) if defkey == 'fiscal_year': - ysd = sql("select year_start_date from `tabFiscal Year` where name=%s", defvalue) + ysd = sql("select year_start_date from `tabFiscal Year` where name=%s", cstr(defvalue)) ysd = ysd and ysd[0][0] or '' if ysd: set_default('year_start_date', ysd.strftime('%Y-%m-%d')) diff --git a/setup/doctype/sales_browser_control/sales_browser_control.py b/setup/doctype/sales_browser_control/sales_browser_control.py index d4c4a1316b..e9f8242450 100644 --- a/setup/doctype/sales_browser_control/sales_browser_control.py +++ b/setup/doctype/sales_browser_control/sales_browser_control.py @@ -131,7 +131,7 @@ class DocType: r = eval(args) - if r['lft'] == 0: + if r['lft'] == 0 and r['action'] != 'Create': n = sql("select lft,rgt from `tab%s` where name = '%s'"%(r['node_title'],r['nm'])) r['lft'] = n[0][0] r['rgt'] = n[0][1] @@ -212,4 +212,4 @@ class DocType: if res: msgprint("'%s' record is already exist."%(r['nm'])) return 'true' - return 'false' \ No newline at end of file + return 'false' From 389de000d993823a572f343fb63c66c5d9b15b9f Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 9 Sep 2011 13:41:36 +0530 Subject: [PATCH 18/31] Allow system manager to change other users password Also, update gateway membership type if sync_with_gateway is true --- .../company_control/company_control.py | 9 +++ home/page/my_company/my_company.js | 74 +++++++++++++++---- home/page/my_company/my_company.py | 5 +- 3 files changed, 69 insertions(+), 19 deletions(-) diff --git a/home/doctype/company_control/company_control.py b/home/doctype/company_control/company_control.py index cab8e7c17e..246b07e736 100644 --- a/home/doctype/company_control/company_control.py +++ b/home/doctype/company_control/company_control.py @@ -53,6 +53,15 @@ class DocType: pr.role = r pr.parentfield = 'userroles' pr.save(1) + + # Update Membership Type at Gateway + if cint(webnotes.conn.get_value('Control Panel', None, 'sync_with_gateway')): + if 'System Manager' in role_list : membership_type = 'Administrator' + else : membership_type = 'Member' + + import server_tools.gateway_utils + server_tools.gateway_utils.update_membership_type(cstr(arg['usr']), membership_type) + sql("delete from __SessionCache where user=%s", cstr(arg['usr'])) # Save profile diff --git a/home/page/my_company/my_company.js b/home/page/my_company/my_company.js index 9da7e9bd2d..40bf155585 100644 --- a/home/page/my_company/my_company.js +++ b/home/page/my_company/my_company.js @@ -322,7 +322,7 @@ MemberProfile = function(parent, uid, member_item) { // show securty settings this.set_security = function() { - var d = new wn.widgets.Dialog({ + var sd = new wn.widgets.Dialog({ title: 'Set User Security', width: 500, fields: [ @@ -362,30 +362,72 @@ MemberProfile = function(parent, uid, member_item) { } ] }); - d.onshow = function() { - d.set_values({ + + me.sec_dialog = sd + + sd.onshow = function() { + me.sec_dialog.set_values({ restrict_ip: me.profile.restrict_ip || '', login_before: me.profile.login_before || '', login_after: me.profile.login_after || '', new_password: '' - }) - } - d.fields_dict.update.input.onclick = function() { + }); + }; + sd.fields_dict.update.input.onclick = function() { var btn = this; this.set_working(); - var args = d.get_values(); + var args = me.sec_dialog.get_values(); args.user = me.profile.name; - $c_page('home', 'my_company', 'update_security', JSON.stringify(args), function(r,rt) { - if(r.exc) { - msgprint(r.exc); + + if (args.new_password) { + var pass_d = new wn.widgets.Dialog({ + title: 'Your Password', + width: 300, + fields: [ + { + label: 'Please Enter Your Password', + description: "Your password is required to update the concerned user's password", + fieldtype: 'Password', + fieldname: 'sys_admin_pwd', + reqd: 1 + }, + + { + label: 'Continue', + fieldtype: 'Button', + fieldname: 'continue' + } + ] + }); + + pass_d.fields_dict.continue.input.onclick = function() { + btn.pwd_dialog.hide(); + args.sys_admin_pwd = btn.pwd_dialog.get_values().sys_admin_pwd; + btn.set_working(); + me.update_security(args); btn.done_working(); - return; } - $.extend(me.profile, d.get_values()); - d.hide(); - }); - } - d.show(); + + pass_d.show(); + btn.pwd_dialog = pass_d; + btn.done_working(); + } else { + btn.done_working(); + me.update_security(args); + } + }; + sd.show(); + } + + this.update_security = function(args) { + $c_page('home', 'my_company', 'update_security', JSON.stringify(args), function(r,rt) { + if(r.exc) { + msgprint(r.exc); + return; + } + me.sec_dialog.hide(); + $.extend(me.profile, me.sec_dialog.get_values()); + }); } // delete user diff --git a/home/page/my_company/my_company.py b/home/page/my_company/my_company.py index 5d5ed800a8..3ff1482e9f 100644 --- a/home/page/my_company/my_company.py +++ b/home/page/my_company/my_company.py @@ -140,8 +140,7 @@ def update_security(args=''): if 'new_password' in args: if cint(webnotes.conn.get_value('Control Panel',None,'sync_with_gateway')): import server_tools.gateway_utils - webnotes.msgprint(server_tools.gateway_utils.change_password('', args['new_password'])['message']) + webnotes.msgprint(server_tools.gateway_utils.change_password('', args['new_password'], args['user'], args['sys_admin_pwd'])['message']) else: webnotes.conn.sql("update tabProfile set password=password(%s) where name=%s", (args['new_password'], args['user'])) - - webnotes.msgprint('Settings Updated') \ No newline at end of file + else: webnotes.msgprint('Settings Updated') \ No newline at end of file From fe8df0adb4ceb3686a201b313a9c75d970f63ce1 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 9 Sep 2011 16:09:24 +0530 Subject: [PATCH 19/31] onload server calls in post render fn --- accounts/doctype/payable_voucher/payable_voucher.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/accounts/doctype/payable_voucher/payable_voucher.js b/accounts/doctype/payable_voucher/payable_voucher.js index 4a566d373b..e3b986d8a1 100644 --- a/accounts/doctype/payable_voucher/payable_voucher.js +++ b/accounts/doctype/payable_voucher/payable_voucher.js @@ -20,12 +20,15 @@ cur_frm.cscript.onload = function(doc,dt,dn) { } if(doc.__islocal){ - if(doc.supplier) {cur_frm.cscript.supplier(doc,dt,dn)} - hide_field(['supplier_address','contact_person','supplier_name','address_display','contact_display','contact_mobile','contact_email']); + hide_field(['supplier_address', 'contact_person', 'supplier_name', 'address_display', 'contact_display', 'contact_mobile', 'contact_email']); } - +} - if(doc.supplier) unhide_field(['supplier_address','contact_person','supplier_name','address_display','contact_display','contact_mobile','contact_email']); + +//Onload post render +//------------------------ +cur_frm.cscript.onload_post_render = function(doc, dt, dn) { + if(doc.__islocal && doc.supplier) cur_frm.cscript.supplier(doc,dt,dn); } // Refresh From 4ddb36c518ea9be202bfb7bb3c566647496eaa07 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 9 Sep 2011 16:16:49 +0530 Subject: [PATCH 20/31] exception flds added in mapper --- .../Delivery Note-Receivable Voucher.txt | 31 +++++++++++--- .../Purchase Order-Payable Voucher.txt | 31 +++++++++++--- .../Purchase Receipt-Payable Voucher.txt | 35 +++++++++++++--- .../Sales Order-Receivable Voucher.txt | 20 ++++++++- .../Enquiry-Quotation/Enquiry-Quotation.txt | 42 ++++++++++++++++--- .../Lead-Customer/Lead-Customer.txt | 20 ++------- .../Lead-Enquiry/Lead-Enquiry.txt | 18 ++++++-- .../Quotation-Sales Order.txt | 15 +++++-- .../Receivable Voucher-Delivery Note.txt | 18 +++++--- .../Sales Order-Delivery Note.txt | 35 ++++++++++------ 10 files changed, 198 insertions(+), 67 deletions(-) diff --git a/accounts/DocType Mapper/Delivery Note-Receivable Voucher/Delivery Note-Receivable Voucher.txt b/accounts/DocType Mapper/Delivery Note-Receivable Voucher/Delivery Note-Receivable Voucher.txt index 981e64aaeb..2de54f6064 100644 --- a/accounts/DocType Mapper/Delivery Note-Receivable Voucher/Delivery Note-Receivable Voucher.txt +++ b/accounts/DocType Mapper/Delivery Note-Receivable Voucher/Delivery Note-Receivable Voucher.txt @@ -5,7 +5,7 @@ { 'creation': '2010-08-08 17:09:34', 'docstatus': 0, - 'modified': '2011-08-09 11:14:09', + 'modified': '2011-09-07 12:12:58', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -22,8 +22,6 @@ # These values are common for all Field Mapper Detail { 'doctype': 'Field Mapper Detail', - 'map': 'Yes', - 'match_id': 1, 'name': '__common__', 'parent': 'Delivery Note-Receivable Voucher', 'parentfield': 'field_mapper_details', @@ -32,7 +30,7 @@ # These values are common for all DocType Mapper { - 'doctype': 'DocType Mapper', + 'doctype': u'DocType Mapper', 'from_doctype': 'Delivery Note', 'module': 'Accounts', 'name': '__common__', @@ -42,7 +40,7 @@ # DocType Mapper, Delivery Note-Receivable Voucher { - 'doctype': 'DocType Mapper', + 'doctype': u'DocType Mapper', 'name': 'Delivery Note-Receivable Voucher' }, @@ -50,6 +48,8 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'eval: (flt(obj.amount) - flt(obj.billed_amt)) / flt(obj.basic_rate)', + 'map': 'Yes', + 'match_id': 1, 'to_field': 'qty' }, @@ -57,6 +57,8 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'parent', + 'map': 'Yes', + 'match_id': 1, 'to_field': 'delivery_note' }, @@ -64,6 +66,8 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'name', + 'map': 'Yes', + 'match_id': 1, 'to_field': 'dn_detail' }, @@ -71,6 +75,8 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'prevdoc_docname', + 'map': 'Yes', + 'match_id': 1, 'to_field': 'sales_order' }, @@ -78,6 +84,8 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'prevdoc_detail_docname', + 'map': 'Yes', + 'match_id': 1, 'to_field': 'so_detail' }, @@ -85,6 +93,8 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'eval: flt(obj.amount) - flt(obj.billed_amt)', + 'map': 'Yes', + 'match_id': 1, 'to_field': 'amount' }, @@ -92,9 +102,20 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'eval: (flt(obj.amount) - flt(obj.billed_amt)) * flt(obj.export_rate)/flt(obj.basic_rate)', + 'map': 'Yes', + 'match_id': 1, 'to_field': 'export_amount' }, + # Field Mapper Detail + { + 'doctype': 'Field Mapper Detail', + 'from_field': 'naming_series', + 'map': 'No', + 'match_id': 0, + 'to_field': 'naming_series' + }, + # Table Mapper Detail { 'doctype': 'Table Mapper Detail', diff --git a/accounts/DocType Mapper/Purchase Order-Payable Voucher/Purchase Order-Payable Voucher.txt b/accounts/DocType Mapper/Purchase Order-Payable Voucher/Purchase Order-Payable Voucher.txt index aa4e7870d1..17b63634c5 100644 --- a/accounts/DocType Mapper/Purchase Order-Payable Voucher/Purchase Order-Payable Voucher.txt +++ b/accounts/DocType Mapper/Purchase Order-Payable Voucher/Purchase Order-Payable Voucher.txt @@ -5,8 +5,8 @@ { 'creation': '2010-08-08 17:09:35', 'docstatus': 0, - 'modified': '2011-05-13 11:26:20', - 'modified_by': 'umair@iwebnotes.com', + 'modified': '2011-09-07 12:10:30', + 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -22,8 +22,6 @@ # These values are common for all Field Mapper Detail { 'doctype': 'Field Mapper Detail', - 'map': 'Yes', - 'match_id': 1, 'name': '__common__', 'parent': 'Purchase Order-Payable Voucher', 'parentfield': 'field_mapper_details', @@ -32,7 +30,7 @@ # These values are common for all DocType Mapper { - 'doctype': 'DocType Mapper', + 'doctype': u'DocType Mapper', 'from_doctype': 'Purchase Order', 'module': 'Accounts', 'name': '__common__', @@ -42,7 +40,7 @@ # DocType Mapper, Purchase Order-Payable Voucher { - 'doctype': 'DocType Mapper', + 'doctype': u'DocType Mapper', 'name': 'Purchase Order-Payable Voucher' }, @@ -50,6 +48,8 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'eval: flt(obj.qty) - flt(obj.billed_qty)', + 'map': 'Yes', + 'match_id': 1, 'to_field': 'qty' }, @@ -57,6 +57,8 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'purchase_rate', + 'map': 'Yes', + 'match_id': 1, 'to_field': 'rate' }, @@ -64,6 +66,8 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'eval: (flt(obj.qty) - flt(obj.billed_qty)) * flt(obj.purchase_rate)', + 'map': 'Yes', + 'match_id': 1, 'to_field': 'amount' }, @@ -71,6 +75,8 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'eval: (flt(obj.qty) - flt(obj.billed_qty)) * flt(obj.import_rate)', + 'map': 'Yes', + 'match_id': 1, 'to_field': 'import_amount' }, @@ -78,6 +84,8 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'parent', + 'map': 'Yes', + 'match_id': 1, 'to_field': 'purchase_order' }, @@ -85,9 +93,20 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'name', + 'map': 'Yes', + 'match_id': 1, 'to_field': 'po_detail' }, + # Field Mapper Detail + { + 'doctype': 'Field Mapper Detail', + 'from_field': 'naming_series', + 'map': 'No', + 'match_id': 0, + 'to_field': 'naming_series' + }, + # Table Mapper Detail { 'doctype': 'Table Mapper Detail', diff --git a/accounts/DocType Mapper/Purchase Receipt-Payable Voucher/Purchase Receipt-Payable Voucher.txt b/accounts/DocType Mapper/Purchase Receipt-Payable Voucher/Purchase Receipt-Payable Voucher.txt index d363acbcd5..d755954fc2 100644 --- a/accounts/DocType Mapper/Purchase Receipt-Payable Voucher/Purchase Receipt-Payable Voucher.txt +++ b/accounts/DocType Mapper/Purchase Receipt-Payable Voucher/Purchase Receipt-Payable Voucher.txt @@ -5,8 +5,8 @@ { 'creation': '2010-08-08 17:09:35', 'docstatus': 0, - 'modified': '2011-05-13 12:18:34', - 'modified_by': 'umair@iwebnotes.com', + 'modified': '2011-09-07 12:09:55', + 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -22,8 +22,6 @@ # These values are common for all Field Mapper Detail { 'doctype': 'Field Mapper Detail', - 'map': 'Yes', - 'match_id': 1, 'name': '__common__', 'parent': 'Purchase Receipt-Payable Voucher', 'parentfield': 'field_mapper_details', @@ -32,7 +30,7 @@ # These values are common for all DocType Mapper { - 'doctype': 'DocType Mapper', + 'doctype': u'DocType Mapper', 'from_doctype': 'Purchase Receipt', 'module': 'Accounts', 'name': '__common__', @@ -42,7 +40,7 @@ # DocType Mapper, Purchase Receipt-Payable Voucher { - 'doctype': 'DocType Mapper', + 'doctype': u'DocType Mapper', 'name': 'Purchase Receipt-Payable Voucher' }, @@ -50,6 +48,8 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'eval: flt(obj.qty) - flt(obj.billed_qty)', + 'map': 'Yes', + 'match_id': 1, 'to_field': 'qty' }, @@ -57,6 +57,8 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'purchase_rate', + 'map': 'Yes', + 'match_id': 1, 'to_field': 'rate' }, @@ -64,6 +66,8 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'eval: (flt(obj.qty) - flt(obj.billed_qty)) * flt(obj.purchase_rate)', + 'map': 'Yes', + 'match_id': 1, 'to_field': 'amount' }, @@ -71,6 +75,8 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'eval: (flt(obj.qty) - flt(obj.billed_qty)) * flt(obj.import_rate)', + 'map': 'Yes', + 'match_id': 1, 'to_field': 'import_amount' }, @@ -78,6 +84,8 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'parent', + 'map': 'Yes', + 'match_id': 1, 'to_field': 'purchase_receipt' }, @@ -85,6 +93,8 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'prevdoc_docname', + 'map': 'Yes', + 'match_id': 1, 'to_field': 'purchase_order' }, @@ -92,6 +102,8 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'name', + 'map': 'Yes', + 'match_id': 1, 'to_field': 'pr_detail' }, @@ -99,9 +111,20 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'prevdoc_detail_docname', + 'map': 'Yes', + 'match_id': 1, 'to_field': 'po_detail' }, + # Field Mapper Detail + { + 'doctype': 'Field Mapper Detail', + 'from_field': 'naming_series', + 'map': 'No', + 'match_id': 0, + 'to_field': 'naming_series' + }, + # Table Mapper Detail { 'doctype': 'Table Mapper Detail', diff --git a/accounts/DocType Mapper/Sales Order-Receivable Voucher/Sales Order-Receivable Voucher.txt b/accounts/DocType Mapper/Sales Order-Receivable Voucher/Sales Order-Receivable Voucher.txt index 78431f574f..3d4b936294 100644 --- a/accounts/DocType Mapper/Sales Order-Receivable Voucher/Sales Order-Receivable Voucher.txt +++ b/accounts/DocType Mapper/Sales Order-Receivable Voucher/Sales Order-Receivable Voucher.txt @@ -5,7 +5,7 @@ { 'creation': '2010-08-08 17:09:36', 'docstatus': 0, - 'modified': '2011-08-31 16:53:11', + 'modified': '2011-09-07 12:05:03', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -22,7 +22,6 @@ # These values are common for all Field Mapper Detail { 'doctype': 'Field Mapper Detail', - 'map': 'Yes', 'name': '__common__', 'parent': 'Sales Order-Receivable Voucher', 'parentfield': 'field_mapper_details', @@ -50,6 +49,7 @@ 'checking_operator': '=', 'doctype': 'Field Mapper Detail', 'from_field': 'customer', + 'map': 'Yes', 'match_id': 0, 'to_field': 'customer' }, @@ -58,6 +58,7 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'eval: (flt(obj.amount) - flt(obj.billed_amt))/flt(obj.basic_rate)', + 'map': 'Yes', 'match_id': 1, 'to_field': 'qty' }, @@ -66,6 +67,7 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'parent', + 'map': 'Yes', 'match_id': 1, 'to_field': 'sales_order' }, @@ -74,6 +76,7 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'name', + 'map': 'Yes', 'match_id': 1, 'to_field': 'so_detail' }, @@ -82,6 +85,7 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'eval:flt(obj.amount) - flt(obj.billed_amt)', + 'map': 'Yes', 'match_id': 1, 'to_field': 'amount' }, @@ -90,6 +94,7 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'eval: (flt(obj.amount) - flt(obj.billed_amt))* flt(obj.export_rate)/flt(obj.basic_rate)', + 'map': 'Yes', 'match_id': 1, 'to_field': 'export_amount' }, @@ -99,6 +104,7 @@ 'checking_operator': '=', 'doctype': 'Field Mapper Detail', 'from_field': 'project_name', + 'map': 'Yes', 'match_id': 0, 'to_field': 'project_name' }, @@ -107,10 +113,20 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'reserved_warehouse', + 'map': 'Yes', 'match_id': 1, 'to_field': 'warehouse' }, + # Field Mapper Detail + { + 'doctype': 'Field Mapper Detail', + 'from_field': 'naming_series', + 'map': 'No', + 'match_id': 0, + 'to_field': 'naming_series' + }, + # Table Mapper Detail { 'doctype': 'Table Mapper Detail', diff --git a/selling/DocType Mapper/Enquiry-Quotation/Enquiry-Quotation.txt b/selling/DocType Mapper/Enquiry-Quotation/Enquiry-Quotation.txt index 4db092dab2..807a057e5e 100644 --- a/selling/DocType Mapper/Enquiry-Quotation/Enquiry-Quotation.txt +++ b/selling/DocType Mapper/Enquiry-Quotation/Enquiry-Quotation.txt @@ -5,8 +5,8 @@ { 'creation': '2010-08-08 17:09:34', 'docstatus': 0, - 'modified': '2011-05-10 16:04:40', - 'modified_by': 'umair@iwebnotes.com', + 'modified': '2011-09-07 12:12:30', + 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -23,7 +23,6 @@ # These values are common for all Field Mapper Detail { 'doctype': 'Field Mapper Detail', - 'map': 'Yes', 'name': '__common__', 'parent': 'Enquiry-Quotation', 'parentfield': 'field_mapper_details', @@ -32,7 +31,7 @@ # These values are common for all DocType Mapper { - 'doctype': 'DocType Mapper', + 'doctype': u'DocType Mapper', 'from_doctype': 'Enquiry', 'module': 'Selling', 'name': '__common__', @@ -42,7 +41,7 @@ # DocType Mapper, Enquiry-Quotation { - 'doctype': 'DocType Mapper', + 'doctype': u'DocType Mapper', 'name': 'Enquiry-Quotation' }, @@ -50,6 +49,7 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'uom', + 'map': 'Yes', 'match_id': 1, 'to_field': 'stock_uom' }, @@ -58,6 +58,7 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'name', + 'map': 'Yes', 'match_id': 0, 'to_field': 'enq_no' }, @@ -66,6 +67,7 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'parent', + 'map': 'Yes', 'match_id': 1, 'to_field': 'prevdoc_docname' }, @@ -74,6 +76,7 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'parenttype', + 'map': 'Yes', 'match_id': 1, 'to_field': 'prevdoc_doctype' }, @@ -82,6 +85,7 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'enquiry_from', + 'map': 'Yes', 'match_id': 0, 'to_field': 'quotation_to' }, @@ -90,10 +94,38 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'enquiry_type', + 'map': 'Yes', 'match_id': 0, 'to_field': 'order_type' }, + # Field Mapper Detail + { + 'doctype': 'Field Mapper Detail', + 'from_field': 'transaction_date', + 'map': 'No', + 'match_id': 0, + 'to_field': 'transaction_date' + }, + + # Field Mapper Detail + { + 'doctype': 'Field Mapper Detail', + 'from_field': 'status', + 'map': 'No', + 'match_id': 0, + 'to_field': 'status' + }, + + # Field Mapper Detail + { + 'doctype': 'Field Mapper Detail', + 'from_field': 'naming_series', + 'map': 'No', + 'match_id': 0, + 'to_field': 'naming_series' + }, + # Table Mapper Detail { 'doctype': 'Table Mapper Detail', diff --git a/selling/DocType Mapper/Lead-Customer/Lead-Customer.txt b/selling/DocType Mapper/Lead-Customer/Lead-Customer.txt index 2b7a15a81f..19a9f8a2e9 100644 --- a/selling/DocType Mapper/Lead-Customer/Lead-Customer.txt +++ b/selling/DocType Mapper/Lead-Customer/Lead-Customer.txt @@ -5,7 +5,7 @@ { 'creation': '2010-08-08 17:09:34', 'docstatus': 0, - 'modified': '2010-10-14 13:39:44', + 'modified': '2011-09-07 12:11:39', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -36,7 +36,7 @@ # These values are common for all DocType Mapper { - 'doctype': 'DocType Mapper', + 'doctype': u'DocType Mapper', 'from_doctype': 'Lead', 'module': 'Selling', 'name': '__common__', @@ -45,7 +45,7 @@ # DocType Mapper, Lead-Customer { - 'doctype': 'DocType Mapper', + 'doctype': u'DocType Mapper', 'name': 'Lead-Customer' }, @@ -63,20 +63,6 @@ 'to_field': 'customer_name' }, - # Field Mapper Detail - { - 'doctype': 'Field Mapper Detail', - 'from_field': 'contact_no', - 'to_field': 'phone_1' - }, - - # Field Mapper Detail - { - 'doctype': 'Field Mapper Detail', - 'from_field': 'fax', - 'to_field': 'fax_1' - }, - # Table Mapper Detail { 'doctype': 'Table Mapper Detail' diff --git a/selling/DocType Mapper/Lead-Enquiry/Lead-Enquiry.txt b/selling/DocType Mapper/Lead-Enquiry/Lead-Enquiry.txt index 4b32723e02..742215b780 100644 --- a/selling/DocType Mapper/Lead-Enquiry/Lead-Enquiry.txt +++ b/selling/DocType Mapper/Lead-Enquiry/Lead-Enquiry.txt @@ -5,7 +5,7 @@ { 'creation': '2010-08-08 17:09:34', 'docstatus': 0, - 'modified': '2010-08-05 20:21:54', + 'modified': '2011-09-07 12:11:00', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -26,7 +26,6 @@ # These values are common for all Field Mapper Detail { 'doctype': 'Field Mapper Detail', - 'map': 'Yes', 'match_id': 0, 'name': '__common__', 'parent': 'Lead-Enquiry', @@ -36,7 +35,7 @@ # These values are common for all DocType Mapper { - 'doctype': 'DocType Mapper', + 'doctype': u'DocType Mapper', 'from_doctype': 'Lead', 'module': 'Selling', 'name': '__common__', @@ -45,7 +44,7 @@ # DocType Mapper, Lead-Enquiry { - 'doctype': 'DocType Mapper', + 'doctype': u'DocType Mapper', 'name': 'Lead-Enquiry' }, @@ -53,6 +52,7 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'campaign_name', + 'map': 'Yes', 'to_field': 'campaign' }, @@ -60,6 +60,7 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'doctype', + 'map': 'Yes', 'to_field': 'enquiry_from' }, @@ -67,9 +68,18 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'name', + 'map': 'Yes', 'to_field': 'lead' }, + # Field Mapper Detail + { + 'doctype': 'Field Mapper Detail', + 'from_field': 'status', + 'map': 'No', + 'to_field': 'status' + }, + # Table Mapper Detail { 'doctype': 'Table Mapper Detail' diff --git a/selling/DocType Mapper/Quotation-Sales Order/Quotation-Sales Order.txt b/selling/DocType Mapper/Quotation-Sales Order/Quotation-Sales Order.txt index 4d493a612b..5a529dde41 100644 --- a/selling/DocType Mapper/Quotation-Sales Order/Quotation-Sales Order.txt +++ b/selling/DocType Mapper/Quotation-Sales Order/Quotation-Sales Order.txt @@ -5,7 +5,7 @@ { 'creation': '2010-08-08 17:09:35', 'docstatus': 0, - 'modified': '2011-08-25 18:25:02', + 'modified': '2011-09-07 12:08:48', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -30,7 +30,7 @@ # These values are common for all DocType Mapper { - 'doctype': 'DocType Mapper', + 'doctype': u'DocType Mapper', 'from_doctype': 'Quotation', 'module': 'Selling', 'name': '__common__', @@ -40,7 +40,7 @@ # DocType Mapper, Quotation-Sales Order { - 'doctype': 'DocType Mapper', + 'doctype': u'DocType Mapper', 'name': 'Quotation-Sales Order' }, @@ -110,6 +110,15 @@ 'to_field': 'naming_series' }, + # Field Mapper Detail + { + 'doctype': 'Field Mapper Detail', + 'from_field': 'status', + 'map': 'No', + 'match_id': 0, + 'to_field': 'status' + }, + # Table Mapper Detail { 'doctype': 'Table Mapper Detail', diff --git a/stock/DocType Mapper/Receivable Voucher-Delivery Note/Receivable Voucher-Delivery Note.txt b/stock/DocType Mapper/Receivable Voucher-Delivery Note/Receivable Voucher-Delivery Note.txt index 6688f2b08f..3fd88db1f4 100755 --- a/stock/DocType Mapper/Receivable Voucher-Delivery Note/Receivable Voucher-Delivery Note.txt +++ b/stock/DocType Mapper/Receivable Voucher-Delivery Note/Receivable Voucher-Delivery Note.txt @@ -5,7 +5,7 @@ { 'creation': '2010-12-15 08:39:22', 'docstatus': 0, - 'modified': '2010-12-14 20:43:41', + 'modified': '2011-09-07 12:08:19', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -22,7 +22,6 @@ # These values are common for all Field Mapper Detail { 'doctype': 'Field Mapper Detail', - 'map': 'Yes', 'name': '__common__', 'parent': 'Receivable Voucher-Delivery Note', 'parentfield': 'field_mapper_details', @@ -31,7 +30,7 @@ # These values are common for all DocType Mapper { - 'doctype': 'DocType Mapper', + 'doctype': u'DocType Mapper', 'from_doctype': 'Receivable Voucher', 'module': 'Stock', 'name': '__common__', @@ -41,7 +40,7 @@ # DocType Mapper, Receivable Voucher-Delivery Note { - 'doctype': 'DocType Mapper', + 'doctype': u'DocType Mapper', 'name': 'Receivable Voucher-Delivery Note' }, @@ -49,6 +48,7 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'eval: flt(obj.qty) - flt(obj.delivered_qty)', + 'map': 'Yes', 'match_id': 1, 'to_field': 'qty' }, @@ -57,6 +57,7 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'parent', + 'map': 'Yes', 'match_id': 1, 'to_field': 'prevdoc_docname' }, @@ -65,6 +66,7 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'parenttype', + 'map': 'Yes', 'match_id': 1, 'to_field': 'prevdoc_doctype' }, @@ -73,6 +75,7 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'name', + 'map': 'Yes', 'match_id': 1, 'to_field': 'prevdoc_detail_docname' }, @@ -81,6 +84,7 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'eval: (flt(obj.qty) - flt(obj.delivered_qty)) * flt(obj.basic_rate)', + 'map': 'Yes', 'match_id': 1, 'to_field': 'amount' }, @@ -89,6 +93,7 @@ { 'doctype': 'Field Mapper Detail', 'from_field': 'eval: (flt(obj.qty) - flt(obj.delivered_qty)) * flt(obj.export_rate)', + 'map': 'Yes', 'match_id': 1, 'to_field': 'export_amount' }, @@ -96,9 +101,10 @@ # Field Mapper Detail { 'doctype': 'Field Mapper Detail', - 'from_field': 'customer_address', + 'from_field': 'naming_series', + 'map': 'No', 'match_id': 0, - 'to_field': 'delivery_address' + 'to_field': 'naming_series' }, # Table Mapper Detail diff --git a/stock/DocType Mapper/Sales Order-Delivery Note/Sales Order-Delivery Note.txt b/stock/DocType Mapper/Sales Order-Delivery Note/Sales Order-Delivery Note.txt index f93fadfb58..efaf13eb64 100644 --- a/stock/DocType Mapper/Sales Order-Delivery Note/Sales Order-Delivery Note.txt +++ b/stock/DocType Mapper/Sales Order-Delivery Note/Sales Order-Delivery Note.txt @@ -5,8 +5,8 @@ { 'creation': '2010-08-08 17:09:35', 'docstatus': 0, - 'modified': '2011-05-16 11:48:19', - 'modified_by': 'umair@iwebnotes.com', + 'modified': '2011-09-07 12:06:54', + 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -30,7 +30,7 @@ # These values are common for all DocType Mapper { - 'doctype': 'DocType Mapper', + 'doctype': u'DocType Mapper', 'from_doctype': 'Sales Order', 'module': 'Stock', 'name': '__common__', @@ -40,7 +40,7 @@ # DocType Mapper, Sales Order-Delivery Note { - 'doctype': 'DocType Mapper', + 'doctype': u'DocType Mapper', 'name': 'Sales Order-Delivery Note' }, @@ -174,15 +174,6 @@ 'to_field': 'warehouse' }, - # Field Mapper Detail - { - 'doctype': 'Field Mapper Detail', - 'from_field': 'allocated_amount', - 'map': 'Yes', - 'match_id': 0, - 'to_field': 'customer_mobile_no' - }, - # Field Mapper Detail { 'checking_operator': '=', @@ -203,6 +194,24 @@ 'to_field': 'customer' }, + # Field Mapper Detail + { + 'doctype': 'Field Mapper Detail', + 'from_field': 'naming_series', + 'map': 'No', + 'match_id': 0, + 'to_field': 'naming_series' + }, + + # Field Mapper Detail + { + 'doctype': 'Field Mapper Detail', + 'from_field': 'status', + 'map': 'No', + 'match_id': 0, + 'to_field': 'status' + }, + # Table Mapper Detail { 'doctype': 'Table Mapper Detail', From c94ba8a4c0b2299920177534f53896922956ce77 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 9 Sep 2011 17:47:08 +0530 Subject: [PATCH 21/31] error fixed in accounts payable (column shifted) --- .../search_criteria/accounts_payable/accounts_payable.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/accounts/search_criteria/accounts_payable/accounts_payable.py b/accounts/search_criteria/accounts_payable/accounts_payable.py index 8c07b68b45..44daddcf3c 100644 --- a/accounts/search_criteria/accounts_payable/accounts_payable.py +++ b/accounts/search_criteria/accounts_payable/accounts_payable.py @@ -90,9 +90,13 @@ for r in res: # supplier type r.append(supp_type_dict.get(r[col_idx['Account']], '')) + if r[col_idx['Voucher Type']] == 'Payable Voucher': + r += pv_dict.get(r[col_idx['Voucher No']], ['', '', '']) + else: + r += ['', '', ''] + # if entry against Payable Voucher if r[col_idx['Against Voucher']] and r[col_idx['Voucher Type']] == 'Payable Voucher': - r += pv_dict.get(r[col_idx['Voucher No']], ['', '', '']) cond = " and ifnull(against_voucher, '') = '%s'" % r[col_idx['Against Voucher']] # if entry against JV & and not adjusted within period From 40693e319001e2290047b415ce37ae0264edc552 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 9 Sep 2011 17:55:25 +0530 Subject: [PATCH 22/31] post_render in pv and AP report error solved --- accounts/doctype/payable_voucher/payable_voucher.js | 11 +++++++---- .../accounts_payable/accounts_payable.py | 6 +++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/accounts/doctype/payable_voucher/payable_voucher.js b/accounts/doctype/payable_voucher/payable_voucher.js index 4a566d373b..e3b986d8a1 100644 --- a/accounts/doctype/payable_voucher/payable_voucher.js +++ b/accounts/doctype/payable_voucher/payable_voucher.js @@ -20,12 +20,15 @@ cur_frm.cscript.onload = function(doc,dt,dn) { } if(doc.__islocal){ - if(doc.supplier) {cur_frm.cscript.supplier(doc,dt,dn)} - hide_field(['supplier_address','contact_person','supplier_name','address_display','contact_display','contact_mobile','contact_email']); + hide_field(['supplier_address', 'contact_person', 'supplier_name', 'address_display', 'contact_display', 'contact_mobile', 'contact_email']); } - +} - if(doc.supplier) unhide_field(['supplier_address','contact_person','supplier_name','address_display','contact_display','contact_mobile','contact_email']); + +//Onload post render +//------------------------ +cur_frm.cscript.onload_post_render = function(doc, dt, dn) { + if(doc.__islocal && doc.supplier) cur_frm.cscript.supplier(doc,dt,dn); } // Refresh diff --git a/accounts/search_criteria/accounts_payable/accounts_payable.py b/accounts/search_criteria/accounts_payable/accounts_payable.py index 8c07b68b45..44daddcf3c 100644 --- a/accounts/search_criteria/accounts_payable/accounts_payable.py +++ b/accounts/search_criteria/accounts_payable/accounts_payable.py @@ -90,9 +90,13 @@ for r in res: # supplier type r.append(supp_type_dict.get(r[col_idx['Account']], '')) + if r[col_idx['Voucher Type']] == 'Payable Voucher': + r += pv_dict.get(r[col_idx['Voucher No']], ['', '', '']) + else: + r += ['', '', ''] + # if entry against Payable Voucher if r[col_idx['Against Voucher']] and r[col_idx['Voucher Type']] == 'Payable Voucher': - r += pv_dict.get(r[col_idx['Voucher No']], ['', '', '']) cond = " and ifnull(against_voucher, '') = '%s'" % r[col_idx['Against Voucher']] # if entry against JV & and not adjusted within period From 270e4e201a6f60bef2dc2bd3438781d84f74899e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 9 Sep 2011 17:59:20 +0530 Subject: [PATCH 23/31] post_render in pv and AP report error solved --- accounts/doctype/payable_voucher/payable_voucher.js | 11 +++++++---- .../accounts_payable/accounts_payable.py | 6 +++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/accounts/doctype/payable_voucher/payable_voucher.js b/accounts/doctype/payable_voucher/payable_voucher.js index 4a566d373b..e3b986d8a1 100644 --- a/accounts/doctype/payable_voucher/payable_voucher.js +++ b/accounts/doctype/payable_voucher/payable_voucher.js @@ -20,12 +20,15 @@ cur_frm.cscript.onload = function(doc,dt,dn) { } if(doc.__islocal){ - if(doc.supplier) {cur_frm.cscript.supplier(doc,dt,dn)} - hide_field(['supplier_address','contact_person','supplier_name','address_display','contact_display','contact_mobile','contact_email']); + hide_field(['supplier_address', 'contact_person', 'supplier_name', 'address_display', 'contact_display', 'contact_mobile', 'contact_email']); } - +} - if(doc.supplier) unhide_field(['supplier_address','contact_person','supplier_name','address_display','contact_display','contact_mobile','contact_email']); + +//Onload post render +//------------------------ +cur_frm.cscript.onload_post_render = function(doc, dt, dn) { + if(doc.__islocal && doc.supplier) cur_frm.cscript.supplier(doc,dt,dn); } // Refresh diff --git a/accounts/search_criteria/accounts_payable/accounts_payable.py b/accounts/search_criteria/accounts_payable/accounts_payable.py index 8c07b68b45..44daddcf3c 100644 --- a/accounts/search_criteria/accounts_payable/accounts_payable.py +++ b/accounts/search_criteria/accounts_payable/accounts_payable.py @@ -90,9 +90,13 @@ for r in res: # supplier type r.append(supp_type_dict.get(r[col_idx['Account']], '')) + if r[col_idx['Voucher Type']] == 'Payable Voucher': + r += pv_dict.get(r[col_idx['Voucher No']], ['', '', '']) + else: + r += ['', '', ''] + # if entry against Payable Voucher if r[col_idx['Against Voucher']] and r[col_idx['Voucher Type']] == 'Payable Voucher': - r += pv_dict.get(r[col_idx['Voucher No']], ['', '', '']) cond = " and ifnull(against_voucher, '') = '%s'" % r[col_idx['Against Voucher']] # if entry against JV & and not adjusted within period From 0d1397f3abdb8a5119d38302e4602d2ad77a8afa Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Sat, 10 Sep 2011 15:23:20 +0530 Subject: [PATCH 24/31] Edited README via GitHub --- README | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README b/README index 37967291f6..5f3ecd6996 100644 --- a/README +++ b/README @@ -1 +1,3 @@ -erpnext +For more info, download, install + +http://erpnext.org \ No newline at end of file From ad61f81f85b4a58c4206b289768ead232760315c Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 12 Sep 2011 13:24:08 +0530 Subject: [PATCH 25/31] Added new report: voucher wise tax details --- .../voucher_wise_tax_details/__init__.py | 0 .../voucher_wise_tax_details.js | 47 +++++++++++++++++++ .../voucher_wise_tax_details.py | 22 +++++++++ .../voucher_wise_tax_details.txt | 34 ++++++++++++++ 4 files changed, 103 insertions(+) create mode 100644 accounts/search_criteria/voucher_wise_tax_details/__init__.py create mode 100644 accounts/search_criteria/voucher_wise_tax_details/voucher_wise_tax_details.js create mode 100644 accounts/search_criteria/voucher_wise_tax_details/voucher_wise_tax_details.py create mode 100644 accounts/search_criteria/voucher_wise_tax_details/voucher_wise_tax_details.txt diff --git a/accounts/search_criteria/voucher_wise_tax_details/__init__.py b/accounts/search_criteria/voucher_wise_tax_details/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/accounts/search_criteria/voucher_wise_tax_details/voucher_wise_tax_details.js b/accounts/search_criteria/voucher_wise_tax_details/voucher_wise_tax_details.js new file mode 100644 index 0000000000..a89fa86083 --- /dev/null +++ b/accounts/search_criteria/voucher_wise_tax_details/voucher_wise_tax_details.js @@ -0,0 +1,47 @@ +report.customize_filters = function() { + this.hide_all_filters(); + + //Add filter + this.add_filter({fieldname:'based_on', label:'Based On', fieldtype:'Select', options:'Sales Order'+NEWLINE+'Delivery Note'+NEWLINE+'Sales Invoice', report_default:'Sales Invoice', ignore : 1,parent:'RV Tax Detail', single_select :1, in_first_page:1}); + + this.add_filter({fieldname:'posting_date', label:'Date', fieldtype:'Date', options:'', ignore : 1,parent:'RV Tax Detail', in_first_page:1}); + + this.add_filter({fieldname:'voucher_id', label:'Voucher Id', fieldtype:'Data', options:'', ignore : 1,parent:'RV Tax Detail', in_first_page:1}); + + this.add_filter({fieldname:'tax_account', label:'Tax Account', fieldtype:'Link', options:'Account', ignore : 1,parent:'RV Tax Detail', in_first_page:1}); +} + + +// hide sections +//-------------------------------------- +this.mytabs.items['More Filters'].hide(); +this.mytabs.items['Select Columns'].hide(); + +// Get query +//-------------------------------------- +report.get_query = function() { + based_on = this.get_filter('RV Tax Detail', 'Based On').get_value(); + from_date = this.get_filter('RV Tax Detail', 'From Date').get_value(); + to_date = this.get_filter('RV Tax Detail', 'To Date').get_value(); + vid = this.get_filter('RV Tax Detail', 'Voucher Id').get_value(); + acc = this.get_filter('RV Tax Detail', 'Tax Account').get_value(); + + date_fld = 'transaction_date'; + if(based_on == 'Sales Invoice') { + based_on = 'Receivable Voucher'; + date_fld = 'voucher_date'; + } + + sp_cond = ''; + if (from_date) sp_cond += repl(' AND t1.%(dt)s >= "%(from_date)s"', {dt:date_fld, from_date:from_date}); + if (to_date) sp_cond += repl(' AND t1.%(dt)s <= "%(to_date)s"', {dt:date_fld, to_date:to_date}); + if (vid) sp_cond += repl(' AND t1.name LIKE "%%(voucher)s%"', {voucher:vid}); + if (acc) sp_cond += repl(' AND t2.account_head = "%(acc)s"', {acc:acc}); + + return repl('SELECT t1.`name`, t1.`%(dt)s`, t1.`customer_name`, t1.net_total, t2.account_head, t2.description, t2.rate, t2.tax_amount \ + FROM `tab%(parent)s` t1, `tabRV Tax Detail` t2 \ + WHERE t1.docstatus=1 AND t2.`parenttype` = "%(parent)s" \ + AND t2.`parent` = t1.`name` \ + %(cond)s ORDER BY t1.`name` DESC, t1.%(dt)s DESC', {parent:based_on, cond:sp_cond, dt:date_fld}); +} + diff --git a/accounts/search_criteria/voucher_wise_tax_details/voucher_wise_tax_details.py b/accounts/search_criteria/voucher_wise_tax_details/voucher_wise_tax_details.py new file mode 100644 index 0000000000..91e90f2fe4 --- /dev/null +++ b/accounts/search_criteria/voucher_wise_tax_details/voucher_wise_tax_details.py @@ -0,0 +1,22 @@ +if filter_values.get('based_on') == 'Sales Invoice': + based_on_dt = 'Receivable Voucher' +else: + based_on_dt = filter_values.get('based_on') + +cols = [ + [filter_values.get('based_on'), 'Link','150px', based_on_dt], + ['Transaction Date', 'Date', '120px', ''], + ['Customer', 'Link','150px','Customer'], + ['Net Total', 'Currency', '80px', ''], + ['Tax Account', 'Link','150px','Account'], + ['Description', 'Text','120px',''], + ['Tax Rate', 'Currency', '80px', ''], + ['Tax Amount', 'Currency', '80px', ''] +] + +for c in cols: + colnames.append(c[0]) + coltypes.append(c[1]) + colwidths.append(c[2]) + coloptions.append(c[3]) + col_idx[c[0]] = len(colnames)-1 diff --git a/accounts/search_criteria/voucher_wise_tax_details/voucher_wise_tax_details.txt b/accounts/search_criteria/voucher_wise_tax_details/voucher_wise_tax_details.txt new file mode 100644 index 0000000000..c152c7905f --- /dev/null +++ b/accounts/search_criteria/voucher_wise_tax_details/voucher_wise_tax_details.txt @@ -0,0 +1,34 @@ +# Search Criteria, voucher_wise_tax_details +[ + + # These values are common in all dictionaries + { + 'creation': '2011-09-06 15:36:58', + 'docstatus': 0, + 'modified': '2011-09-06 15:50:28', + 'modified_by': 'Administrator', + 'owner': 'Administrator' + }, + + # These values are common for all Search Criteria + { + 'columns': 'RV Tax Detail\x01Type,RV Tax Detail\x01Account Head,RV Tax Detail\x01Cost Center,RV Tax Detail\x01Description,RV Tax Detail\x01Rate,RV Tax Detail\x01Amount*,RV Tax Detail\x01Total*', + 'criteria_name': 'Voucher wise tax details', + 'doc_type': 'RV Tax Detail', + 'doctype': 'Search Criteria', + 'filters': "{'Delivery Note\x01Submitted':1,'Delivery Note\x01Status':'','Delivery Note\x01Fiscal Year':''}", + 'module': 'Accounts', + 'name': '__common__', + 'page_len': 50, + 'parent_doc_type': 'Delivery Note', + 'sort_by': '`tabRV Tax Detail`.`parent`', + 'sort_order': 'DESC', + 'standard': 'Yes' + }, + + # Search Criteria, voucher_wise_tax_details + { + 'doctype': 'Search Criteria', + 'name': 'voucher_wise_tax_details' + } +] \ No newline at end of file From 048b1a98bc5ee23c93564bb5ef7271d2a9d78e2e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 12 Sep 2011 13:25:04 +0530 Subject: [PATCH 26/31] voucher wise tax details report link added in accounts module --- accounts/Module Def/Accounts/Accounts.txt | 150 ++++++++-------------- 1 file changed, 51 insertions(+), 99 deletions(-) diff --git a/accounts/Module Def/Accounts/Accounts.txt b/accounts/Module Def/Accounts/Accounts.txt index 512b460b82..50a7ac9697 100644 --- a/accounts/Module Def/Accounts/Accounts.txt +++ b/accounts/Module Def/Accounts/Accounts.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2010-09-25 10:50:34', + 'creation': '2010-09-25 10:50:37', 'docstatus': 0, - 'modified': '2011-07-28 12:01:10', + 'modified': '2011-09-12 13:22:15', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -31,7 +31,7 @@ # These values are common for all Module Def { 'disabled': 'No', - 'doctype': 'Module Def', + 'doctype': u'Module Def', 'doctype_list': 'GL Mapper, Journal Voucher\nGL Mapper, Payable Voucher\nGL Mapper, Receivable Voucher\nDocType Label, Receivable Voucher\nDocType Label, Payable Voucher', 'file_list': 'finance.gif,FileData/00210', 'is_hidden': 'No', @@ -40,13 +40,13 @@ 'module_icon': 'Accounts.gif', 'module_label': 'Accounts', 'module_name': 'Accounts', - 'module_seq': 3, + 'module_seq': 5, 'name': '__common__' }, # Module Def, Accounts { - 'doctype': 'Module Def', + 'doctype': u'Module Def', 'name': 'Accounts' }, @@ -57,8 +57,7 @@ 'display_name': 'Chart of Accounts', 'doc_name': 'Accounts Browser', 'doc_type': 'Pages', - 'doctype': 'Module Def Item', - 'idx': 1 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -68,8 +67,7 @@ 'display_name': 'Chart of Cost Centers', 'doc_name': 'Accounts Browser', 'doc_type': 'Pages', - 'doctype': 'Module Def Item', - 'idx': 2 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -79,8 +77,7 @@ 'doc_name': 'Journal Voucher', 'doc_type': 'Forms', 'doctype': 'Module Def Item', - 'fields': 'voucher_type\nvoucher_date\nfiscal_year\ntotal_debit\ntotal_credit', - 'idx': 3 + 'fields': 'voucher_type\nvoucher_date\nfiscal_year\ntotal_debit\ntotal_credit' }, # Module Def Item @@ -90,8 +87,7 @@ 'doc_name': 'Receivable Voucher', 'doc_type': 'Forms', 'doctype': 'Module Def Item', - 'fields': 'voucher_date\ndue_date\ndebit_to\ngrand_total\noutstanding_amount', - 'idx': 4 + 'fields': 'voucher_date\ndue_date\ndebit_to\ngrand_total\noutstanding_amount' }, # Module Def Item @@ -101,8 +97,7 @@ 'doc_name': 'Payable Voucher', 'doc_type': 'Forms', 'doctype': 'Module Def Item', - 'fields': 'voucher_date\ncredit_to\nbill_no\ngrand_total\noutstanding_amount', - 'idx': 5 + 'fields': 'voucher_date\ncredit_to\nbill_no\ngrand_total\noutstanding_amount' }, # Module Def Item @@ -111,8 +106,7 @@ 'display_name': 'Lease Agreement', 'doc_name': 'Lease Agreement', 'doc_type': 'Forms', - 'doctype': 'Module Def Item', - 'idx': 6 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -122,8 +116,7 @@ 'doc_name': 'Financial Statements', 'doc_type': 'Pages', 'doctype': 'Module Def Item', - 'icon': 'table.gif', - 'idx': 7 + 'icon': 'table.gif' }, # Module Def Item @@ -132,8 +125,7 @@ 'display_name': 'Bank Reconciliation', 'doc_name': 'Bank Reconciliation', 'doc_type': 'Single DocType', - 'doctype': 'Module Def Item', - 'idx': 8 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -141,8 +133,7 @@ 'display_name': 'TDS Payment', 'doc_name': 'TDS Payment', 'doc_type': 'Setup Forms', - 'doctype': 'Module Def Item', - 'idx': 9 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -150,8 +141,7 @@ 'display_name': 'TDS Return Acknowledgement', 'doc_name': 'TDS Return Acknowledgement', 'doc_type': 'Setup Forms', - 'doctype': 'Module Def Item', - 'idx': 10 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -159,8 +149,7 @@ 'display_name': 'Form 16A', 'doc_name': 'Form 16A', 'doc_type': 'Setup Forms', - 'doctype': 'Module Def Item', - 'idx': 11 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -169,8 +158,7 @@ 'display_name': 'Period Closing Voucher', 'doc_name': 'Period Closing Voucher', 'doc_type': 'Setup Forms', - 'doctype': 'Module Def Item', - 'idx': 12 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -179,8 +167,7 @@ 'display_name': 'Ledger Balance Export', 'doc_name': 'Ledger Balance Export', 'doc_type': 'Single DocType', - 'doctype': 'Module Def Item', - 'idx': 13 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -188,8 +175,7 @@ 'display_name': 'General Ledger', 'doc_name': 'GL Entry', 'doc_type': 'Reports', - 'doctype': 'Module Def Item', - 'idx': 14 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -197,8 +183,7 @@ 'display_name': 'Accounts Receivable', 'doc_name': 'GL Entry', 'doc_type': 'Reports', - 'doctype': 'Module Def Item', - 'idx': 15 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -206,8 +191,7 @@ 'display_name': 'Accounts Payable', 'doc_name': 'GL Entry', 'doc_type': 'Reports', - 'doctype': 'Module Def Item', - 'idx': 16 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -215,8 +199,7 @@ 'display_name': 'Bank Reconciliation Statement', 'doc_name': 'Journal Voucher Detail', 'doc_type': 'Reports', - 'doctype': 'Module Def Item', - 'idx': 17 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -224,8 +207,7 @@ 'display_name': 'Trial Balance', 'doc_name': 'Account', 'doc_type': 'Reports', - 'doctype': 'Module Def Item', - 'idx': 18 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -233,8 +215,7 @@ 'display_name': 'Sales Register', 'doc_name': 'Receivable Voucher', 'doc_type': 'Reports', - 'doctype': 'Module Def Item', - 'idx': 19 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -242,8 +223,7 @@ 'display_name': 'Purchase Register', 'doc_name': 'Payable Voucher', 'doc_type': 'Reports', - 'doctype': 'Module Def Item', - 'idx': 20 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -251,8 +231,7 @@ 'display_name': 'Bank Clearance report', 'doc_name': 'Journal Voucher Detail', 'doc_type': 'Reports', - 'doctype': 'Module Def Item', - 'idx': 21 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -260,8 +239,7 @@ 'display_name': 'Monthly Ledger Summary Report', 'doc_name': 'GL Entry', 'doc_type': 'Reports', - 'doctype': 'Module Def Item', - 'idx': 22 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -269,8 +247,7 @@ 'display_name': 'Collection Report', 'doc_name': 'Journal Voucher Detail', 'doc_type': 'Reports', - 'doctype': 'Module Def Item', - 'idx': 23 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -278,8 +255,7 @@ 'display_name': 'Total amout collection for a period - Customerwise', 'doc_name': 'Account', 'doc_type': 'Reports', - 'doctype': 'Module Def Item', - 'idx': 24 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -287,8 +263,7 @@ 'display_name': 'Payment Report', 'doc_name': 'Journal Voucher Detail', 'doc_type': 'Reports', - 'doctype': 'Module Def Item', - 'idx': 25 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -296,8 +271,7 @@ 'display_name': 'Itemwise Sales Register', 'doc_name': 'RV Detail', 'doc_type': 'Reports', - 'doctype': 'Module Def Item', - 'idx': 26 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -305,8 +279,7 @@ 'display_name': 'Itemwise Purchase Register', 'doc_name': 'PV Detail', 'doc_type': 'Reports', - 'doctype': 'Module Def Item', - 'idx': 27 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -314,8 +287,7 @@ 'display_name': 'Cost Center wise Expense', 'doc_name': 'GL Entry', 'doc_type': 'Reports', - 'doctype': 'Module Def Item', - 'idx': 28 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -323,8 +295,7 @@ 'display_name': 'TDS Return', 'doc_name': 'TDS Payment Detail', 'doc_type': 'Reports', - 'doctype': 'Module Def Item', - 'idx': 29 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -332,8 +303,7 @@ 'display_name': 'Budget Variance Report', 'doc_name': 'Budget Detail', 'doc_type': 'Reports', - 'doctype': 'Module Def Item', - 'idx': 30 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -341,8 +311,7 @@ 'display_name': 'Payment Receipt Report', 'doc_name': 'GL Entry', 'doc_type': 'Reports', - 'doctype': 'Module Def Item', - 'idx': 31 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -351,8 +320,7 @@ 'display_name': 'Business Associate Commission Report', 'doc_name': 'Receivable Voucher', 'doc_type': 'Reports', - 'doctype': 'Module Def Item', - 'idx': 32 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -360,8 +328,7 @@ 'display_name': 'Lease Agreement List', 'doc_name': 'GL Entry', 'doc_type': 'Reports', - 'doctype': 'Module Def Item', - 'idx': 33 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -369,8 +336,7 @@ 'display_name': 'Lease Monthly Future Installment Inflows', 'doc_name': 'GL Entry', 'doc_type': 'Reports', - 'doctype': 'Module Def Item', - 'idx': 34 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -378,8 +344,7 @@ 'display_name': 'Lease Overdue Age Wise', 'doc_name': 'GL Entry', 'doc_type': 'Reports', - 'doctype': 'Module Def Item', - 'idx': 35 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -387,8 +352,7 @@ 'display_name': 'Lease Overdue List', 'doc_name': 'GL Entry', 'doc_type': 'Reports', - 'doctype': 'Module Def Item', - 'idx': 36 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -396,17 +360,7 @@ 'display_name': 'Lease Receipts Client Wise', 'doc_name': 'GL Entry', 'doc_type': 'Reports', - 'doctype': 'Module Def Item', - 'idx': 37 - }, - - # Module Def Item - { - 'display_name': 'Lease Receipt Summary Month Wise', - 'doc_name': 'GL Entry', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item', - 'idx': 38 + 'doctype': 'Module Def Item' }, # Module Def Item @@ -414,28 +368,26 @@ 'display_name': 'Lease Yearly Future Installment Inflows', 'doc_name': 'GL Entry', 'doc_type': 'Reports', - 'doctype': 'Module Def Item', - 'idx': 39 + 'doctype': 'Module Def Item' + }, + + # Module Def Item + { + 'display_name': 'Voucher wise tax details', + 'doc_name': 'RV Tax Detail', + 'doc_type': 'Reports', + 'doctype': 'Module Def Item' }, # Module Def Role { 'doctype': 'Module Def Role', - 'idx': 1, 'role': 'Accounts Manager' }, # Module Def Role { 'doctype': 'Module Def Role', - 'idx': 2, 'role': 'Accounts User' - }, - - # Module Def Role - { - 'doctype': 'Module Def Role', - 'idx': 3, - 'role': 'Administrator' } ] \ No newline at end of file From 42bdf8c1fa776f6df1e91e749463d9532ae0f708 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 12 Sep 2011 13:26:24 +0530 Subject: [PATCH 27/31] Error fixed in Lease related reports link in module page --- patches/patch.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index c085504ebb..8bd7de2456 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 360 +last_patch = 361 #------------------------------------------- @@ -317,3 +317,5 @@ def execute(patch_no): sql("update `tabDocField` set print_hide =1 where fieldname in ('pack_no', 'pack_gross_wt', 'weight_uom', 'pack_nett_wt') and parent = 'Delivery Note Detail'") elif patch_no == 360: sql("update `tabDocField` set print_hide =1 where fieldname = 'print_packing_slip' and parent = 'Delivery Note'") + elif patch_no == 361: + sql("update `tabModule Def Item` set doc_name = 'GL Entry' where display_name in ('Lease Agreement List', 'Lease Monthly Future Installment Inflows', 'Lease Overdue Age Wise', 'Lease Overdue List', 'Lease Receipts Client Wise', 'Lease Receipt Summary Month Wise', 'Lease Yearly Future Installment Inflows') and parent = 'Accounts'") From 4b66a1fa71f3301b324ec4cdbf6fb7bb1d400881 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 13 Sep 2011 13:35:14 +0530 Subject: [PATCH 28/31] sales person incentives added in mapper exception flds --- .../Delivery Note-Receivable Voucher.txt | 11 ++++++++++- .../Sales Order-Receivable Voucher.txt | 11 ++++++++++- .../Sales Order-Delivery Note.txt | 11 ++++++++++- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/accounts/DocType Mapper/Delivery Note-Receivable Voucher/Delivery Note-Receivable Voucher.txt b/accounts/DocType Mapper/Delivery Note-Receivable Voucher/Delivery Note-Receivable Voucher.txt index 2de54f6064..ee94be8e4d 100644 --- a/accounts/DocType Mapper/Delivery Note-Receivable Voucher/Delivery Note-Receivable Voucher.txt +++ b/accounts/DocType Mapper/Delivery Note-Receivable Voucher/Delivery Note-Receivable Voucher.txt @@ -5,7 +5,7 @@ { 'creation': '2010-08-08 17:09:34', 'docstatus': 0, - 'modified': '2011-09-07 12:12:58', + 'modified': '2011-09-13 13:23:44', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -116,6 +116,15 @@ 'to_field': 'naming_series' }, + # Field Mapper Detail + { + 'doctype': 'Field Mapper Detail', + 'from_field': 'incentives', + 'map': 'No', + 'match_id': 3, + 'to_field': 'incentives' + }, + # Table Mapper Detail { 'doctype': 'Table Mapper Detail', diff --git a/accounts/DocType Mapper/Sales Order-Receivable Voucher/Sales Order-Receivable Voucher.txt b/accounts/DocType Mapper/Sales Order-Receivable Voucher/Sales Order-Receivable Voucher.txt index 3d4b936294..97b1cb2380 100644 --- a/accounts/DocType Mapper/Sales Order-Receivable Voucher/Sales Order-Receivable Voucher.txt +++ b/accounts/DocType Mapper/Sales Order-Receivable Voucher/Sales Order-Receivable Voucher.txt @@ -5,7 +5,7 @@ { 'creation': '2010-08-08 17:09:36', 'docstatus': 0, - 'modified': '2011-09-07 12:05:03', + 'modified': '2011-09-13 13:23:04', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -127,6 +127,15 @@ 'to_field': 'naming_series' }, + # Field Mapper Detail + { + 'doctype': 'Field Mapper Detail', + 'from_field': 'incentives', + 'map': 'No', + 'match_id': 3, + 'to_field': 'incentives' + }, + # Table Mapper Detail { 'doctype': 'Table Mapper Detail', diff --git a/stock/DocType Mapper/Sales Order-Delivery Note/Sales Order-Delivery Note.txt b/stock/DocType Mapper/Sales Order-Delivery Note/Sales Order-Delivery Note.txt index efaf13eb64..9b08913252 100644 --- a/stock/DocType Mapper/Sales Order-Delivery Note/Sales Order-Delivery Note.txt +++ b/stock/DocType Mapper/Sales Order-Delivery Note/Sales Order-Delivery Note.txt @@ -5,7 +5,7 @@ { 'creation': '2010-08-08 17:09:35', 'docstatus': 0, - 'modified': '2011-09-07 12:06:54', + 'modified': '2011-09-13 13:23:26', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -212,6 +212,15 @@ 'to_field': 'status' }, + # Field Mapper Detail + { + 'doctype': 'Field Mapper Detail', + 'from_field': 'incentives', + 'map': 'No', + 'match_id': 3, + 'to_field': 'incentives' + }, + # Table Mapper Detail { 'doctype': 'Table Mapper Detail', From 5156570fd40af5999c8eff185f60a903e93d2334 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 13 Sep 2011 13:36:40 +0530 Subject: [PATCH 29/31] set no_copy for flds status, file_list, naming_series, amended_from and amendment_date --- patches/patch.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index 8bd7de2456..1797fa574f 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 361 +last_patch = 362 #------------------------------------------- @@ -319,3 +319,5 @@ def execute(patch_no): sql("update `tabDocField` set print_hide =1 where fieldname = 'print_packing_slip' and parent = 'Delivery Note'") elif patch_no == 361: sql("update `tabModule Def Item` set doc_name = 'GL Entry' where display_name in ('Lease Agreement List', 'Lease Monthly Future Installment Inflows', 'Lease Overdue Age Wise', 'Lease Overdue List', 'Lease Receipts Client Wise', 'Lease Receipt Summary Month Wise', 'Lease Yearly Future Installment Inflows') and parent = 'Accounts'") + elif patch_no == 362: + sql("update `tabDocField` set no_copy = 1 where fieldname in ('amended_from', 'amendment_date', 'file_list', 'naming_series', 'status')") From 843c5a554e70a5401b54bd6c6255a0040a55306e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 13 Sep 2011 15:09:22 +0530 Subject: [PATCH 30/31] no_copy fields patch --- patches/patch.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index 88f4b53551..f419204f6a 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 360 +last_patch = 362 #------------------------------------------- @@ -317,3 +317,7 @@ def execute(patch_no): delete_doc('DocType', 'Salary Control Panel') elif patch_no == 360: sql("delete from `tabDocField` where (fieldname in ('client_string', 'server_code_error', 'server_code_compiled', 'server_code', 'server_code_core', 'client_script', 'client_script_core', 'dt_template', 'change_log') or label = 'Template') and parent = 'DocType'") + elif patch_no == 361: + sql("update `tabModule Def Item` set doc_name = 'GL Entry' where display_name in ('Lease Agreement List', 'Lease Monthly Future Installment Inflows', 'Lease Overdue Age Wise', 'Lease Overdue List', 'Lease Receipts Client Wise', 'Lease Receipt Summary Month Wise', 'Lease Yearly Future Installment Inflows') and parent = 'Accounts'") + elif patch_no == 362: + sql("update `tabDocField` set no_copy = 1 where fieldname in ('amended_from', 'amendment_date', 'file_list', 'naming_series', 'status')") From 7272080eeb9a1cc87abf9f3dc0f36bdc66d8bb00 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 13 Sep 2011 15:24:49 +0530 Subject: [PATCH 31/31] reload voucherwise tax details report and all mappers --- patches/patch.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index f419204f6a..cee21311e3 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 362 +last_patch = 363 #------------------------------------------- @@ -321,3 +321,10 @@ def execute(patch_no): sql("update `tabModule Def Item` set doc_name = 'GL Entry' where display_name in ('Lease Agreement List', 'Lease Monthly Future Installment Inflows', 'Lease Overdue Age Wise', 'Lease Overdue List', 'Lease Receipts Client Wise', 'Lease Receipt Summary Month Wise', 'Lease Yearly Future Installment Inflows') and parent = 'Accounts'") elif patch_no == 362: sql("update `tabDocField` set no_copy = 1 where fieldname in ('amended_from', 'amendment_date', 'file_list', 'naming_series', 'status')") + elif patch_no == 363: + reload_doc('accounts', 'search_criteria', 'voucher_wise_tax_details') + reload_doc('accounts', 'Module Def', 'Accounts') + mappers = sql("select name, module from `tabDocType Mapper`") + for d in mappers: + if d[0] and d[1]: + reload_doc(d[1].lower(), 'DocType Mapper', d[0])