diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt b/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt index f66f877272d..5ec5552fe46 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt @@ -5,7 +5,7 @@ { 'creation': '2012-04-13 11:56:18', 'docstatus': 0, - 'modified': '2012-05-02 09:57:50', + 'modified': '2012-05-04 11:56:59', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -296,19 +296,6 @@ 'search_index': 1 }, - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'posting_time', - 'fieldtype': u'Time', - 'label': u'Posting Time', - 'no_copy': 1, - 'oldfieldname': u'posting_time', - 'oldfieldtype': u'Time', - 'permlevel': 0, - 'print_hide': 1 - }, - # DocField { 'colour': u'White:FFF', @@ -327,6 +314,18 @@ 'search_index': 0 }, + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'mode_of_payment', + 'fieldtype': u'Select', + 'label': u'Mode of Payment', + 'oldfieldname': u'mode_of_payment', + 'oldfieldtype': u'Select', + 'options': u'link:Mode of Payment', + 'permlevel': 0 + }, + # DocField { 'colour': u'White:FFF', @@ -1091,6 +1090,19 @@ 'print_hide': 1 }, + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'posting_time', + 'fieldtype': u'Time', + 'label': u'Posting Time', + 'no_copy': 1, + 'oldfieldname': u'posting_time', + 'oldfieldtype': u'Time', + 'permlevel': 0, + 'print_hide': 1 + }, + # DocField { 'allow_on_submit': 1, @@ -1106,18 +1118,6 @@ 'print_hide': 1 }, - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'mode_of_payment', - 'fieldtype': u'Select', - 'label': u'Mode of Payment', - 'oldfieldname': u'mode_of_payment', - 'oldfieldtype': u'Select', - 'options': u'link:Mode of Payment', - 'permlevel': 0 - }, - # DocField { 'doctype': u'DocField', diff --git a/erpnext/accounts/search_criteria/trend_analyzer/trend_analyzer.js b/erpnext/accounts/search_criteria/trend_analyzer/trend_analyzer.js index dd3e75082bd..53de71cb212 100644 --- a/erpnext/accounts/search_criteria/trend_analyzer/trend_analyzer.js +++ b/erpnext/accounts/search_criteria/trend_analyzer/trend_analyzer.js @@ -80,14 +80,8 @@ report.get_query = function() { add_col = ''; add_tables = ''; sp_cond = ''; - if(trans == 'Sales Invoice') trans = 'Sales Invoice'; - else if(trans == 'Purchase Invoice') trans = 'Purchase Invoice'; - trans_det = trans+' Detail' - - if(trans == 'Sales Invoice') trans_det = 'Sales Invoice Item'; - else if(trans == 'Purchase Invoice') trans_det = 'Purchase Invoice Item'; - else if(trans == 'Purchase Order') trans_det = 'Purchase Order Item'; + trans_det = trans+' Item' if(order_type != '') add_code += ' AND t1.order_type = '+order_type; diff --git a/erpnext/accounts/search_criteria/trend_analyzer/trend_analyzer.py b/erpnext/accounts/search_criteria/trend_analyzer/trend_analyzer.py index 278cfd6c789..4a7d0939c67 100644 --- a/erpnext/accounts/search_criteria/trend_analyzer/trend_analyzer.py +++ b/erpnext/accounts/search_criteria/trend_analyzer/trend_analyzer.py @@ -39,14 +39,8 @@ project = filter_values.get('project') # ********************************************* SET DEFAULTS ************************************************** # Details Table # -------------- -if trans == 'Sales Invoice': trans = 'Sales Invoice' -elif trans == 'Purchase Invoice': trans = 'Purchase Invoice' -trans_det = trans+' Detail' - -if trans == 'Sales Invoice': trans_det = 'Sales Invoice Item' -elif trans == 'Purchase Invoice': trans_det = 'Purchase Invoice Item' -elif trans == 'Purchase Order': trans_det = 'Purchase Order Item' +trans_det = trans+' Item' col_names, query_val = get_obj('Trend Analyzer Control').get_single_year_query_value(fiscal_year, period, trans, trans_det) query_val += 'SUM(t2.qty), SUM(t2.amount)' diff --git a/erpnext/accounts/search_criteria/trend_analyzer/trend_analyzer.txt b/erpnext/accounts/search_criteria/trend_analyzer/trend_analyzer.txt index 93a60e05c28..a1cf3e4ae16 100644 --- a/erpnext/accounts/search_criteria/trend_analyzer/trend_analyzer.txt +++ b/erpnext/accounts/search_criteria/trend_analyzer/trend_analyzer.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-04-03 12:49:53', + 'creation': '2012-04-23 12:46:00', 'docstatus': 0, - 'modified': '2012-04-03 12:49:53', + 'modified': '2012-05-04 12:49:43', 'modified_by': u'Administrator', 'owner': u'saumil@webnotestech.com' }, @@ -30,4 +30,4 @@ 'doctype': 'Search Criteria', 'name': u'trend_analyzer' } -] +] \ No newline at end of file diff --git a/erpnext/patches/may_2012/renamedt_in_custom_search_criteria.py b/erpnext/patches/may_2012/renamedt_in_custom_search_criteria.py new file mode 100644 index 00000000000..3ac1f8e0fb0 --- /dev/null +++ b/erpnext/patches/may_2012/renamedt_in_custom_search_criteria.py @@ -0,0 +1,99 @@ +def execute(): + import webnotes + rendt = { + 'Receivable Voucher' : 'Sales Invoice', + 'RV Detail' : 'Sales Invoice Item', + 'RV Tax Detail' : 'Sales Taxes and Charges', + 'Payable Voucher' : 'Purchase Invoice', + 'PV Detail' : 'Purchase Invoice Item', + 'Purchase Tax Detail' : 'Purchase Taxes and Charges', + 'Indent' : 'Purchase Request', + 'Indent Detail' : 'Purchase Request Item', + 'QA Inspection Report' : 'Quality Inspection', + 'Ticket' : 'Task', + 'Manage Account' : 'Global Defaults', + 'ToDo Item' : 'ToDo', + 'Term' : 'Terms and Conditions', + 'Static Parameter Detail' : 'SMS Parameter', + 'SS Earning Detail' : 'Salary Slip Earning', + 'SS Deduction Detail' : 'Salary Slip Deduction', + 'Sales Order Detail' : 'Sales Order Item', + 'Sales BOM Detail' : 'Sales BOM Item', + 'Return Detail' : 'Sales and Purchase Return Item', + 'Ref Rate Detail' : 'Item Price', + 'Receiver Detail' : 'SMS Receiver', + 'Quotation Detail' : 'Quotation Item', + 'QA Specification Detail' : 'Quality Inspection Reading', + 'Purchase Receipt Detail' : 'Purchase Receipt Item', + 'Purchase Other Charges' : 'Purchase Taxes and Charges Master', + 'PR Raw Material Detail' : 'Purchase Receipt Item Supplied', + 'PP SO Detail' : 'Production Plan Sales Order', + 'PP Detail' : 'Production Plan Item', + 'PO Raw Material Detail' : 'Purchase Order Item Supplied', + 'PO Detail' : 'Purchase Order Item', + 'Packing Slip Detail' : 'Packing Slip Item', + 'Other Charges' : 'Sales Taxes and Charges Master', + 'Order Lost Reason' : 'Quotation Lost Reason', + 'Manage Account' : 'Global Defaults', + 'Maintenance Visit Detail' : 'Maintenance Visit Purpose', + 'Ledger Balance Export' : 'Multi Ledger Report', + 'LC PR Detail' : 'Landed Cost Purchase Receipt', + 'Landed Cost Detail' : 'Landed Cost Item', + 'KRA Template' : 'Appraisal Template', + 'KRA Sheet' : 'Appraisal Template Goal', + 'Item Specification Detail' : 'Item Quality Inspection Parameter', + 'Item Maintenance Detail' : 'Maintenance Schedule Item', + 'IR Payment Detail' : 'Payment to Invoice Matching Tool Detail', + 'Internal Reconciliation' : 'Payment to Invoice Matching Tool', + 'Installed Item Details' : 'Installation Note Item', + 'Holiday List Detail' : 'Holiday', + 'Follow up' : 'Communication Log', + 'Flat BOM Detail' : 'BOM Explosion Item', + 'Expense Voucher Detail' : 'Expense Claim Detail', + 'Expense Voucher' : 'Expense Claim', + 'Expense Type' : 'Expense Claim Type', + 'Enquiry Detail' : 'Opportunity Item', + 'Enquiry' : 'Opportunity', + 'Earning Detail' : 'Salary Structure Earning', + 'DocLayerField' : 'Customize Form Field', + 'DocLayer' : 'Customize Form', + 'Delivery Note Detail' : 'Delivery Note Item', + 'Deduction Detail' : 'Salary Structure Deduction', + 'Comment Widget Record' : 'Comment', + 'BOM Material' : 'BOM Item', + 'Bill Of Materials' : 'BOM', + 'Appraisal Detail' : 'Appraisal Goal', + 'Advance Allocation Detail' : 'Purchase Invoice Advance', + 'Advance Adjustment Detail' : 'Sales Invoice Advance', + 'Ledger Detail' : 'Multi Ledger Report Detail', + 'TA Control' : 'Trend Analyzer Control', + 'Sales and Purchase Return Wizard' : 'Sales and Purchase Return Tool', + 'Educational Qualifications Detail' : 'Employee Education', + 'Delivery Note Packing Detail' : 'Delivery Note Packing Item', + 'Experience In Company Detail' : 'Employee Internal Work History', + 'Professional Training Details' : 'Employee Training', + 'Previous Experience Detail' : 'Employee External Work History', + } + + for d in rendt: + webnotes.conn.sql(""" + update + `tabSearch Criteria` + set + doc_type = replace(doc_type, %s, %s), + filters = replace(filters, %s, %s), + columns = replace(columns, %s, %s), + parent_doc_type = replace(parent_doc_type, %s, %s), + add_cond = replace(add_cond, %s, %s), + add_col = replace(add_col, %s, %s), + add_tab = replace(add_tab, %s, %s), + dis_filters = replace(dis_filters, %s, %s), + group_by = replace(group_by, %s, %s), + sort_by = replace(sort_by, %s, %s), + report_script = replace(report_script, %s, %s), + server_script = replace(server_script, %s, %s), + custom_query = replace(custom_query, %s, %s) + """, (d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d], + d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d])) + + diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py index d6d689f441e..01f4a0efddd 100644 --- a/erpnext/patches/patch_list.py +++ b/erpnext/patches/patch_list.py @@ -327,5 +327,10 @@ patch_list = [ 'patch_file': 'cleanup_notification_control', 'description': 'cleanup notification control' }, + { + 'patch_module': 'patches.may_2012', + 'patch_file': 'renamedt_in_custom_search_criteria', + 'description': 'raname dt in custom search criteria' + }, ] diff --git a/erpnext/setup/doctype/setup_control/setup_control.py b/erpnext/setup/doctype/setup_control/setup_control.py index d5832c4e033..bcdd0938da9 100644 --- a/erpnext/setup/doctype/setup_control/setup_control.py +++ b/erpnext/setup/doctype/setup_control/setup_control.py @@ -81,7 +81,12 @@ class DocType: # Set self.set_defaults(def_args) - self.set_cp_defaults(**args) + + cp_args = {} + for k in ['industry', 'country', 'timezone', 'company_name']: + cp_args[k] = args[k] + + self.set_cp_defaults(**cp_args) self.create_feed_and_todo() diff --git a/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt b/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt index 41570395fdf..06f765dc7e0 100644 --- a/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt +++ b/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-03-27 14:36:33', + 'creation': '2012-05-03 11:00:55', 'docstatus': 0, - 'modified': '2012-03-27 14:36:33', + 'modified': '2012-05-04 13:02:26', 'modified_by': u'Administrator', 'owner': u'wasim@webnotestech.com' }, @@ -21,7 +21,7 @@ 'section_style': u'Simple', 'server_code_error': u' ', 'show_in_menu': 0, - 'version': 2 + 'version': 1 }, # These values are common for all DocField diff --git a/erpnext/stock/doctype/landed_cost_master/landed_cost_master.js b/erpnext/stock/doctype/landed_cost_master/landed_cost_master.js index 3cad9447a9b..03e8a39fd0b 100644 --- a/erpnext/stock/doctype/landed_cost_master/landed_cost_master.js +++ b/erpnext/stock/doctype/landed_cost_master/landed_cost_master.js @@ -23,4 +23,8 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) { cur_frm.cscript.refresh = function(doc, cdt, cdn) { +} + +cur_frm.fields_dict.landed_cost.grid.get_field('account_head').get_query = function(doc, cdt, cdn) { + return 'SELECT tabAccount.name FROM tabAccount WHERE tabAccount.group_or_ledger="Ledger" AND tabAccount.docstatus != 2 AND (tabAccount.account_type = "Tax" OR tabAccount.account_type = "Chargeable" or (tabAccount.is_pl_account = "Yes" and tabAccount.debit_or_credit = "Debit")) AND tabAccount.name LIKE "%s"'; } \ No newline at end of file diff --git a/erpnext/stock/doctype/landed_cost_master_detail/landed_cost_master_detail.txt b/erpnext/stock/doctype/landed_cost_master_detail/landed_cost_master_detail.txt index 1becceaf654..74e47e19238 100644 --- a/erpnext/stock/doctype/landed_cost_master_detail/landed_cost_master_detail.txt +++ b/erpnext/stock/doctype/landed_cost_master_detail/landed_cost_master_detail.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-03-27 14:36:34', + 'creation': '2012-05-03 11:00:55', 'docstatus': 0, - 'modified': '2012-03-27 14:36:34', + 'modified': '2012-05-04 13:02:35', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -19,13 +19,12 @@ 'name': '__common__', 'section_style': u'Simple', 'server_code_error': u' ', - 'version': 2 + 'version': 1 }, # These values are common for all DocField { 'doctype': u'DocField', - 'fieldtype': u'Data', 'name': '__common__', 'oldfieldtype': u'Data', 'parent': u'Landed Cost Master Detail', @@ -44,14 +43,17 @@ { 'doctype': u'DocField', 'fieldname': u'account_head', + 'fieldtype': u'Link', 'label': u'Account Head', - 'oldfieldname': u'account_head' + 'oldfieldname': u'account_head', + 'options': u'Account' }, # DocField { 'doctype': u'DocField', 'fieldname': u'description', + 'fieldtype': u'Data', 'label': u'Description', 'oldfieldname': u'description', 'width': u'300px' diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py index 86cb099f927..ee815186237 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -47,36 +47,35 @@ class DocType: return content - def convert_into_list(self, data): + def convert_into_list(self, data, submit = 1): """Convert csv data into list""" - count = 1 + count = 2 for s in data: - if s[0].strip() != 'Item Code': # remove the labels - # validate - if len(s) != 4: - msgprint("Data entered at Row No " + cstr(count) + " in Attachment File is not in correct format.", raise_exception=1) - self.validated = 0 - self.validate_item(s[0], count) - self.validate_warehouse(s[1], count) + if count == 2: continue + # validate + if (submit and len(s) != 4) or (not submit and len(s) != 6): + msgprint("Data entered at Row No " + cstr(count) + " in Attachment File is not in correct format.", raise_exception=1) + self.validated = 0 + self.validate_item(s[0], count) + self.validate_warehouse(s[1], count) - self.data.append(s) - count += 1 + self.data.append(s) + count += 1 if not self.validated: raise Exception - def get_reconciliation_data(self,submit = 0): + def get_reconciliation_data(self,submit = 1): """Read and validate csv data""" import csv data = csv.reader(self.get_csv_file_data().splitlines()) - self.convert_into_list(data) + self.convert_into_list(data, submit) def validate_item(self, item, count): """ Validate item exists and non-serialized""" - det = sql("select item_code, has_serial_no from `tabItem` \ - where name = %s", cstr(item), as_dict = 1) + det = sql("select item_code, has_serial_no from `tabItem` where name = %s", cstr(item), as_dict = 1) if not det: msgprint("Item: " + cstr(item) + " mentioned at Row No. " + cstr(count) + "does not exist in the system") self.validated = 0 @@ -176,7 +175,7 @@ class DocType: """Add diffs column in attached file""" # add header - out = "'Item Code', 'Warehouse', 'Qty', 'Valuation Rate', 'Qty Diff', 'Val Rate Diff'" + out = "Item Code, Warehouse, Qty, Valuation Rate, Qty Diff, Val Rate Diff" # add data for d in self.data: @@ -199,5 +198,5 @@ class DocType: def on_cancel(self): - self.validate() + self.get_reconciliation_data(submit = 0) self.do_stock_reco(is_submit = -1) diff --git a/erpnext/utilities/doctype/contact/contact.js b/erpnext/utilities/doctype/contact/contact.js index 9244b79fc30..ae06ed42030 100644 --- a/erpnext/utilities/doctype/contact/contact.js +++ b/erpnext/utilities/doctype/contact/contact.js @@ -15,7 +15,7 @@ // along with this program. If not, see . //--------- ONLOAD ------------- -cur_frm.cscript.onload = function(doc, cdt, cdn) { +cur_frm.cscript.onload = function(doc, cdt, cdn) { if(doc.customer) cur_frm.add_fetch('customer', 'customer_name', 'customer_name'); if(doc.supplier) cur_frm.add_fetch('supplier', 'supplier_name', 'supplier_name'); diff --git a/js/all-app.js b/js/all-app.js index 09a302013db..65ca12478c6 100644 --- a/js/all-app.js +++ b/js/all-app.js @@ -1314,7 +1314,7 @@ LocalDB.delete_doc=function(dt,dn){var doc=get_local(dt,dn);for(var ndt in local delete locals[dt][dn];} function get_local(dt,dn){return locals[dt]?locals[dt][dn]:null;} LocalDB.sync=function(list){if(list._kl)list=expand_doclist(list);for(var i=0;i' +(cur_frm.message_after_save?cur_frm.message_after_save:'Your information has been sent. Thank you!') +'';return;} -if(!me.meta.istable){me.refresh();} +if(!me.meta.istable){me.refresh(r.docname);} if(call_back){call_back(r);}} var me=this;var ret_fn_err=function(r){var doc=locals[me.doctype][me.docname];me.savingflag=false;ret_fn(r);} this.savingflag=true;if(this.docname&&validated){scroll(0,0);return this.savedoc(save_action,ret_fn,ret_fn_err);}} @@ -2009,7 +2008,7 @@ _p.def_print_style_other="\n.simpletable, .noborder { border-collapse: collapse; _p.go=function(html){var d=document.createElement('div') d.innerHTML=html $(d).printElement();} -_p.preview=function(html){var w=window.open('');w.document.write(html) +_p.preview=function(html){var w=window.open('');if(!w)return;w.document.write(html) w.document.close();} $.extend(_p,{show_dialog:function(){if(!_p.dialog){_p.make_dialog();} _p.dialog.show();},make_dialog:function(){var d=new Dialog(360,140,'Print Formats',[['HTML','Select'],['Check','No Letterhead'],['HTML','Buttons']]);$btn(d.widgets.Buttons,'Print',function(){_p.build(sel_val(cur_frm.print_sel),_p.go,d.widgets['No Letterhead'].checked);},{cssFloat:'right',marginBottom:'16px',marginLeft:'7px'},'green');$btn(d.widgets.Buttons,'Preview',function(){_p.build(sel_val(cur_frm.print_sel),_p.preview,d.widgets['No Letterhead'].checked);},{cssFloat:'right',marginBottom:'16px'},'');d.onshow=function(){var c=_p.dialog.widgets['Select'];if(c.cur_sel&&c.cur_sel.parentNode==c){c.removeChild(c.cur_sel);} diff --git a/js/all-web.js b/js/all-web.js index 24ee8f4aaf9..00d396acfe9 100644 --- a/js/all-web.js +++ b/js/all-web.js @@ -758,7 +758,7 @@ LocalDB.delete_doc=function(dt,dn){var doc=get_local(dt,dn);for(var ndt in local delete locals[dt][dn];} function get_local(dt,dn){return locals[dt]?locals[dt][dn]:null;} LocalDB.sync=function(list){if(list._kl)list=expand_doclist(list);for(var i=0;i