From 63371271d24115e14ca03022eb4a3f4e5de54767 Mon Sep 17 00:00:00 2001 From: Ravi Dey Date: Wed, 13 Jul 2011 15:07:42 +0530 Subject: [PATCH 1/6] System Manager can close ticket --- support/doctype/support_ticket/support_ticket.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/support/doctype/support_ticket/support_ticket.js b/support/doctype/support_ticket/support_ticket.js index 584f41278a..2c1e77faed 100644 --- a/support/doctype/support_ticket/support_ticket.js +++ b/support/doctype/support_ticket/support_ticket.js @@ -33,12 +33,14 @@ $.extend(cur_frm.cscript, { refresh: function(doc) { cs.make_listing(doc); - if(!doc.__islocal) { - - if(doc.allocated_to) + if(!doc.__islocal) { + if(in_list(user_roles,'System Manager')) { + if(doc.status!='Closed') cur_frm.add_custom_button('Close Ticket', cs['Close Ticket']); + if(doc.status=='Closed') cur_frm.add_custom_button('Re-Open Ticket', cs['Re-Open Ticket']); + }else if(doc.allocated_to) { set_field_permlevel('status',2); if(user==doc.allocated_to && doc.status!='Closed') cur_frm.add_custom_button('Close Ticket', cs['Close Ticket']); - if(doc.status=='Closed') cur_frm.add_custom_button('Re-Open Ticket', cs['Re-Open Ticket']); + } // can't change the main message & subject once set set_field_permlevel('subject',2); From 54b0e7d8f7c46438f785217fc4a1446846bf6fd6 Mon Sep 17 00:00:00 2001 From: nabinhait Date: Wed, 13 Jul 2011 16:40:03 +0530 Subject: [PATCH 2/6] test_field will be deleted from customer --- patches/patch.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index 9783de5a3e..6b3f0af436 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 323 +last_patch = 324 #------------------------------------------- @@ -1289,3 +1289,5 @@ def execute(patch_no): reload_doc('stock', 'doctype', 'stock_entry') sql("update `tabDocField` set options = 'get_stock_and_rate' where parent = 'Stock Entry' and label = 'Get Stock and Rate'") sql("delete from `tabDocField` where label = 'Get Current Stock' and parent = 'Stock Entry'") + elif patch_no == 324: + sql("delete from `tabDocField` where fieldname = 'test_field' and parent = 'Customer'") From 09c134408deb96a7dfae6c2d7b1abfa51837157e Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 13 Jul 2011 17:14:38 +0530 Subject: [PATCH 3/6] my_company.py: check validation before adding user --- home/page/my_company/my_company.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/home/page/my_company/my_company.py b/home/page/my_company/my_company.py index 58a82ad38a..560ea6ea03 100644 --- a/home/page/my_company/my_company.py +++ b/home/page/my_company/my_company.py @@ -52,12 +52,13 @@ def delete_user(args): # def add_user(args): args = json.loads(args) - add_profile(args['user']) # erpnext-saas if cint(webnotes.conn.get_value('Control Panel', None, 'sync_with_gateway')): from server_tools.gateway_utils import add_user_gateway add_user_gateway(args['user']) + add_profile(args['user']) + # # add profile record # From 9dd0c0b7a15f7b5be19cd2b2ef393779a7ad3c17 Mon Sep 17 00:00:00 2001 From: Ravi Dey Date: Wed, 13 Jul 2011 18:08:38 +0530 Subject: [PATCH 4/6] Salary Slip docfield update --- hr/doctype/salary_slip/salary_slip.txt | 146 +++++++------------------ patches/patch.py | 5 +- 2 files changed, 41 insertions(+), 110 deletions(-) diff --git a/hr/doctype/salary_slip/salary_slip.txt b/hr/doctype/salary_slip/salary_slip.txt index c9ba1dea3a..d2ce4e3fb3 100644 --- a/hr/doctype/salary_slip/salary_slip.txt +++ b/hr/doctype/salary_slip/salary_slip.txt @@ -5,14 +5,14 @@ { 'creation': '2010-08-08 17:09:20', 'docstatus': 0, - 'modified': '2011-06-27 14:39:16', + 'modified': '2011-07-13 17:38:55', 'modified_by': 'Administrator', 'owner': 'Administrator' }, # These values are common for all DocType { - '_last_update': '1308808105', + '_last_update': '1310019491', 'colour': 'White:FFF', 'doctype': 'DocType', 'module': 'HR', @@ -21,7 +21,7 @@ 'server_code_error': ' ', 'show_in_menu': 0, 'subject': 'For %(employee_name)s, %(designation)s', - 'version': 388 + 'version': 392 }, # These values are common for all DocField @@ -51,58 +51,24 @@ # DocPerm { - 'amend': 0, - 'cancel': 0, - 'create': 0, - 'doctype': 'DocPerm', - 'match': 'owner', - 'permlevel': 0, - 'submit': 0, - 'write': 0 - }, - - # DocPerm - { - 'amend': 0, - 'cancel': 0, - 'create': 0, - 'doctype': 'DocPerm', - 'match': 'owner', - 'permlevel': 0, - 'submit': 0, - 'write': 0 - }, - - # DocPerm - { - 'amend': 0, - 'cancel': 0, - 'create': 0, - 'doctype': 'DocPerm', - 'match': 'owner', - 'permlevel': 0, - 'submit': 0, - 'write': 0 - }, - - # DocPerm - { - 'amend': 0, - 'cancel': 0, - 'create': 0, - 'doctype': 'DocPerm', - 'match': 'owner', - 'permlevel': 0, - 'submit': 0, - 'write': 0 - }, - - # DocPerm - { - 'amend': 0, + 'amend': 1, + 'cancel': 1, 'create': 1, 'doctype': 'DocPerm', - 'idx': 3, + 'idx': 1, + 'permlevel': 0, + 'role': 'System Manager', + 'submit': 1, + 'write': 1 + }, + + # DocPerm + { + 'amend': 0, + 'cancel': 0, + 'create': 1, + 'doctype': 'DocPerm', + 'idx': 2, 'permlevel': 0, 'role': 'HR User', 'submit': 1, @@ -111,11 +77,11 @@ # DocPerm { - 'amend': 1, - 'cancel': 1, + 'amend': 0, + 'cancel': 0, 'create': 1, 'doctype': 'DocPerm', - 'idx': 4, + 'idx': 3, 'permlevel': 0, 'role': 'HR Manager', 'submit': 1, @@ -124,18 +90,28 @@ # DocPerm { + 'amend': 0, + 'cancel': 0, + 'create': 0, 'doctype': 'DocPerm', - 'idx': 5, + 'idx': 4, 'permlevel': 1, - 'role': 'HR User' + 'role': 'HR User', + 'submit': 0, + 'write': 0 }, # DocPerm { + 'amend': 0, + 'cancel': 0, + 'create': 0, 'doctype': 'DocPerm', - 'idx': 6, + 'idx': 5, 'permlevel': 1, - 'role': 'HR Manager' + 'role': 'HR Manager', + 'submit': 0, + 'write': 0 }, # DocField @@ -285,28 +261,6 @@ 'permlevel': 0 }, - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'letter_head', - 'fieldtype': 'Link', - 'idx': 11, - 'label': 'Letter Head', - 'options': 'Letter Head', - 'permlevel': 0 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'letter_head', - 'fieldtype': 'Link', - 'idx': 11, - 'label': 'Letter Head', - 'options': 'Letter Head', - 'permlevel': 0 - }, - # DocField { 'doctype': 'DocField', @@ -347,32 +301,6 @@ 'reqd': 1 }, - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'company', - 'fieldtype': 'Select', - 'idx': 14, - 'in_filter': 1, - 'label': 'Company', - 'options': 'link:Company', - 'permlevel': 0, - 'reqd': 1 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'company', - 'fieldtype': 'Select', - 'idx': 14, - 'in_filter': 1, - 'label': 'Company', - 'options': 'link:Company', - 'permlevel': 0, - 'reqd': 1 - }, - # DocField { 'colour': 'White:FFF', @@ -396,7 +324,7 @@ { 'doctype': 'DocField', 'fieldname': 'total_days_in_month', - 'fieldtype': 'Int', + 'fieldtype': 'Data', 'idx': 16, 'label': 'Total days in month', 'oldfieldname': 'total_days_in_month', diff --git a/patches/patch.py b/patches/patch.py index 6b3f0af436..f1841971c8 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 324 +last_patch = 325 #------------------------------------------- @@ -1291,3 +1291,6 @@ def execute(patch_no): sql("delete from `tabDocField` where label = 'Get Current Stock' and parent = 'Stock Entry'") elif patch_no == 324: sql("delete from `tabDocField` where fieldname = 'test_field' and parent = 'Customer'") + elif patch_no == 325: + sql("update `tabDocField` set fieldtype = 'Data' where parent = 'Salary Slip' and fieldname = 'total_days_in_month'") + reload_doc('hr', 'doctype', 'salary_slip') From 62e77f536bacf69662513aed6ed480d8bae80d57 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 14 Jul 2011 12:41:39 +0530 Subject: [PATCH 5/6] added more features to loan --- accounts/doctype/loan/loan.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/accounts/doctype/loan/loan.js b/accounts/doctype/loan/loan.js index 37e49dc857..d4e063d7be 100644 --- a/accounts/doctype/loan/loan.js +++ b/accounts/doctype/loan/loan.js @@ -8,11 +8,39 @@ $.extend(cur_frm.cscript, { } cur_frm.refresh(); }, + refresh: function(doc) { + cur_frm.cscript.hide_show_buttons(doc); + }, + hide_show_buttons: function(doc) { + if(doc.docstatus==0) { + hide_field('Installment Reciept'); show_field('Generate'); + } else if (doc.docstatus==1) { + show_field('Installment Reciept'); hide_field('Generate'); + } + }, clear_installments: function(doc) { $.each(getchildren('Loan Installment', doc.name, 'installments', 'Loan'), function(i, d) { LocalDB.delete_doc('Loan Installment', d.name); } ) + }, + 'Installment Reciept': function(doc, dt, dn) { + var d = new wn.widgets.Dialog({ + width: 500, + title: 'Add a new payment installment', + fields: [ + {fieldtype:'Data', label:'Check Number', fieldname:'check_number', reqd:1}, + {fieldtype:'Date', label:'Check Date', fieldname:'check_date', reqd:1}, + {fieldtype:'Button', label:'Update',fieldname:'update'} + ] + }) + d.show(); + d.fields_dict.update.input.onclick = function() { + var data = d.get_values(); + if(data) { + $c_obj() + } + } } }) \ No newline at end of file From fd84f5ce903ae272fce84d8fc10459539fe7dcb1 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 14 Jul 2011 12:42:27 +0530 Subject: [PATCH 6/6] added loan, loan_installment txts --- accounts/doctype/loan/loan.txt | 144 ++++++++++++++++++ .../loan_installment/loan_installment.txt | 94 ++++++++++++ 2 files changed, 238 insertions(+) create mode 100644 accounts/doctype/loan/loan.txt create mode 100644 accounts/doctype/loan_installment/loan_installment.txt diff --git a/accounts/doctype/loan/loan.txt b/accounts/doctype/loan/loan.txt new file mode 100644 index 0000000000..90c0db2077 --- /dev/null +++ b/accounts/doctype/loan/loan.txt @@ -0,0 +1,144 @@ +# DocType, Loan +[ + + # These values are common in all dictionaries + { + 'creation': '2011-07-12 10:50:19', + 'docstatus': 0, + 'modified': '2011-07-14 11:22:32', + 'modified_by': 'Administrator', + 'owner': 'Administrator' + }, + + # These values are common for all DocType + { + '_last_update': '1310622631', + 'colour': 'White:FFF', + 'doctype': 'DocType', + 'module': 'Accounts', + 'name': '__common__', + 'section_style': 'Simple', + 'show_in_menu': 0, + 'version': 11 + }, + + # These values are common for all DocField + { + 'doctype': 'DocField', + 'name': '__common__', + 'parent': 'Loan', + 'parentfield': 'fields', + 'parenttype': 'DocType', + 'permlevel': 0 + }, + + # These values are common for all DocPerm + { + 'cancel': 1, + 'create': 1, + 'doctype': 'DocPerm', + 'idx': 1, + 'name': '__common__', + 'parent': 'Loan', + 'parentfield': 'permissions', + 'parenttype': 'DocType', + 'permlevel': 0, + 'read': 1, + 'role': 'Accounts User', + 'submit': 1, + 'write': 1 + }, + + # DocType, Loan + { + 'doctype': 'DocType', + 'name': 'Loan' + }, + + # DocPerm + { + 'doctype': 'DocPerm' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'naming_series', + 'fieldtype': 'Select', + 'idx': 1, + 'label': 'Naming Series', + 'options': '\nLOAN', + 'reqd': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'account', + 'fieldtype': 'Link', + 'idx': 2, + 'label': 'Account', + 'options': 'Account', + 'reqd': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'loan_amount', + 'fieldtype': 'Currency', + 'idx': 3, + 'label': 'Loan Amount', + 'reqd': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'start_date', + 'fieldtype': 'Date', + 'idx': 4, + 'label': 'Start Date', + 'reqd': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'no_of_installments', + 'fieldtype': 'Int', + 'idx': 5, + 'label': 'No of Installments', + 'reqd': 1 + }, + + # DocField + { + 'colour': 'White:FFF', + 'doctype': 'DocField', + 'fieldtype': 'Button', + 'idx': 6, + 'label': 'Generate', + 'trigger': 'Client' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'installments', + 'fieldtype': 'Table', + 'idx': 7, + 'label': 'Installments', + 'options': 'Loan Installment' + }, + + # DocField + { + 'allow_on_submit': 1, + 'colour': 'White:FFF', + 'doctype': 'DocField', + 'fieldtype': 'Button', + 'idx': 8, + 'label': 'Installment Reciept' + } +] \ No newline at end of file diff --git a/accounts/doctype/loan_installment/loan_installment.txt b/accounts/doctype/loan_installment/loan_installment.txt new file mode 100644 index 0000000000..dd65939869 --- /dev/null +++ b/accounts/doctype/loan_installment/loan_installment.txt @@ -0,0 +1,94 @@ +# DocType, Loan Installment +[ + + # These values are common in all dictionaries + { + 'creation': '2011-07-12 10:53:58', + 'docstatus': 0, + 'modified': '2011-07-12 10:53:58', + 'modified_by': 'Administrator', + 'owner': 'Administrator' + }, + + # These values are common for all DocType + { + 'colour': 'White:FFF', + 'doctype': 'DocType', + 'istable': 1, + 'module': 'Accounts', + 'name': '__common__', + 'section_style': 'Simple', + 'show_in_menu': 0, + 'version': 1 + }, + + # These values are common for all DocField + { + 'doctype': 'DocField', + 'name': '__common__', + 'parent': 'Loan Installment', + 'parentfield': 'fields', + 'parenttype': 'DocType', + 'permlevel': 0 + }, + + # DocType, Loan Installment + { + 'doctype': 'DocType', + 'name': 'Loan Installment' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'amount', + 'fieldtype': 'Currency', + 'idx': 1, + 'label': 'Amount' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'due_date', + 'fieldtype': 'Date', + 'idx': 2, + 'label': 'Due Date' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'check_number', + 'fieldtype': 'Int', + 'idx': 3, + 'label': 'Check Number' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'check_date', + 'fieldtype': 'Date', + 'idx': 4, + 'label': 'Check Date' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'deposit_date', + 'fieldtype': 'Date', + 'idx': 5, + 'label': 'Deposit Date' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'realized_date', + 'fieldtype': 'Date', + 'idx': 6, + 'label': 'Realized Date' + } +] \ No newline at end of file