From 81aa8a075676f5b2d74f6be33e73b42e1722f38b Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 13 Jul 2011 13:53:06 +0530 Subject: [PATCH 01/24] added loan and loan installment --- accounts/doctype/loan/__init__.py | 0 accounts/doctype/loan/loan.js | 18 ++++++++++++++++++ accounts/doctype/loan/loan.py | 13 +++++++++++++ accounts/doctype/loan/test_loan.py | 17 +++++++++++++++++ accounts/doctype/loan_installment/__init__.py | 0 5 files changed, 48 insertions(+) create mode 100644 accounts/doctype/loan/__init__.py create mode 100644 accounts/doctype/loan/loan.js create mode 100644 accounts/doctype/loan/loan.py create mode 100644 accounts/doctype/loan/test_loan.py create mode 100644 accounts/doctype/loan_installment/__init__.py diff --git a/accounts/doctype/loan/__init__.py b/accounts/doctype/loan/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/accounts/doctype/loan/loan.js b/accounts/doctype/loan/loan.js new file mode 100644 index 0000000000..37e49dc857 --- /dev/null +++ b/accounts/doctype/loan/loan.js @@ -0,0 +1,18 @@ +$.extend(cur_frm.cscript, { + Generate: function(doc, dt, dn) { + cur_frm.cscript.clear_installments(doc); + for(var i=0; i< doc.no_of_installments; i++) { + d = LocalDB.add_child(doc, 'Loan Installment', 'installments'); + d.amount = doc.loan_amount / doc.no_of_installments; + d.due_date = dateutil.add_months(doc.start_date, i+1); + } + cur_frm.refresh(); + }, + clear_installments: function(doc) { + $.each(getchildren('Loan Installment', doc.name, 'installments', 'Loan'), + function(i, d) { + LocalDB.delete_doc('Loan Installment', d.name); + } + ) + } +}) \ No newline at end of file diff --git a/accounts/doctype/loan/loan.py b/accounts/doctype/loan/loan.py new file mode 100644 index 0000000000..4a6427dffa --- /dev/null +++ b/accounts/doctype/loan/loan.py @@ -0,0 +1,13 @@ +import webnotes +from webnotes.model.doc import make_autoname, Document + +class DocType: + def __init__(self, doc, doclist): + self.doc, self.doclist = doc, doclist + + def autoname(self): + """ + Create Loan Id using naming_series pattern + """ + self.doc.name = make_autoname(self.doc.naming_series+ '.#####') + diff --git a/accounts/doctype/loan/test_loan.py b/accounts/doctype/loan/test_loan.py new file mode 100644 index 0000000000..4e72559d6e --- /dev/null +++ b/accounts/doctype/loan/test_loan.py @@ -0,0 +1,17 @@ +import unittest +import webnotes +from webnotes.model.code import get_obj + +class TestScheduleGeneartion(unittest.TestCase): + def setUp(self): + webnotes.conn.begin() + # create a mock loan + self.loan = get_obj('Loan', 'LOAN00001') + + def test_generation(self): + "test the genaration of loan installments" + self.loan.generate() + self.assertEqual(self.loan.get_installment_total(), self.loan.doc.loan_amount) + + def tearDown(self): + webnotes.conn.rollback() diff --git a/accounts/doctype/loan_installment/__init__.py b/accounts/doctype/loan_installment/__init__.py new file mode 100644 index 0000000000..e69de29bb2 From 62e77f536bacf69662513aed6ed480d8bae80d57 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 14 Jul 2011 12:41:39 +0530 Subject: [PATCH 02/24] 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 03/24] 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 From d0692860580c16c4845ad725268a9e468aab53dd Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 14 Jul 2011 13:15:37 +0530 Subject: [PATCH 04/24] fix to my company --- home/page/my_company/my_company.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/home/page/my_company/my_company.js b/home/page/my_company/my_company.js index 0384788b29..8b1b44ff9a 100644 --- a/home/page/my_company/my_company.js +++ b/home/page/my_company/my_company.js @@ -2,6 +2,7 @@ pscript['onload_My Company'] = function() { var wrapper = page_body.pages['My Company']; // body + wrapper.className = 'layout_wrapper'; wrapper.head = new PageHeader(wrapper, 'People'); wrapper.body = $a(wrapper, 'div', '', {marginRight:'11px', marginTop:'11px'}); @@ -91,7 +92,10 @@ MemberList = function(parent) { this.cur_profile = null; this.list_wrapper = $a($td(parent.tab,0,0), 'div', '', {marginLeft:'11px'}); - this.profile_wrapper = $a($td(parent.tab,0,1), 'div', 'layout_wrapper', {marginLeft:'0px', height:'100%'}); + var cell = $td(parent.tab,0,1); + $y(cell, { border: '1px solid #aaa' }); + cell.className = 'layout_wrapper'; + this.profile_wrapper = $a(cell, 'div'); this.no_user_selected = $a(this.profile_wrapper, 'div', 'help_box', null, 'Please select a user to view profile'); @@ -213,7 +217,7 @@ MemberItem = function(parent, det, mlist) { this.fullname = det[1] ? det[1] : det[0]; var div = $a($td(this.tab, 0, 1), 'div', '', {fontWeight: 'bold',padding:'2px 0px'}); this.name_link = $a(div,'span','link_type'); - this.name_link.innerHTML = this.fullname; + this.name_link.innerHTML = crop(this.fullname, 15); this.name_link.onclick = function() { mlist.show_profile(me.det[0], me); } From 37fec6e219fd2994be8f37c0f38922832b02bd8a Mon Sep 17 00:00:00 2001 From: Brahma K Date: Fri, 15 Jul 2011 11:20:04 +0530 Subject: [PATCH 05/24] Added Loan in Module Def --- accounts/Module Def/Accounts/Accounts.txt | 641 ++++-------------- accounts/doctype/loan/loan.txt | 4 +- .../loan_installment/loan_installment.txt | 4 +- hr/doctype/salary_slip/salary_slip.txt | 58 +- 4 files changed, 182 insertions(+), 525 deletions(-) diff --git a/accounts/Module Def/Accounts/Accounts.txt b/accounts/Module Def/Accounts/Accounts.txt index 3d70ff8701..708a2c942f 100644 --- a/accounts/Module Def/Accounts/Accounts.txt +++ b/accounts/Module Def/Accounts/Accounts.txt @@ -1,722 +1,377 @@ +# Module Def, Accounts [ + + # These values are common in all dictionaries { - '_last_update': None, - 'creation': '2010-09-25 10:50:37', - 'disabled': 'No', + 'creation': '2010-09-25 10:50:34', 'docstatus': 0, - 'doctype': u'Module Def', + 'modified': '2011-07-15 10:43:04', + 'modified_by': 'Administrator', + 'owner': 'Administrator' + }, + + # These values are common for all Module Def Role + { + 'doctype': 'Module Def Role', + 'name': '__common__', + 'parent': 'Accounts', + 'parentfield': 'roles', + 'parenttype': 'Module Def' + }, + + # These values are common for all Module Def Item + { + 'doctype': 'Module Def Item', + 'name': '__common__', + 'parent': 'Accounts', + 'parentfield': 'items', + 'parenttype': 'Module Def' + }, + + # These values are common for all Module Def + { + 'disabled': 'No', + 'doctype': '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', - 'idx': None, 'is_hidden': 'No', 'last_updated_date': '2010-12-08 10:13:30', - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', 'module_desc': 'Data about your payables, receivables and books of accounts', 'module_icon': 'Accounts.gif', 'module_label': 'Accounts', 'module_name': 'Accounts', - 'module_page': None, - 'module_seq': 6, - 'name': 'Accounts', - 'owner': 'Administrator', - 'parent': None, - 'parentfield': None, - 'parenttype': None, - 'trash_reason': None, - 'widget_code': "" + 'module_seq': 5, + 'name': '__common__' }, + + # Module Def, Accounts + { + 'doctype': 'Module Def', + 'name': 'Accounts' + }, + + # Module Def Item { 'click_function': "show_chart_browser('Accounts Browser','Account')", - 'creation': '2010-10-04 17:16:24', 'description': 'Manage your accounts', 'display_name': 'Chart of Accounts', 'doc_name': 'Accounts Browser', 'doc_type': 'Pages', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 1, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01178', - 'owner': 'harshada@webnotestech.com', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 1 }, + + # Module Def Item { 'click_function': "show_chart_browser('Accounts Browser','Cost Center')", - 'creation': '2010-10-05 12:51:20', 'description': 'Manage your cost centers', 'display_name': 'Chart of Cost Centers', 'doc_name': 'Accounts Browser', 'doc_type': 'Pages', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 2, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01183', - 'owner': 'harshada@webnotestech.com', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 2 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2010-09-25 10:50:37', 'description': 'Regular journal entry', 'display_name': 'Journal Voucher', 'doc_name': 'Journal Voucher', 'doc_type': 'Forms', - 'docstatus': 0, 'doctype': 'Module Def Item', 'fields': 'voucher_type\nvoucher_date\nfiscal_year\ntotal_debit\ntotal_credit', - 'hide': None, - 'icon': None, - 'idx': 3, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01012', - 'owner': 'Administrator', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 3 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2010-09-25 10:50:37', 'description': 'Outgoing Invoice to your customers', 'display_name': 'Sales Invoice', 'doc_name': 'Receivable Voucher', 'doc_type': 'Forms', - 'docstatus': 0, 'doctype': 'Module Def Item', 'fields': 'voucher_date\ndue_date\ndebit_to\ngrand_total\noutstanding_amount', - 'hide': None, - 'icon': None, - 'idx': 4, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01013', - 'owner': 'Administrator', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 4 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2010-09-25 10:50:37', 'description': 'Incoming invoice from your service providers', 'display_name': 'Purchase Invoice', 'doc_name': 'Payable Voucher', 'doc_type': 'Forms', - 'docstatus': 0, 'doctype': 'Module Def Item', 'fields': 'voucher_date\ncredit_to\nbill_no\ngrand_total\noutstanding_amount', - 'hide': None, - 'icon': None, - 'idx': 5, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01014', - 'owner': 'Administrator', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 5 }, + + # Module Def Item + { + 'display_name': 'Loan', + 'doc_name': 'Loan', + 'doc_type': 'Forms', + 'doctype': 'Module Def Item', + 'idx': 6 + }, + + # Module Def Item { - 'click_function': None, - 'creation': '2010-09-25 10:50:37', 'description': 'Profit & Loss and Balance Sheet builder', 'display_name': 'Financial Statements', 'doc_name': 'Financial Statements', 'doc_type': 'Pages', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, 'icon': 'table.gif', - 'idx': 6, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01015', - 'owner': 'Administrator', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 7 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2010-09-25 10:50:37', 'description': 'Update your actual clearance dates and find out if bank ledger tallies with your bank statement.', 'display_name': 'Bank Reconciliation', 'doc_name': 'Bank Reconciliation', 'doc_type': 'Single DocType', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 7, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01016', - 'owner': 'saumil@webnotestech.com', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 8 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2010-09-25 10:50:37', - 'description': None, 'display_name': 'TDS Payment', 'doc_name': 'TDS Payment', 'doc_type': 'Setup Forms', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 8, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01017', - 'owner': 'Administrator', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 9 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2010-09-25 10:50:37', - 'description': None, 'display_name': 'TDS Return Acknowledgement', 'doc_name': 'TDS Return Acknowledgement', 'doc_type': 'Setup Forms', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 9, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01018', - 'owner': 'nabin@webnotestech.com', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 10 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2010-09-25 10:50:37', - 'description': None, 'display_name': 'Form 16A', 'doc_name': 'Form 16A', 'doc_type': 'Setup Forms', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 10, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01019', - 'owner': 'Administrator', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 11 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2010-10-25 17:25:22', 'description': 'Account closing entry (Profit Booking) on any date', 'display_name': 'Period Closing Voucher', 'doc_name': 'Period Closing Voucher', 'doc_type': 'Setup Forms', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 11, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01188', - 'owner': 'Administrator', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 12 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2011-05-24 14:47:53', 'description': 'You can export balance of selected ledgers within a specific period', 'display_name': 'Ledger Balance Export', 'doc_name': 'Ledger Balance Export', 'doc_type': 'Single DocType', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 12, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01283', - 'owner': 'Administrator', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 13 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2010-09-25 10:50:37', - 'description': None, 'display_name': 'General Ledger', 'doc_name': 'GL Entry', 'doc_type': 'Reports', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 13, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01021', - 'owner': 'Administrator', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 14 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2010-09-25 10:50:37', - 'description': None, 'display_name': 'Accounts Receivable', 'doc_name': 'GL Entry', 'doc_type': 'Reports', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 14, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01022', - 'owner': 'Administrator', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 15 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2010-09-25 10:50:37', - 'description': None, 'display_name': 'Accounts Payable', 'doc_name': 'GL Entry', 'doc_type': 'Reports', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 15, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01023', - 'owner': 'Administrator', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 16 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2010-09-25 10:50:37', - 'description': None, 'display_name': 'Bank Reconciliation Statement', 'doc_name': 'Journal Voucher Detail', 'doc_type': 'Reports', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 16, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01024', - 'owner': 'Administrator', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 17 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2010-09-25 10:50:37', - 'description': None, 'display_name': 'Trial Balance', 'doc_name': 'Account', 'doc_type': 'Reports', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 17, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01025', - 'owner': 'Administrator', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 18 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2010-09-25 10:50:37', - 'description': None, 'display_name': 'Sales Register', 'doc_name': 'Receivable Voucher', 'doc_type': 'Reports', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 18, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01026', - 'owner': 'Administrator', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 19 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2010-09-25 10:50:37', - 'description': None, 'display_name': 'Purchase Register', 'doc_name': 'Payable Voucher', 'doc_type': 'Reports', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 19, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01027', - 'owner': 'Administrator', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 20 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2010-09-25 10:50:37', - 'description': None, 'display_name': 'Bank Clearance report', 'doc_name': 'Journal Voucher Detail', 'doc_type': 'Reports', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 20, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01028', - 'owner': 'Administrator', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 21 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2010-09-25 10:50:37', - 'description': None, 'display_name': 'Monthly Ledger Summary Report', 'doc_name': 'GL Entry', 'doc_type': 'Reports', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 21, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01031', - 'owner': 'Administrator', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 22 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2010-09-25 10:50:37', - 'description': None, 'display_name': 'Collection Report', 'doc_name': 'Journal Voucher Detail', 'doc_type': 'Reports', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 22, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01032', - 'owner': 'Administrator', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 23 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2010-09-25 10:50:37', - 'description': None, 'display_name': 'Total amout collection for a period - Customerwise', 'doc_name': 'Account', 'doc_type': 'Reports', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 23, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01033', - 'owner': 'Administrator', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 24 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2010-09-25 10:50:37', - 'description': None, 'display_name': 'Payment Report', 'doc_name': 'Journal Voucher Detail', 'doc_type': 'Reports', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 24, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01034', - 'owner': 'Administrator', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 25 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2011-01-19 17:41:27', - 'description': None, 'display_name': 'Itemwise Sales Register', 'doc_name': 'RV Detail', 'doc_type': 'Reports', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 25, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01267', - 'owner': 'Administrator', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 26 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2010-09-25 10:50:37', - 'description': None, 'display_name': 'Itemwise Purchase Register', 'doc_name': 'PV Detail', 'doc_type': 'Reports', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 26, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01035', - 'owner': 'Administrator', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 27 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2010-09-25 10:50:37', - 'description': None, 'display_name': 'Cost Center wise Expense', 'doc_name': 'GL Entry', 'doc_type': 'Reports', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 27, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01036', - 'owner': 'Administrator', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 28 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2010-09-25 10:50:37', - 'description': None, 'display_name': 'TDS Return', 'doc_name': 'TDS Payment Detail', 'doc_type': 'Reports', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 28, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01038', - 'owner': 'Administrator', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 29 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2010-09-25 10:50:37', - 'description': None, 'display_name': 'Budget Variance Report', 'doc_name': 'Budget Detail', 'doc_type': 'Reports', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 29, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01039', - 'owner': 'jai@webnotestech.com', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 30 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2010-09-25 10:50:37', - 'description': None, 'display_name': 'Payment Receipt Report', 'doc_name': 'GL Entry', 'doc_type': 'Reports', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 30, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01040', - 'owner': 'jai@webnotestech.com', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 31 }, + + # Module Def Item { - 'click_function': None, - 'creation': '2010-09-25 10:50:37', 'description': 'Track total commission given to your Business Associate', 'display_name': 'Business Associate Commission Report', 'doc_name': 'Receivable Voucher', 'doc_type': 'Reports', - 'docstatus': 0, 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 31, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDI01041', - 'owner': 'saumil@webnotestech.com', - 'parent': 'Accounts', - 'parentfield': 'items', - 'parenttype': 'Module Def' + 'idx': 32 }, + + # Module Def Role { - 'creation': '2010-09-25 10:50:37', - 'docstatus': 0, 'doctype': 'Module Def Role', 'idx': 1, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDR00302', - 'owner': 'Administrator', - 'parent': 'Accounts', - 'parentfield': 'roles', - 'parenttype': 'Module Def', 'role': 'Accounts Manager' }, + + # Module Def Role { - 'creation': '2010-09-25 10:50:37', - 'docstatus': 0, 'doctype': 'Module Def Role', 'idx': 2, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDR00303', - 'owner': 'Administrator', - 'parent': 'Accounts', - 'parentfield': 'roles', - 'parenttype': 'Module Def', 'role': 'Accounts User' }, + + # Module Def Role { - 'creation': '2010-09-25 10:50:37', - 'docstatus': 0, 'doctype': 'Module Def Role', 'idx': 3, - 'modified': '2011-07-01 09:36:04', - 'modified_by': 'Administrator', - 'name': 'MDR00304', - 'owner': 'Administrator', - 'parent': 'Accounts', - 'parentfield': 'roles', - 'parenttype': 'Module Def', 'role': 'Administrator' } -] +] \ No newline at end of file diff --git a/accounts/doctype/loan/loan.txt b/accounts/doctype/loan/loan.txt index 90c0db2077..df936129fe 100644 --- a/accounts/doctype/loan/loan.txt +++ b/accounts/doctype/loan/loan.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2011-07-12 10:50:19', + 'creation': '2011-07-15 10:35:26', 'docstatus': 0, - 'modified': '2011-07-14 11:22:32', + 'modified': '2011-07-15 10:35:26', 'modified_by': 'Administrator', 'owner': 'Administrator' }, diff --git a/accounts/doctype/loan_installment/loan_installment.txt b/accounts/doctype/loan_installment/loan_installment.txt index dd65939869..bdb8bb3570 100644 --- a/accounts/doctype/loan_installment/loan_installment.txt +++ b/accounts/doctype/loan_installment/loan_installment.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2011-07-12 10:53:58', + 'creation': '2011-07-15 10:36:42', 'docstatus': 0, - 'modified': '2011-07-12 10:53:58', + 'modified': '2011-07-15 10:36:42', 'modified_by': 'Administrator', 'owner': 'Administrator' }, diff --git a/hr/doctype/salary_slip/salary_slip.txt b/hr/doctype/salary_slip/salary_slip.txt index d2ce4e3fb3..2886e424b5 100644 --- a/hr/doctype/salary_slip/salary_slip.txt +++ b/hr/doctype/salary_slip/salary_slip.txt @@ -5,7 +5,7 @@ { 'creation': '2010-08-08 17:09:20', 'docstatus': 0, - 'modified': '2011-07-13 17:38:55', + 'modified': '2011-07-14 16:07:20', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -51,38 +51,50 @@ # DocPerm { - 'amend': 1, - 'cancel': 1, - 'create': 1, + 'amend': 0, + 'cancel': 0, + 'create': 0, 'doctype': 'DocPerm', - 'idx': 1, + 'match': 'owner', 'permlevel': 0, - 'role': 'System Manager', - 'submit': 1, - 'write': 1 + 'role': 'Employee', + 'submit': 0, + 'write': 0 }, # DocPerm { 'amend': 0, 'cancel': 0, - 'create': 1, + 'create': 0, 'doctype': 'DocPerm', - 'idx': 2, + 'match': 'owner', 'permlevel': 0, - 'role': 'HR User', - 'submit': 1, - 'write': 1 + 'role': 'Employee', + 'submit': 0, + 'write': 0 }, # DocPerm { 'amend': 0, - 'cancel': 0, 'create': 1, 'doctype': 'DocPerm', 'idx': 3, 'permlevel': 0, + 'role': 'HR User', + 'submit': 1, + 'write': 1 + }, + + # DocPerm + { + 'amend': 1, + 'cancel': 1, + 'create': 1, + 'doctype': 'DocPerm', + 'idx': 4, + 'permlevel': 0, 'role': 'HR Manager', 'submit': 1, 'write': 1 @@ -90,28 +102,18 @@ # DocPerm { - 'amend': 0, - 'cancel': 0, - 'create': 0, 'doctype': 'DocPerm', - 'idx': 4, + 'idx': 5, 'permlevel': 1, - 'role': 'HR User', - 'submit': 0, - 'write': 0 + 'role': 'HR User' }, # DocPerm { - 'amend': 0, - 'cancel': 0, - 'create': 0, 'doctype': 'DocPerm', - 'idx': 5, + 'idx': 6, 'permlevel': 1, - 'role': 'HR Manager', - 'submit': 0, - 'write': 0 + 'role': 'HR Manager' }, # DocField From 5e1d504483c756ebc6fbed09df76590c5e2e5e83 Mon Sep 17 00:00:00 2001 From: Brahma K Date: Fri, 15 Jul 2011 19:35:24 +0530 Subject: [PATCH 06/24] Implemented the Auto JV posting upon Loan Installment posting --- .../journal_voucher/journal_voucher.txt | 37 +++------------- accounts/doctype/loan/loan.js | 15 ++++--- accounts/doctype/loan/loan.py | 40 ++++++++++++++++- accounts/doctype/loan/loan.txt | 29 ++++++++----- .../loan_installment/loan_installment.txt | 43 +++++++++++++------ 5 files changed, 103 insertions(+), 61 deletions(-) diff --git a/accounts/doctype/journal_voucher/journal_voucher.txt b/accounts/doctype/journal_voucher/journal_voucher.txt index 43ec61437a..c40be8f728 100644 --- a/accounts/doctype/journal_voucher/journal_voucher.txt +++ b/accounts/doctype/journal_voucher/journal_voucher.txt @@ -5,23 +5,14 @@ { 'creation': '2010-08-08 17:09:06', 'docstatus': 0, - 'modified': '2011-04-06 14:41:47', + 'modified': '2011-07-15 14:37:05', 'modified_by': 'Administrator', 'owner': 'Administrator' }, - # These values are common for all DocField - { - 'doctype': 'DocField', - 'name': '__common__', - 'parent': 'Journal Voucher', - 'parentfield': 'fields', - 'parenttype': 'DocType' - }, - # These values are common for all DocType { - '_last_update': '1305714002', + '_last_update': '1310533805', 'colour': 'White:FFF', 'doctype': 'DocType', 'module': 'Accounts', @@ -32,15 +23,15 @@ 'show_in_menu': 0, 'subject': ' ', 'tag_fields': 'voucher_type', - 'version': 307 + 'version': 308 }, - # These values are common for all DocFormat + # These values are common for all DocField { - 'doctype': 'DocFormat', + 'doctype': 'DocField', 'name': '__common__', 'parent': 'Journal Voucher', - 'parentfield': 'formats', + 'parentfield': 'fields', 'parenttype': 'DocType' }, @@ -112,20 +103,6 @@ 'write': 0 }, - # DocFormat - { - 'doctype': 'DocFormat', - 'format': 'Payment Receipt Voucher', - 'idx': 1 - }, - - # DocFormat - { - 'doctype': 'DocFormat', - 'format': 'Cheque Printing Format', - 'idx': 2 - }, - # DocField { 'doctype': 'DocField', @@ -167,7 +144,7 @@ 'label': 'Voucher Type', 'oldfieldname': 'voucher_type', 'oldfieldtype': 'Select', - 'options': '\nJournal Entry\nBank Voucher\nCash Voucher\nCredit Card Voucher\nDebit Note\nCredit Note\nContra Voucher\nExcise Voucher\nWrite Off Voucher', + 'options': '\nJournal Entry\nBank Voucher\nCash Voucher\nCredit Card Voucher\nDebit Note\nCredit Note\nContra Voucher\nExcise Voucher\nWrite Off Voucher\nLoan Receipt', 'permlevel': 0, 'print_hide': 0, 'search_index': 1 diff --git a/accounts/doctype/loan/loan.js b/accounts/doctype/loan/loan.js index d4e063d7be..a26df3f73f 100644 --- a/accounts/doctype/loan/loan.js +++ b/accounts/doctype/loan/loan.js @@ -13,9 +13,10 @@ $.extend(cur_frm.cscript, { }, hide_show_buttons: function(doc) { if(doc.docstatus==0) { - hide_field('Installment Reciept'); show_field('Generate'); + hide_field('Installment Reciept');// show_field('Generate'); } else if (doc.docstatus==1) { - show_field('Installment Reciept'); hide_field('Generate'); +// show_field('Installment Reciept'); +hide_field('Generate'); } }, clear_installments: function(doc) { @@ -30,17 +31,19 @@ $.extend(cur_frm.cscript, { 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:'Data', label:'Cheque Number', fieldname:'cheque_number', reqd:1}, + {fieldtype:'Date', label:'Cheque Date', fieldname:'cheque_date', reqd:1}, + {fieldtype:'Link', label:'Bank Account', fieldname:'bank_account', reqd:1, options:'Account'}, {fieldtype:'Button', label:'Update',fieldname:'update'} ] }) d.show(); d.fields_dict.update.input.onclick = function() { var data = d.get_values(); + if(data) { - $c_obj() + $c_obj(make_doclist(dt,dn),'loan_post',data,function(){cur_frm.refresh(); d.hide();}); } } } -}) \ No newline at end of file +}) diff --git a/accounts/doctype/loan/loan.py b/accounts/doctype/loan/loan.py index 4a6427dffa..adddbc57c7 100644 --- a/accounts/doctype/loan/loan.py +++ b/accounts/doctype/loan/loan.py @@ -1,5 +1,9 @@ import webnotes -from webnotes.model.doc import make_autoname, Document +from webnotes.model.doc import make_autoname, Document, addchild +from webnotes import msgprint +from webnotes.utils import get_defaults +import json +sql = webnotes.conn.sql class DocType: def __init__(self, doc, doclist): @@ -10,4 +14,38 @@ class DocType: Create Loan Id using naming_series pattern """ self.doc.name = make_autoname(self.doc.naming_series+ '.#####') + + def loan_post(self, args): + """ + Posts the loan receipt into Journal Voucher + """ + data = json.loads(args) + + jv = Document('Journal Voucher') + jv.voucher_type = 'Loan Receipt' + jv.naming_series = 'JV' + jv.voucher_date = data.get('cheque_date') + jv.posting_date = data.get('cheque_date') + jv.cheque_no = data.get('cheque_number') + jv.cheque_date = data.get('cheque_date') + jv.fiscal_year = get_defaults()['fiscal_year'] # To be modified to take care + jv.company = get_defaults()['company'] + + jv.save(1) + + next_inst = sql("select amount,name from `tabLoan Installment` where parent=%s and ifnull(cheque_number,'')='' order by due_date limit 1",self.doc.name) + jc = addchild(jv,'entries','Journal Voucher Detail',0) + jc.account = data.get('bank_account') + jc.debit = next_inst[0][0] + jc.save() + + jc = addchild(jv,'entries','Journal Voucher Detail',0) + jc.account = self.doc.account + jc.credit = next_inst[0][0] + jc.save() + + sql("update `tabLoan Installment` set cheque_number=%s, cheque_date=%s, jv_number=%s where name=%s",(data.get('cheque_number'),data.get('cheque_date'),jv.name,next_inst[0][1])) + + self.doclist = [Document(d.doctype, d.name) for d in self.doclist] + diff --git a/accounts/doctype/loan/loan.txt b/accounts/doctype/loan/loan.txt index df936129fe..3be82fbedc 100644 --- a/accounts/doctype/loan/loan.txt +++ b/accounts/doctype/loan/loan.txt @@ -5,21 +5,21 @@ { 'creation': '2011-07-15 10:35:26', 'docstatus': 0, - 'modified': '2011-07-15 10:35:26', + 'modified': '2011-07-15 15:51:10', 'modified_by': 'Administrator', 'owner': 'Administrator' }, # These values are common for all DocType { - '_last_update': '1310622631', + '_last_update': '1310706327', 'colour': 'White:FFF', 'doctype': 'DocType', 'module': 'Accounts', 'name': '__common__', 'section_style': 'Simple', 'show_in_menu': 0, - 'version': 11 + 'version': 12 }, # These values are common for all DocField @@ -34,19 +34,13 @@ # 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 + 'role': 'Accounts User' }, # DocType, Loan @@ -57,7 +51,20 @@ # DocPerm { - 'doctype': 'DocPerm' + 'cancel': 1, + 'create': 1, + 'doctype': 'DocPerm', + 'idx': 1, + 'permlevel': 0, + 'submit': 1, + 'write': 1 + }, + + # DocPerm + { + 'doctype': 'DocPerm', + 'idx': 2, + 'permlevel': 1 }, # DocField diff --git a/accounts/doctype/loan_installment/loan_installment.txt b/accounts/doctype/loan_installment/loan_installment.txt index bdb8bb3570..f729e3434b 100644 --- a/accounts/doctype/loan_installment/loan_installment.txt +++ b/accounts/doctype/loan_installment/loan_installment.txt @@ -5,7 +5,7 @@ { 'creation': '2011-07-15 10:36:42', 'docstatus': 0, - 'modified': '2011-07-15 10:36:42', + 'modified': '2011-07-15 15:48:34', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -19,7 +19,7 @@ 'name': '__common__', 'section_style': 'Simple', 'show_in_menu': 0, - 'version': 1 + 'version': 4 }, # These values are common for all DocField @@ -28,8 +28,7 @@ 'name': '__common__', 'parent': 'Loan Installment', 'parentfield': 'fields', - 'parenttype': 'DocType', - 'permlevel': 0 + 'parenttype': 'DocType' }, # DocType, Loan Installment @@ -44,7 +43,8 @@ 'fieldname': 'amount', 'fieldtype': 'Currency', 'idx': 1, - 'label': 'Amount' + 'label': 'Amount', + 'permlevel': 0 }, # DocField @@ -53,25 +53,28 @@ 'fieldname': 'due_date', 'fieldtype': 'Date', 'idx': 2, - 'label': 'Due Date' + 'label': 'Due Date', + 'permlevel': 0 }, # DocField { 'doctype': 'DocField', - 'fieldname': 'check_number', - 'fieldtype': 'Int', + 'fieldname': 'cheque_number', + 'fieldtype': 'Data', 'idx': 3, - 'label': 'Check Number' + 'label': 'Cheque Number', + 'permlevel': 0 }, # DocField { 'doctype': 'DocField', - 'fieldname': 'check_date', + 'fieldname': 'cheque_date', 'fieldtype': 'Date', 'idx': 4, - 'label': 'Check Date' + 'label': 'Cheque Date', + 'permlevel': 0 }, # DocField @@ -80,7 +83,8 @@ 'fieldname': 'deposit_date', 'fieldtype': 'Date', 'idx': 5, - 'label': 'Deposit Date' + 'label': 'Deposit Date', + 'permlevel': 0 }, # DocField @@ -89,6 +93,19 @@ 'fieldname': 'realized_date', 'fieldtype': 'Date', 'idx': 6, - 'label': 'Realized Date' + 'label': 'Realized Date', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'jv_number', + 'fieldtype': 'Link', + 'hidden': 0, + 'idx': 7, + 'label': 'JV Number', + 'options': 'Journal Voucher', + 'permlevel': 1 } ] \ No newline at end of file From 62a7b3cd4a3bb7d7b5f8e64c647f73da8b92b5c7 Mon Sep 17 00:00:00 2001 From: Brahma K Date: Thu, 21 Jul 2011 17:51:13 +0530 Subject: [PATCH 07/24] loan file modification --- accounts/doctype/gl_control/gl_control.py | 81 ++++++++++++----------- accounts/doctype/loan/loan.js | 17 +++-- accounts/doctype/loan/loan.py | 49 +++++++------- accounts/doctype/loan/loan.txt | 39 ++++++++--- 4 files changed, 105 insertions(+), 81 deletions(-) diff --git a/accounts/doctype/gl_control/gl_control.py b/accounts/doctype/gl_control/gl_control.py index 5ec8ecd22c..a346b65a57 100644 --- a/accounts/doctype/gl_control/gl_control.py +++ b/accounts/doctype/gl_control/gl_control.py @@ -12,7 +12,7 @@ sql = webnotes.conn.sql get_value = webnotes.conn.get_value in_transaction = webnotes.conn.in_transaction convert_to_lists = webnotes.conn.convert_to_lists - + # ----------------------------------------------------------------------------------------- from utilities.transaction_base import TransactionBase @@ -30,11 +30,11 @@ class DocType: #for r in ret: # inc = get_value('Account','Income - '+r[1], 'balance') # exp = get_value('Account','Expenses - '+r[1], 'balance') - # pl[r[0]] = flt(flt(inc) - flt(exp)) + # pl[r[0]] = flt(flt(inc) - flt(exp)) return {'cl':[r[0] for r in ret]}#, 'pl':pl} - - def get_company_currency(self,arg=''): - dcc = TransactionBase().get_company_currency(arg) + + def get_company_currency(self,arg=''): + dcc = TransactionBase().get_company_currency(arg) return dcc # Get current balance @@ -91,7 +91,7 @@ class DocType: fy = get_defaults()['fiscal_year'] parent, parent_acc_name, company, type = arg.split(',') - + # get children account details if type=='Account': @@ -103,7 +103,7 @@ class DocType: # remove Decimals for c in cl: c['balance'] = flt(c['balance']) - + # get children cost center details elif type=='Cost Center': if parent=='Root Node': @@ -111,7 +111,7 @@ class DocType: else: cl = sql("select name,group_or_ledger,cost_center_name from `tabCost Center` where ifnull(parent_cost_center, '')=%s and docstatus != 2 and company_name=%s order by name asc",(parent,company),as_dict=1) return {'parent':parent, 'parent_acc_name':parent_acc_name, 'cl':cl} - + # Add a new account # ----------------- def add_ac(self,arg): @@ -119,14 +119,14 @@ class DocType: ac = Document('Account') for d in arg.keys(): ac.fields[d] = arg[d] - ac.old_parent = '' + ac.old_parent = '' ac_obj = get_obj(doc=ac) ac_obj.validate() ac_obj.doc.save(1) ac_obj.on_update() return ac_obj.doc.name - + # Add a new cost center #---------------------- def add_cc(self,arg): @@ -138,33 +138,33 @@ class DocType: # map company abbr other_info = sql("select company_abbr from `tabCost Center` where name='%s'"%arg['parent_cost_center']) cc.company_abbr = other_info and other_info[0][0] or arg['company_abbr'] - + cc_obj = get_obj(doc=cc) cc_obj.validate() cc_obj.doc.save(1) cc_obj.on_update() return cc_obj.doc.name - - + + # Get field values from the voucher #------------------------------------------ def get_val(self, src, d, parent=None): - if not src: + if not src: return None if src.startswith('parent:'): return parent.fields[src.split(':')[1]] elif src.startswith('value:'): return eval(src.split(':')[1]) elif src: - return d.fields.get(src) - + return d.fields.get(src) + def check_if_in_list(self, le): for e in self.entries: if e.account == le.account and (cstr(e.against_voucher)==cstr(le.against_voucher)) and (cstr(e.against_voucher_type)==cstr(le.against_voucher_type)) and (cstr(e.cost_center)==cstr(le.cost_center)): return [e] return 0 - + # Make a dictionary(le) for every gl entry and append to a list(self.entries) #---------------------------------------------------------------------------- def make_single_entry(self,parent,d,le_map,cancel, merge_entries): @@ -176,12 +176,12 @@ class DocType: is_expense_acct = sql("select name from tabAccount where is_pl_account='Yes' and debit_or_credit='Debit' and name=%s",self.get_val(le_map['account'], d, parent)) if is_expense_acct and self.get_val(le_map['cost_center'], d, parent): get_obj('Budget Control').check_budget([self.get_val(le_map[k], d, parent) for k in flist if k in ['account','cost_center','debit','credit','posting_date','fiscal_year','company']],cancel) - + # Create new GL entry object and map values le = Document('GL Entry') for k in flist: le.fields[k] = self.get_val(le_map[k], d, parent) - + # if there is already an entry in this account then just add it to that entry same_head = self.check_if_in_list(le) if same_head and merge_entries: @@ -190,8 +190,8 @@ class DocType: same_head.credit = flt(same_head.credit) + flt(le.credit) else: self.entries.append(le) - - # Save GL Entries + + # Save GL Entries # ---------------- def save_entries(self, cancel, adv_adj, update_outstanding): for le in self.entries: @@ -199,7 +199,7 @@ class DocType: if cancel or flt(le.debit) < 0 or flt(le.credit) < 0: tmp=le.debit le.debit, le.credit = abs(flt(le.credit)), abs(flt(tmp)) - + le_obj = get_obj(doc=le) # validate except on_cancel @@ -213,11 +213,11 @@ class DocType: # update total debit / credit self.td += flt(le.debit) self.tc += flt(le.credit) - + # Make Multiple Entries # --------------------- def make_gl_entries(self, doc, doclist, cancel=0, adv_adj = 0, use_mapper='', merge_entries = 1, update_outstanding='Yes'): - # get entries + # get entries le_map_list = sql("select * from `tabGL Mapper Detail` where parent = %s", use_mapper or doc.doctype, as_dict=1) self.td, self.tc = 0.0, 0.0 for le_map in le_map_list: @@ -228,10 +228,10 @@ class DocType: self.make_single_entry(doc,d,le_map,cancel, merge_entries) else: self.make_single_entry(None,doc,le_map,cancel, merge_entries) - + # save entries self.save_entries(cancel, adv_adj, update_outstanding) - + # check total debit / credit # Due to old wrong entries (total debit != total credit) some voucher could be cancelled if abs(self.td - self.tc) > 0.001 and not cancel: @@ -289,7 +289,7 @@ class DocType: add.allocate_amount = 0 if table_name == 'Advance Allocation Detail': add.tds_amount = flt(d[4]) - + # Clear rows which is not adjusted #------------------------------------- def clear_advances(self, obj,table_name,table_field_name): @@ -297,7 +297,7 @@ class DocType: if not flt(d.allocated_amount): sql("update `tab%s` set parent = '' where name = '%s' and parent = '%s'" % (table_name, d.name, d.parent)) d.parent = '' - + # Update aginst document in journal voucher #------------------------------------------ def update_against_document_in_jv(self, obj, table_field_name, against_document_no, against_document_doctype, account_head, dr_or_cr,doctype): @@ -310,7 +310,7 @@ class DocType: # update ref in JV Detail sql("update `tabJournal Voucher Detail` set %s = '%s' where name = '%s'" % (doctype=='Payable Voucher' and 'against_voucher' or 'against_invoice', cstr(against_document_no), d.jv_detail_no)) - + # re-submit JV jv_obj = get_obj('Journal Voucher', d.journal_voucher, with_children =1) get_obj(dt='GL Control').make_gl_entries(jv_obj.doc, jv_obj.doclist, cancel = 0, adv_adj =1) @@ -319,22 +319,22 @@ class DocType: # cancel JV jv_obj = get_obj('Journal Voucher', d.journal_voucher, with_children=1) get_obj(dt='GL Control').make_gl_entries(jv_obj.doc, jv_obj.doclist, cancel =1, adv_adj = 1) - + # add extra entries self.add_extra_entry(jv_obj, d.journal_voucher, d.jv_detail_no, flt(d.allocated_amount), account_head, doctype, dr_or_cr, against_document_no) - + # re-submit JV jv_obj = get_obj('Journal Voucher', d.journal_voucher, with_children =1) get_obj(dt='GL Control').make_gl_entries(jv_obj.doc, jv_obj.doclist, cancel = 0, adv_adj = 1) else: msgprint("Allocation amount cannot be greater than advance amount") raise Exception - + # Add extra row in jv detail for unadjusted amount #-------------------------------------------------- def add_extra_entry(self,jv_obj,jv,jv_detail_no, allocate, account_head, doctype, dr_or_cr, against_document_no): # get old entry details - + jvd = sql("select %s, cost_center, balance, against_account from `tabJournal Voucher Detail` where name = '%s'" % (dr_or_cr,jv_detail_no)) advance = jvd and flt(jvd[0][0]) or 0 balance = flt(advance) - flt(allocate) @@ -351,7 +351,7 @@ class DocType: add.against_account = cstr(jvd[0][3]) add.is_advance = 'Yes' add.save(1) - + # check if advance entries are still valid # ---------------------------------------- def validate_jv_entry(self, d, account_head, dr_or_cr): @@ -406,22 +406,23 @@ In Account := %s User := %s has Repaired Outstanding Amount For %s : %s and foll """ vl = sql(""" select voucher_type, voucher_no, account, sum(debit) as sum_debit, sum(credit) as sum_credit - from `tabGL Entry` + from `tabGL Entry` where is_cancelled='Yes' and creation > %s group by voucher_type, voucher_no, account """, after_date, as_dict=1) - + ac_list = [] for v in vl: if v['sum_debit'] != 0 or v['sum_credit'] != 0: ac_list.append(v['account']) - - fy_list = sql("""select name from `tabFiscal Year` - where (%s between year_start_date and date_sub(date_add(year_start_date,interval 1 year), interval 1 day)) - or year_start_date > %s + + fy_list = sql("""select name from `tabFiscal Year` + where (%s between year_start_date and date_sub(date_add(year_start_date,interval 1 year), interval 1 day)) + or year_start_date > %s order by year_start_date ASC""", (after_date, after_date)) for fy in fy_list: fy_obj = get_obj('Fiscal Year', fy[0]) for a in set(ac_list): fy_obj.repost(a) + diff --git a/accounts/doctype/loan/loan.js b/accounts/doctype/loan/loan.js index a26df3f73f..1851a84866 100644 --- a/accounts/doctype/loan/loan.js +++ b/accounts/doctype/loan/loan.js @@ -8,19 +8,24 @@ $.extend(cur_frm.cscript, { } cur_frm.refresh(); }, +/* submit:function(doc){ + data=doc.get_values(); + + data['']= + $c_obj(make_doclist(dt,dn),'loan_post',data,function(){}); + },*/ 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'); + hide_field('Installment Reciept'); show_field('Generate'); } else if (doc.docstatus==1) { -// show_field('Installment Reciept'); -hide_field('Generate'); + show_field('Installment Reciept');hide_field('Generate'); } }, clear_installments: function(doc) { - $.each(getchildren('Loan Installment', doc.name, 'installments', 'Loan'), + $.each(getchildren('Loan Installment', doc.name, 'installments', 'Loan'), function(i, d) { LocalDB.delete_doc('Loan Installment', d.name); } @@ -40,9 +45,9 @@ hide_field('Generate'); d.show(); d.fields_dict.update.input.onclick = function() { var data = d.get_values(); - + if(data) { - $c_obj(make_doclist(dt,dn),'loan_post',data,function(){cur_frm.refresh(); d.hide();}); + $c_obj(make_doclist(dt,dn),'loan_installment_post',data,function(){cur_frm.refresh(); d.hide();}); } } } diff --git a/accounts/doctype/loan/loan.py b/accounts/doctype/loan/loan.py index adddbc57c7..9f0bcb53a0 100644 --- a/accounts/doctype/loan/loan.py +++ b/accounts/doctype/loan/loan.py @@ -3,49 +3,46 @@ from webnotes.model.doc import make_autoname, Document, addchild from webnotes import msgprint from webnotes.utils import get_defaults import json +from accounts.utils import post_jv sql = webnotes.conn.sql class DocType: def __init__(self, doc, doclist): self.doc, self.doclist = doc, doclist - + def autoname(self): """ Create Loan Id using naming_series pattern """ self.doc.name = make_autoname(self.doc.naming_series+ '.#####') - def loan_post(self, args): + def loan_post(self): + data['voucher_type']='Loan Issue' + data['naming_series']='JV' + data['fiscal_year'] = get_defaults()['fiscal_year'] # To be modified to take care + data['company'] = get_defaults()['company'] + data['debit_account'] = self.doc['receivable_account'] + data['credit_account'] = self.doc['account'] + data['amount'] = self.doc.loan_amount + jv_name=post_jv(data) + + def loan_installment_post(self, args): """ Posts the loan receipt into Journal Voucher """ - data = json.loads(args) - - jv = Document('Journal Voucher') - jv.voucher_type = 'Loan Receipt' - jv.naming_series = 'JV' - jv.voucher_date = data.get('cheque_date') - jv.posting_date = data.get('cheque_date') - jv.cheque_no = data.get('cheque_number') - jv.cheque_date = data.get('cheque_date') - jv.fiscal_year = get_defaults()['fiscal_year'] # To be modified to take care - jv.company = get_defaults()['company'] - - jv.save(1) - next_inst = sql("select amount,name from `tabLoan Installment` where parent=%s and ifnull(cheque_number,'')='' order by due_date limit 1",self.doc.name) - - jc = addchild(jv,'entries','Journal Voucher Detail',0) - jc.account = data.get('bank_account') - jc.debit = next_inst[0][0] - jc.save() - jc = addchild(jv,'entries','Journal Voucher Detail',0) - jc.account = self.doc.account - jc.credit = next_inst[0][0] - jc.save() + data = json.loads(args) + data['voucher_type']='Loan Receipt' + data['naming_series']='JV' + data['amount']=next_inst[0][0] + data['debit_account']=data.get('bank_account') + data['credit_account']=self.doc.account + data['fiscal_year']=get_defaults()['fiscal_year'] + data['company']=get_defaults()['company'] + jv_name=post_jv(data) - sql("update `tabLoan Installment` set cheque_number=%s, cheque_date=%s, jv_number=%s where name=%s",(data.get('cheque_number'),data.get('cheque_date'),jv.name,next_inst[0][1])) + sql("update `tabLoan Installment` set cheque_number=%s, cheque_date=%s, jv_number=%s where name=%s",(data.get('cheque_number'),data.get('cheque_date'),jv_name,next_inst[0][1])) self.doclist = [Document(d.doctype, d.name) for d in self.doclist] diff --git a/accounts/doctype/loan/loan.txt b/accounts/doctype/loan/loan.txt index 3be82fbedc..001e1d3845 100644 --- a/accounts/doctype/loan/loan.txt +++ b/accounts/doctype/loan/loan.txt @@ -5,21 +5,21 @@ { 'creation': '2011-07-15 10:35:26', 'docstatus': 0, - 'modified': '2011-07-15 15:51:10', + 'modified': '2011-07-18 12:12:19', 'modified_by': 'Administrator', 'owner': 'Administrator' }, # These values are common for all DocType { - '_last_update': '1310706327', + '_last_update': '1310963215', 'colour': 'White:FFF', 'doctype': 'DocType', 'module': 'Accounts', 'name': '__common__', 'section_style': 'Simple', 'show_in_menu': 0, - 'version': 12 + 'version': 15 }, # These values are common for all DocField @@ -89,12 +89,33 @@ 'reqd': 1 }, + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'receivable_account', + 'fieldtype': 'Link', + 'idx': 3, + 'label': 'Receivable Account', + 'options': 'Account' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'invoice', + 'fieldtype': 'Link', + 'idx': 4, + 'label': 'Invoice', + 'options': 'Receivable Voucher', + 'reqd': 1 + }, + # DocField { 'doctype': 'DocField', 'fieldname': 'loan_amount', 'fieldtype': 'Currency', - 'idx': 3, + 'idx': 5, 'label': 'Loan Amount', 'reqd': 1 }, @@ -104,7 +125,7 @@ 'doctype': 'DocField', 'fieldname': 'start_date', 'fieldtype': 'Date', - 'idx': 4, + 'idx': 6, 'label': 'Start Date', 'reqd': 1 }, @@ -114,7 +135,7 @@ 'doctype': 'DocField', 'fieldname': 'no_of_installments', 'fieldtype': 'Int', - 'idx': 5, + 'idx': 7, 'label': 'No of Installments', 'reqd': 1 }, @@ -124,7 +145,7 @@ 'colour': 'White:FFF', 'doctype': 'DocField', 'fieldtype': 'Button', - 'idx': 6, + 'idx': 8, 'label': 'Generate', 'trigger': 'Client' }, @@ -134,7 +155,7 @@ 'doctype': 'DocField', 'fieldname': 'installments', 'fieldtype': 'Table', - 'idx': 7, + 'idx': 9, 'label': 'Installments', 'options': 'Loan Installment' }, @@ -145,7 +166,7 @@ 'colour': 'White:FFF', 'doctype': 'DocField', 'fieldtype': 'Button', - 'idx': 8, + 'idx': 10, 'label': 'Installment Reciept' } ] \ No newline at end of file From 7cd48f1d5984aaf1f3a6dcfb7c2e290aa88c6573 Mon Sep 17 00:00:00 2001 From: Brahma K Date: Thu, 21 Jul 2011 17:57:32 +0530 Subject: [PATCH 08/24] payable report in a single query --- .../accounts_payable/accounts_payable.sql | 37 +++++++++++++------ 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/accounts/search_criteria/accounts_payable/accounts_payable.sql b/accounts/search_criteria/accounts_payable/accounts_payable.sql index d2dba06391..520535f51f 100644 --- a/accounts/search_criteria/accounts_payable/accounts_payable.sql +++ b/accounts/search_criteria/accounts_payable/accounts_payable.sql @@ -1,11 +1,26 @@ -SELECT DISTINCT `tabGL Entry`.`Aging_date`,`tabGL Entry`.`transaction_date`,`tabGL Entry`.`account`, `tabGL Entry`.`against_voucher_type`, `tabGL Entry`.`against_voucher`,`tabGL Entry`.`voucher_type`,`tabGL Entry`.`voucher_no`, `tabGL Entry`.remarks -FROM `tabGL Entry`,`tabAccount` -WHERE `tabGL Entry`.`posting_date`>= '%(posting_date)s' - AND `tabGL Entry`.`posting_date`<= '%(posting_date1)s' - AND `tabGL Entry`.`account` LIKE '%(account)s%%' - AND `tabGL Entry`.`company` LIKE '%(company)s%%' - AND ((ifnull(`tabGL Entry`.voucher_type,'') = 'Payable Voucher' and `tabGL Entry`.credit>0) OR `tabGL Entry`.voucher_type = 'Journal Voucher') - AND `tabGL Entry`.`is_cancelled` = 'No' - AND `tabAccount`.master_type = 'Supplier' - AND `tabAccount`.name = `tabGL Entry`.account - ORDER BY `tabGL Entry`.`posting_date` +SELECT * +FROM ( + +SELECT a.posting_date, a.voucher_no, a.account, a.credit AS inv_amount, ifnull( a.credit, 0 ) - ifnull( b.debit, 0 ) AS outstanding +FROM ( + +SELECT gl . * +FROM `tabGL Entry` gl, `tabAccount` acc +WHERE gl.account = acc.name +AND acc.master_type = 'Supplier' +AND ifnull( gl.is_cancelled, 'No' ) = 'No' +AND gl.credit >0 +AND gl.posting_date <= current_date +)a +LEFT JOIN ( + +SELECT against_voucher, account, sum( debit ) AS debit +FROM `tabGL Entry` +WHERE ifnull( is_cancelled, 'No' ) = 'No' +AND posting_date <= current_date +GROUP BY against_voucher, account +)b ON a.voucher_no = b.against_voucher +AND a.account = b.account +)c +WHERE outstanding !=0 +ORDER BY posting_date, voucher_no \ No newline at end of file From f817672bb6cdb200ac1e3037b9e9df54f4ceca84 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 25 Jul 2011 14:09:15 +0530 Subject: [PATCH 09/24] fix to sms control --- utilities/doctype/sms_control/sms_control.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/doctype/sms_control/sms_control.py b/utilities/doctype/sms_control/sms_control.py index c218ab8b81..a1edf83bf3 100644 --- a/utilities/doctype/sms_control/sms_control.py +++ b/utilities/doctype/sms_control/sms_control.py @@ -58,7 +58,7 @@ class DocType: def connect_gateway(self): "login to gateway" from webnotes.utils.webservice import FrameworkServer - fw = FrameworkServer('www.erpnext.com', '/', '__system@webnotestech.com', 'password') + fw = FrameworkServer('www.erpnext.com', '/', '__system@webnotestech.com', 'password', https=1) return fw def get_sender_name(self): From 5de4e4ae1a4a833db79e548e64ab14db1052d3a3 Mon Sep 17 00:00:00 2001 From: Brahma K Date: Mon, 25 Jul 2011 14:53:03 +0530 Subject: [PATCH 10/24] PO Items to receive fixed --- .../pending_po_items_to_receive/pending_po_items_to_receive.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buying/search_criteria/pending_po_items_to_receive/pending_po_items_to_receive.txt b/buying/search_criteria/pending_po_items_to_receive/pending_po_items_to_receive.txt index 062e385825..9708db2835 100644 --- a/buying/search_criteria/pending_po_items_to_receive/pending_po_items_to_receive.txt +++ b/buying/search_criteria/pending_po_items_to_receive/pending_po_items_to_receive.txt @@ -12,7 +12,7 @@ # These values are common for all Search Criteria { - 'add_col': '`tabPO Detail`.qty - ifnull(`tabPO Detail`.received_qty, 0) AS "Pending Quantity To Receive"\n(`tabPO Detail`.qty - ifnull(`tabPO Detail`.received_qty, 0)) * `tabPO Detail`.purchase_rate AS "Pending Amount To Receive\'"', + 'add_col': '`tabPO Detail`.qty - ifnull(`tabPO Detail`.received_qty, 0) AS "Pending Quantity To Receive"\n(`tabPO Detail`.qty - ifnull(`tabPO Detail`.received_qty, 0)) * `tabPO Detail`.purchase_rate AS "Pending Amount To Receive"', 'add_cond': '`tabPO Detail`.qty - ifnull(`tabPO Detail`.received_qty, 0) > 0 \n`tabPurchase Order`.status != "Stopped"', 'columns': 'Purchase Order\x01ID,Purchase Order\x01Supplier,Purchase Order\x01Supplier Name,Purchase Order\x01Status,Purchase Order\x01PO Date,Purchase Order\x01Fiscal Year,PO Detail\x01Indent No,PO Detail\x01Item Code,PO Detail\x01Item Name,PO Detail\x01Description,PO Detail\x01Quantity,PO Detail\x01UOM,PO Detail\x01Received Qty', 'criteria_name': 'Pending PO Items To Receive', From 19159f765811e325ad87434b8bfc40ef0076843c Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 26 Jul 2011 16:14:10 +0530 Subject: [PATCH 11/24] index patch on hold, will go through push_patch --- patches/patch.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/patches/patch.py b/patches/patch.py index 3f6c93e0c1..cda627b030 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 330 +last_patch = 329 #------------------------------------------- @@ -1326,8 +1326,5 @@ def execute(patch_no): if webnotes.conn.get_value('Control Panel', None, 'account_id') != 'axjanak2011': sql("delete from `tabDocField` where fieldname = 'supplier_status' and parent = 'Supplier'") elif patch_no == 329: - from index_patch import create_proper_index - create_proper_index() - elif patch_no == 330: reload_doc('utilities', 'doctype', 'rename_tool') reload_doc('utilities', 'doctype', 'bulk_rename_tool') From 8a76466d7c11b51f7442f65af676edd7a1360c0b Mon Sep 17 00:00:00 2001 From: Brahma K Date: Tue, 26 Jul 2011 18:43:53 +0530 Subject: [PATCH 12/24] Lease Agreement Used by leasing and loan agents, who needs to followup their receipts against lease agreements Contains leasing related reports with prefix "Lease" Upload Account Transactions Added a file to upload account transactions from csv file, which passes Journal Voucher and submits automatically --- accounts/Module Def/Accounts/Accounts.txt | 18 ++++++++++++++---- .../accounts_receivable/accounts_receivable.js | 6 +++--- .../pending_po_items_to_receive.py | 1 + 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/accounts/Module Def/Accounts/Accounts.txt b/accounts/Module Def/Accounts/Accounts.txt index 708a2c942f..bd3cbbf7fd 100644 --- a/accounts/Module Def/Accounts/Accounts.txt +++ b/accounts/Module Def/Accounts/Accounts.txt @@ -5,7 +5,7 @@ { 'creation': '2010-09-25 10:50:34', 'docstatus': 0, - 'modified': '2011-07-15 10:43:04', + 'modified': '2011-07-26 18:14:48', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -40,7 +40,7 @@ 'module_icon': 'Accounts.gif', 'module_label': 'Accounts', 'module_name': 'Accounts', - 'module_seq': 5, + 'module_seq': 3, 'name': '__common__' }, @@ -107,8 +107,9 @@ # Module Def Item { - 'display_name': 'Loan', - 'doc_name': 'Loan', + 'description': 'Lease Agreement for Vehicles', + 'display_name': 'Lease Agreement', + 'doc_name': 'Lease Agreement', 'doc_type': 'Forms', 'doctype': 'Module Def Item', 'idx': 6 @@ -354,6 +355,15 @@ 'idx': 32 }, + # Module Def Item + { + 'display_name': 'Lease Agreement List', + 'doc_name': 'Lease Agreement List', + 'doc_type': 'Reports', + 'doctype': 'Module Def Item', + 'idx': 33 + }, + # Module Def Role { 'doctype': 'Module Def Role', diff --git a/accounts/search_criteria/accounts_receivable/accounts_receivable.js b/accounts/search_criteria/accounts_receivable/accounts_receivable.js index a51b8fb9c9..f31dc762a8 100644 --- a/accounts/search_criteria/accounts_receivable/accounts_receivable.js +++ b/accounts/search_criteria/accounts_receivable/accounts_receivable.js @@ -5,8 +5,8 @@ report.customize_filters = function() { this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Posting Date'].df.filter_hide = 0; this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df.filter_hide = 0; this.filter_fields_dict['GL Entry'+FILTER_SEP +'Account'].df.filter_hide = 0; - - this.add_filter({fieldname:'aging_based_on', label:'Aging Based On', fieldtype:'Select', options:NEWLINE+'Transaction Date'+NEWLINE+'Aging Date'+NEWLINE+'Due Date',ignore : 1, parent:'Receivable Voucher', report_default:'Aging Date'}); + + this.add_filter({fieldname:'aging_based_on', label:'Aging Based On', fieldtype:'Select', options:NEWLINE+'Transaction Date'+NEWLINE+'Aging Date'+NEWLINE+'Due Date',ignore : 1, parent:'Receivable Voucher', report_default:'Aging Date'}); this.add_filter({fieldname:'range_1', label:'Range 1', fieldtype:'Data', ignore : 1, parent:'GL Entry'}); this.add_filter({fieldname:'range_2', label:'Range 2', fieldtype:'Data', ignore : 1, parent:'GL Entry'}); this.add_filter({fieldname:'range_3', label:'Range 3', fieldtype:'Data', ignore : 1, parent:'GL Entry'}); @@ -19,4 +19,4 @@ report.customize_filters = function() { this.dt.set_no_limit(1); } -this.mytabs.items['Select Columns'].hide() \ No newline at end of file +//this.mytabs.items['Select Columns'].hide() \ No newline at end of file diff --git a/buying/search_criteria/pending_po_items_to_receive/pending_po_items_to_receive.py b/buying/search_criteria/pending_po_items_to_receive/pending_po_items_to_receive.py index 486cc6df85..159d3930b9 100644 --- a/buying/search_criteria/pending_po_items_to_receive/pending_po_items_to_receive.py +++ b/buying/search_criteria/pending_po_items_to_receive/pending_po_items_to_receive.py @@ -1,2 +1,3 @@ +msgprint(colwidths) colwidths[col_idx['Pending Quantity To Receive']] = '200px' colwidths[col_idx['Pending Amount To Receive']] = '200px' \ No newline at end of file From d7db2ea20fdd84817bf1dc2ad71e2a5232206543 Mon Sep 17 00:00:00 2001 From: Brahma K Date: Tue, 26 Jul 2011 19:04:13 +0530 Subject: [PATCH 13/24] Lease Agreement Used by leasing and loan agents (i.e. Automobile leasing etc) for receipt follow up and reporting Account Transactions Upload Uploads transactions from a csv files, creates Journal Vouchers and submits --- accounts/doctype/lease_agreement/__init__.py | 0 .../lease_agreement/lease_agreement.js | 66 +++++++++++ .../lease_agreement/lease_agreement.py | 37 +++++++ .../doctype/lease_installment/__init__.py | 0 .../lease_agreement_list/__init__.py | 0 .../__init__.py | 0 .../lease_over_due_list/__init__.py | 0 .../lease_overdue_age_wise/__init__.py | 0 .../__init__.py | 0 .../lease_receipts_client_wise/__init__.py | 0 .../__init__.py | 0 accounts/utils/__init__.py | 27 +++++ .../upload_accounts_transactions/__init__.py | 0 .../upload_accounts_transactions.js | 18 +++ .../upload_accounts_transactions.py | 103 ++++++++++++++++++ 15 files changed, 251 insertions(+) create mode 100644 accounts/doctype/lease_agreement/__init__.py create mode 100644 accounts/doctype/lease_agreement/lease_agreement.js create mode 100644 accounts/doctype/lease_agreement/lease_agreement.py create mode 100644 accounts/doctype/lease_installment/__init__.py create mode 100644 accounts/search_criteria/lease_agreement_list/__init__.py create mode 100644 accounts/search_criteria/lease_monthly_future_installment_inflows/__init__.py create mode 100644 accounts/search_criteria/lease_over_due_list/__init__.py create mode 100644 accounts/search_criteria/lease_overdue_age_wise/__init__.py create mode 100644 accounts/search_criteria/lease_receipt_summary_year_to_date/__init__.py create mode 100644 accounts/search_criteria/lease_receipts_client_wise/__init__.py create mode 100644 accounts/search_criteria/lease_yearly_future_installment_inflows/__init__.py create mode 100644 accounts/utils/__init__.py create mode 100644 setup/doctype/upload_accounts_transactions/__init__.py create mode 100644 setup/doctype/upload_accounts_transactions/upload_accounts_transactions.js create mode 100644 setup/doctype/upload_accounts_transactions/upload_accounts_transactions.py diff --git a/accounts/doctype/lease_agreement/__init__.py b/accounts/doctype/lease_agreement/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/accounts/doctype/lease_agreement/lease_agreement.js b/accounts/doctype/lease_agreement/lease_agreement.js new file mode 100644 index 0000000000..8c681a11b2 --- /dev/null +++ b/accounts/doctype/lease_agreement/lease_agreement.js @@ -0,0 +1,66 @@ +$.extend(cur_frm.cscript, { + Generate: function(doc, dt, dn) { + cur_frm.cscript.clear_installments(doc); + tot=0;i=0; + while(totTo upload transactions, please attach a (.csv) file with 5 columns - Date, Transaction Number, Account, Debit Amount, Credit Amount (no headings necessary). See attachments box in the right column') + } else { + set_field_options('Upload Accounts Transactions Help', '
To update transactions from the attachment, please click on "Upload Accounts Transactions"
') + } +} + +cur_frm.cscript['Upload Accounts Transactions'] = function(doc, cdt, cdn) { + if(confirm("This action will append all transactions and cannot be un-done. Are you sure you want to continue?")) { + $c_obj([doc], 'upload_accounts_transactions', '', function(r, rt) { }); + } +} diff --git a/setup/doctype/upload_accounts_transactions/upload_accounts_transactions.py b/setup/doctype/upload_accounts_transactions/upload_accounts_transactions.py new file mode 100644 index 0000000000..2028e5fe60 --- /dev/null +++ b/setup/doctype/upload_accounts_transactions/upload_accounts_transactions.py @@ -0,0 +1,103 @@ +# Please edit this list and import only required elements +import webnotes + +from webnotes.utils import add_days, add_months, add_years, cint, cstr, date_diff, default_fields, flt, fmt_money, formatdate, generate_hash, getTraceback, get_defaults, get_first_day, get_last_day, getdate, has_common, month_name, now, nowdate, replace_newlines, sendmail, set_default, str_esc_quote, user_format, validate_email_add +from webnotes.model import db_exists +from webnotes.model.doc import Document, addchild, removechild, getchildren, make_autoname, SuperDocType +from webnotes.model.doclist import getlist, copy_doclist +from webnotes.model.code import get_obj, get_server_obj, run_server_obj, updatedb, check_syntax +from webnotes import session, form, is_testing, msgprint, errprint + +set = webnotes.conn.set +sql = webnotes.conn.sql +get_value = webnotes.conn.get_value +in_transaction = webnotes.conn.in_transaction +convert_to_lists = webnotes.conn.convert_to_lists + +# ----------------------------------------------------------------------------------------- + +class DocType: + def __init__(self, d, dl): + self.doc, self.doclist = d, dl + self.cl = [] + + # upload transactions + def upload_accounts_transactions(self): + import csv + data = csv.reader(self.get_csv_data().splitlines()) + + abbr = sql("select concat(' - ',abbr) as abbr from tabCompany where name=%s",self.doc.company) + updated = 0 + jv_name='' +# jv = Document('Journal Voucher') + global line,jv,name,jv_go + for line in data: + if len(line)>=7: #Minimum no of fields + if line[3]!=jv_name: #Create JV + if jv_name!='': + jv_go = get_obj('Journal Voucher',name, with_children=1) + jv_go.validate() + jv_go.on_submit() + + jv_name=line[3] + jv = Document('Journal Voucher') + jv.voucher_type = line[0] + jv.naming_series = line[1] + jv.voucher_date = formatdate(line[2]) + jv.posting_date = formatdate(line[2]) +# jv.name = line[3] + jv.fiscal_year = self.doc.fiscal_year + jv.company = self.doc.company + jv.remark = len(line)==8 and line[3]+' '+line[7] or line[3]+' Uploaded Record' + jv.docstatus=1 + jv.save(1) + name=jv.name + + jc = addchild(jv,'entries','Journal Voucher Detail',0) + jc.account = line[4]+abbr[0][0] + jc.cost_center=len(line)==9 and line[8] or self.doc.default_cost_center + if line[5]!='': + jc.debit = line[5] + else: + jc.credit = line[6] + jc.save() + + else: #Create JV Child + jc = addchild(jv,'entries','Journal Voucher Detail',0) + jc.account = line[4]+abbr[0][0] + jc.cost_center=len(line)==9 and line[8] or self.doc.default_cost_center + if line[5]!='': + jc.debit = line[5] + else: + jc.credit = line[6] + jc.save() + else: + msgprint("[Ignored] Incorrect format: %s" % str(line)) + if jv_name!='': + jv_go = get_obj('Journal Voucher',name, with_children=1) + jv_go.validate() + jv_go.on_submit() + + msgprint("%s items updated" % updated) + + # clear prices + def clear_prices(self): + cnt = sql("select count(*) from `tabRef Rate Detail` where price_list_name = %s", self.doc.name) + sql("delete from `tabRef Rate Detail` where price_list_name = %s", self.doc.name) + msgprint("%s prices cleared" % cnt[0][0]) + + # Update CSV data + def get_csv_data(self): + if not self.doc.file_list: + msgprint("File not attached!") + raise Exception + + fid = self.doc.file_list.split(',')[1] + + from webnotes.utils import file_manager + fn, content = file_manager.get_file(fid) + + if not type(content) == str: + content = content.tostring() + + return content From 0930762231a9c067e27ae3d61a71d11b1113267d Mon Sep 17 00:00:00 2001 From: Brahma K Date: Wed, 27 Jul 2011 12:03:34 +0530 Subject: [PATCH 14/24] Added patch for Lease Agreement --- accounts/Module Def/Accounts/Accounts.txt | 56 +++++++++- patches/patch.py | 127 ++++++++++++---------- 2 files changed, 124 insertions(+), 59 deletions(-) diff --git a/accounts/Module Def/Accounts/Accounts.txt b/accounts/Module Def/Accounts/Accounts.txt index bd3cbbf7fd..35e7e5d38d 100644 --- a/accounts/Module Def/Accounts/Accounts.txt +++ b/accounts/Module Def/Accounts/Accounts.txt @@ -5,7 +5,7 @@ { 'creation': '2010-09-25 10:50:34', 'docstatus': 0, - 'modified': '2011-07-26 18:14:48', + 'modified': '2011-07-27 11:43:40', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -364,6 +364,60 @@ 'idx': 33 }, + # Module Def Item + { + 'display_name': 'Lease Monthly Future Installment Inflows', + 'doc_name': 'Lease Monthly Future Installment Inflows', + 'doc_type': 'Reports', + 'doctype': 'Module Def Item', + 'idx': 34 + }, + + # Module Def Item + { + 'display_name': 'Lease Overdue Age Wise', + 'doc_name': 'Lease Overdue Age Wise', + 'doc_type': 'Reports', + 'doctype': 'Module Def Item', + 'idx': 35 + }, + + # Module Def Item + { + 'display_name': 'Lease Overdue List', + 'doc_name': 'Lease Overdue List', + 'doc_type': 'Reports', + 'doctype': 'Module Def Item', + 'idx': 36 + }, + + # Module Def Item + { + 'display_name': 'Lease Receipts Client Wise', + 'doc_name': 'Lease Receipts Client Wise', + 'doc_type': 'Reports', + 'doctype': 'Module Def Item', + 'idx': 37 + }, + + # Module Def Item + { + 'display_name': 'Lease Receipt Summary Year to Date', + 'doc_name': 'Lease Receipt Summary Year to Date', + 'doc_type': 'Reports', + 'doctype': 'Module Def Item', + 'idx': 38 + }, + + # Module Def Item + { + 'display_name': 'Lease Yearly Future Installment Inflows', + 'doc_name': 'Lease Yearly Future Installment Inflows', + 'doc_type': 'Reports', + 'doctype': 'Module Def Item', + 'idx': 39 + }, + # Module Def Role { 'doctype': 'Module Def Role', diff --git a/patches/patch.py b/patches/patch.py index cda627b030..f5479191d2 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 329 +last_patch = 330 #------------------------------------------- @@ -46,7 +46,7 @@ def execute(patch_no): for d in path_list: doclist = eval(open(d,'r').read()) webnotes.conn.sql("update `tab%s` set module = '%s' where name = '%s'" % (doclist[0]['doctype'], doclist[0]['module'], doclist[0]['name'])) - + elif patch_no==38: import webnotes webnotes.conn.set_global("system_message", "System Updates: Hello! You would have noticed some changes on the Home Page. As a part of our commitment to make the system more friendly and social, we have re-designed the feed so that now you will only see feed that is relevant to you (either you have created something or you have been mentioned in the document).

On the individual listings, you can add tags and also color them!

You will also get time-to-time updates from our side here. Do keep sending your feedback at support@erpnext.com.") @@ -56,7 +56,7 @@ def execute(patch_no): pass elif patch_no == 40: - + import_from_files(record_list=[['material_management','doctype','item']]) elif patch_no == 42: acc = sql("select name, lft, rgt from tabAccount where account_name in ('Incomes', 'Expenses')") @@ -65,7 +65,7 @@ def execute(patch_no): elif patch_no == 43: import webnotes.model webnotes.model.delete_doc('Page', 'Module Manager') - + # cleanup of Service, Customer Support, Utilities Modules # ------------------------------------------------------- elif patch_no == 44: @@ -86,7 +86,7 @@ def execute(patch_no): # remove utilities webnotes.conn.sql('delete from `tabModule Def` where name in ("Customer Support", "Utilities")') - + elif patch_no == 45: webnotes.conn.sql('delete from tabDocField where options="Ticket Response Detail"') @@ -125,7 +125,7 @@ def execute(patch_no): elif patch_no == 56: sql("delete from `tabModule Def Item` where parent = 'CRM' and doc_type = 'Reports' and doc_name = 'Delivery Note' and display_name = 'Territory, Item Group wise GP'") elif patch_no == 57: - + import_from_files(record_list=[['crm','doctype','sales_order_detail']]) elif patch_no == 58: # module def patches @@ -133,24 +133,24 @@ def execute(patch_no): sql("delete from `tabModule Def Item` where doc_type in ('Separator', 'Setup Forms', 'More Reports')") sql("delete from `tabModule Def Item` where doc_name = 'Project Activity'") sql("update `tabModule Def` set module_label = 'People', disabled='No', is_hidden='No' where name = 'My Company'") - + # insert new module items from webnotes.model.doc import make_autoname if not sql("select name from `tabModule Def Item` where parent='Projects' and doc_name='Ticket'"): - sql("""insert into `tabModule Def Item` - (name, parent, parenttype, parentfield, docstatus, doc_type, doc_name, display_name, idx) values + sql("""insert into `tabModule Def Item` + (name, parent, parenttype, parentfield, docstatus, doc_type, doc_name, display_name, idx) values (%s, 'Projects', 'Module Def', 'items', 0, 'Forms', 'Ticket', 'Task', 1)""", make_autoname('MDI.#####')) if not sql("select name from `tabModule Def Item` where parent='Projects' and doc_name='Timesheet'"): - sql("""insert into `tabModule Def Item` - (name, parent, parenttype, parentfield, docstatus, doc_type, doc_name, display_name, idx) values + sql("""insert into `tabModule Def Item` + (name, parent, parenttype, parentfield, docstatus, doc_type, doc_name, display_name, idx) values (%s, 'Projects', 'Module Def', 'items', 0, 'Forms', 'Timesheet', 'Timesheet', 2)""", make_autoname('MDI.#####')) - + if not sql("select name from `tabModule Def Item` where parent='Projects' and doc_name='Projects'"): - sql("""insert into `tabModule Def Item` - (name, parent, parenttype, parentfield, docstatus, doc_type, doc_name, display_name, idx) values + sql("""insert into `tabModule Def Item` + (name, parent, parenttype, parentfield, docstatus, doc_type, doc_name, display_name, idx) values (%s, 'Projects', 'Module Def', 'items', 0, 'Pages', 'Projects', 'Gantt Chart', 1)""", make_autoname('MDI.#####')) - + elif patch_no == 59: webnotes.conn.set_value('Control Panel',None,'mail_footer','') webnotes.conn.set_global('global_mail_footer','
Sent via ERPNext
') @@ -160,16 +160,16 @@ def execute(patch_no): sql("delete from `tabTDS Category Account` where company not in (select name from tabCompany)") elif patch_no == 62: # Import Supplier Quotation - + import_from_files(record_list=[['srm','doctype','supplier_quotation']]) # Adding Status Filter sql("update tabDocType set search_fields = concat('status,',search_fields) where name IN ('Delivery Note','Leave Transaction')") # Import Other Charges - + import_from_files(record_list=[['setup','doctype','other_charges']]) elif patch_no == 63: sql("update `tabDocField` set permlevel = 1 where fieldname in ('return_date', 'return_details') and parent = 'Sales and Purchase Return Wizard'") - + import_from_files(record_list = [['accounts', 'doctype', 'rv_detail'], ['material_management', 'doctype', 'sales_and_purchase_return_wizard'], ['material_management', 'doctype', 'stock_entry']]) elif patch_no == 64: sql("update tabDocField set `hidden` = 1, `print_hide` = 1, `report_hide` = 1 where options in ('RFQ','Supplier Quotation')") @@ -183,7 +183,7 @@ def execute(patch_no): import webnotes webnotes.conn.set_global("system_message", """

UI Updates

Based on user feedback, we have made a couple of changes in the UI:
  • Sidebar menus are now collapsable
  • Forms are now scrollable (we removed the confusing tabs)
  • Feed is a lot more descriptive
Do send us your feedback!""") webnotes.conn.set_global("system_message_id", "4") - + sql("update `tabModule Def Item` set doc_type = 'Setup Forms' where doc_name in ('TDS Payment', 'TDS Return Acknowledgement', 'Form 16A', 'Period Closing Voucher', 'IT Checklist')") from webnotes.session_cache import clear_cache clear_cache(webnotes.session['user']) @@ -212,7 +212,7 @@ def execute(patch_no): for d in fld_map: emp_obj.doc.fields[d] = prof_obj.doc.fields[d] emp_obj.doc.current_accommodation_type = prof_obj.doc.present_accommodation_type - + # address per_addr = cstr(e[2]) + '\n' + cstr(e[3]) + '\n' + cstr(e[4]) + '\n' + cstr(e[5]) + ', ' + cstr(e[6]) + '\n' + 'PIN - ' + cstr(e[7]) + '\n' + 'Ph. No' + cstr(e[8]) cur_addr = cstr(e[9]) + '\n' + cstr(e[10]) + '\n' + cstr(e[11]) + '\n' + cstr(e[12]) + ', ' + cstr(e[13]) + '\n' + 'PIN - ' + cstr(e[14]) + '\n' + 'Ph. No' + cstr(e[15]) @@ -244,7 +244,7 @@ def execute(patch_no): elif patch_no == 70: # update search criteria module -> System sql("update tabDocType set module='System' where name='Search Criteria'") - + # Cleanups to Contact sql("update tabDocField set fieldtype='Data' where options='Designation' and parent='Contact'") sql("update tabDocField set fieldtype='Data' where options='Department' and parent='Contact'") @@ -254,10 +254,10 @@ def execute(patch_no): from webnotes.modules.import_module import import_from_files import_from_files(record_list=[['tools','doctype','contact']]) - + # remove last_contact_date from Lead sql("delete from tabDocField where fieldname='last_contact_date' and parent='Lead'") - + elif patch_no == 71: # Make Stock Qty and Conversion Factor field editable. Also no need to mention Conversion factor in table can do it directly sql("update `tabDocField` set `permlevel` = 0, `width` = '100px', `trigger` = 'Client' where parent IN ('PO Detail','Purchase Receipt Detail') and fieldname in ('stock_qty','conversion_factor')") @@ -266,18 +266,18 @@ def execute(patch_no): elif patch_no == 72: # Core Patch # ---------- - + from webnotes.modules.import_module import import_from_files - + # import module def import_from_files(record_list = [['core', 'Module Def', 'Core']]) elif patch_no == 73: # set module in DocTypes sql("update tabDocType set module='Core' where name in ('DocType', 'DocField', 'DocPerm', 'Role', 'UserRole', 'Profile', 'Print Format', 'DocFormat', 'Control Panel', 'Event', 'Event Role', 'Event User', 'DefaultValue', 'Default Home Page', 'File', 'File Group', 'File Data', 'Letter Head', 'Module Def', 'Module Def Item', 'Module Def Role', 'Page', 'Page Role', 'Search Criteria', 'DocType Label', 'DocType Mapper', 'Field Mapper Detail', 'Table Mapper Detail')") - + # set module in Page sql("update tabPage set module='Core' where name='Login Page'") - + # move file browser to Tools sql("update tabPage set module='Tools' where name='File Browser'") sql("update tabDocType set module='Tools' where name='File Browser Control'") @@ -351,7 +351,7 @@ def execute(patch_no): p.add_permission('Salary Slip', 'Employee', 1, read = 1, match = 'owner') elif patch_no == 79: # Import Modules - + import_from_files(record_list=[['payroll','doctype','leave_application'],['payroll','doctype','leave_allocation'],['payroll','doctype','leave_control_panel'],['payroll','doctype','holiday_list'],['payroll','doctype','holiday_list_detail'],['payroll','Module Def','Payroll']]) elif patch_no == 80: # Holiday List @@ -405,7 +405,7 @@ def execute(patch_no): elif patch_no == 81: # Import Modules - + import_from_files(record_list=[['payroll','Module Def','Payroll']]) elif patch_no == 82: sql("update tabDocType set search_fields = 'employee,leave_type,total_leaves_allocated,fiscal_year' where name = 'Leave Allocation'") @@ -432,13 +432,13 @@ def execute(patch_no): sql("update tabDocPerm set `match` = '' where parent = 'Leave Application' and role = 'HR User'") elif patch_no == 86: # Import Modules - + import_from_files(record_list=[['payroll','doctype','leave_type']]) elif patch_no == 87: sql("update `tabLeave Type` set is_lwp = 1 where name = 'Leave Without Pay'") elif patch_no == 88: # Import Modules - + import_from_files(record_list=[['payroll','doctype','leave_allocation']]) elif patch_no == 89: sql("delete from `tabModule Def Item` where doc_type = 'Setup Forms' and doc_name in ('Payroll Rule', 'IT Checklist', 'Employee Profile') and parent = 'Payroll'") @@ -457,10 +457,10 @@ def execute(patch_no): sql("update `tabTable Mapper Detail` set validation_logic = 'qty > ifnull(billed_qty,0) and docstatus = 1' where parent = 'Sales Order-Receivable Voucher' and from_table = 'Sales Order Detail'") sql("update `tabField Mapper Detail` set from_field = 'customer' where to_field = 'customer' and parent = 'Sales Order-Receivable Voucher'") elif patch_no == 94: - + import_from_files(record_list=[['crm','doctype','sms_center']]) elif patch_no == 95: - + import_from_files(record_list=[['mapper','DocType Mapper','Sales Order-Receivable Voucher'], ['mapper','DocType Mapper','Delivery Note-Receivable Voucher']]) elif patch_no == 96: sql("delete from `tabModule Def Item` where doc_type = 'Reports' and display_name = 'Cenvat Credit - Input or Capital Goods' and parent = 'Accounts'") @@ -490,7 +490,7 @@ def execute(patch_no): elif patch_no == 103: sql("update tabDocField set fieldname = '' where fieldtype = 'HTML'") elif patch_no == 104: - + import_from_files(record_list=[['payroll','search_criteria','stdsrch_00001'],['payroll','search_criteria','stdsrch_00002'],['payroll','search_criteria','stdsrch_00003'],['payroll','Module Def','Payroll'],['payroll','doctype','leave_application'],['payroll','doctype','leave_allocation']]) elif patch_no == 105: # Employee Leave Balance @@ -535,7 +535,7 @@ def execute(patch_no): # patch for timesheet cleanup from webnotes.model import delete_doc delete_doc('DocType', 'Timesheet Detail') - + from webnotes.modules.import_module import import_from_files import_from_files(record_list = [['Projects', 'DocType', 'Timesheet'], ['Projects', 'DocType', 'Timesheet Detail'], ['Projects', 'DocType', 'Activity Type']]) @@ -543,7 +543,7 @@ def execute(patch_no): # again! from webnotes.model import delete_doc delete_doc('DocType', 'Timesheet Detail') - + from webnotes.modules.import_module import import_from_files import_from_files(record_list = [['Projects', 'DocType', 'Timesheet Detail']]) elif patch_no == 117: @@ -646,13 +646,13 @@ def execute(patch_no): elif patch_no == 142: # fixes to letter head and personalize from webnotes.model import delete_doc - + delete_doc('DocType', 'Batch Settings') delete_doc('DocType', 'Batch Settings Detail') delete_doc('DocType', 'Social Badge') delete_doc('Page', 'Personalize Page') delete_doc('DocType', 'Personalize Page Control') - + import_from_files(record_list=[['core','doctype','letter_head'], ['setup','doctype','personalize']]) elif patch_no == 144: webnotes.conn.sql("update tabDocField set fieldtype='Code' where parent='Letter Head' and fieldname='content'") @@ -917,7 +917,7 @@ def execute(patch_no): reload_doc('knowledge_base', 'page', 'questions') reload_doc('knowledge_base', 'Module Def', 'Knowledge Base') sql("update `tabModule Def` set disabled='No' where name='Knowledge Base'") - elif patch_no == 229: + elif patch_no == 229: reload_doc('knowledge_base', 'page', 'question_view') elif patch_no == 230: reload_doc('srm', 'doctype', 'indent') @@ -933,7 +933,7 @@ def execute(patch_no): elif patch_no == 234: sql("update `tabTable Mapper Detail` set validation_logic = 'docstatus=1' where parent = 'Sales Order-Indent' and from_table = 'Sales Order Detail'") elif patch_no == 235: - for sc in sql("""select name from `tabSearch Criteria` where ifnull(name,'') + for sc in sql("""select name from `tabSearch Criteria` where ifnull(name,'') like 'srch%' or ifnull(name,'') like '%stdsrch'"""): try: get_obj('Search Criteria', sc[0]).rename() @@ -951,7 +951,7 @@ def execute(patch_no): elif patch_no == 239: reload_doc('core', 'doctype', 'docfield') reload_doc('core', 'doctype', 'doctype') - + from patches.feed_patch import set_subjects_and_tagfields set_subjects_and_tagfields() elif patch_no == 240: @@ -1026,7 +1026,7 @@ def execute(patch_no): sql("update `tabItem` set description_html = replace(description_html, 'http://46.4.50.84/v170-test/', '')") elif patch_no == 257: from patches.customer_address import run_old_data_sync_patch - run_old_data_sync_patch() + run_old_data_sync_patch() elif patch_no == 258: sql("update tabDocField set `default`=NULL where fieldname = 'naming_series'") elif patch_no == 259: @@ -1050,7 +1050,7 @@ def execute(patch_no): elif patch_no == 263: ol = ['','Open','To Reply','Waiting for Customer','Hold','Closed'] sql("update tabDocField set options=%s where parent=%s and fieldname=%s", ('\n'.join(ol), 'Support Ticket', 'status')) - elif patch_no == 264: + elif patch_no == 264: sql("delete from tabDocField where parent = 'Customer Issue' and (fieldname = 'issue_in' or fieldname = 'issue_category')") sql("update tabDocField set options=NULL where parent='Support Ticket' and label = 'Send'") elif patch_no == 266: @@ -1077,12 +1077,12 @@ def execute(patch_no): reload_doc('crm','doctype','sales_order') reload_doc('material_management','doctype','delivery_note') sql("delete from tabDocField where fieldname='per_amt_billed' and parent in ('Sales Order', 'Delivery Note')") - - sql("""update `tabSales Order` set delivery_status = if(ifnull(per_delivered,0) < 0.001, 'Not Delivered', + + sql("""update `tabSales Order` set delivery_status = if(ifnull(per_delivered,0) < 0.001, 'Not Delivered', if(per_delivered >= 99.99, 'Fully Delivered', 'Partly Delivered'))""") - sql("""update `tabSales Order` set billing_status = if(ifnull(per_billed,0) < 0.001, 'Not Billed', + sql("""update `tabSales Order` set billing_status = if(ifnull(per_billed,0) < 0.001, 'Not Billed', if(per_billed >= 99.99, 'Fully Billed', 'Partly Billed'))""") - sql("""update `tabDelivery Note` set billing_status = if(ifnull(per_billed,0) < 0.001, 'Not Billed', + sql("""update `tabDelivery Note` set billing_status = if(ifnull(per_billed,0) < 0.001, 'Not Billed', if(per_billed >= 99.99, 'Fully Billed', 'Partly Billed'))""") elif patch_no == 272: from webnotes.model import delete_doc @@ -1116,7 +1116,7 @@ def execute(patch_no): rec = sql("select voucher_type, voucher_no, ifnull(is_cancelled, 'No') from `tab%s` where modified >= '2011-06-15 01:00:00' group by voucher_no" % t) for d in rec: sql("update `tab%s` set docstatus = %s where name = '%s'" % (d[0], d[2]=='No' and 1 or 2, d[1])) - + other_dt = ['Enquiry', 'Quotation', 'Sales Order', 'Indent', 'Purchase Order', 'Production Order', 'Customer Issue', 'Installation Note'] for dt in other_dt: rec = sql("select name, status from `tab%s` where modified >= '2011-06-15 01:00:00'" % dt) @@ -1151,9 +1151,9 @@ def execute(patch_no): reload_doc('accounts', 'doctype', 'payable_voucher') elif patch_no == 289: sql("update `tabDocType` set subject = 'From %(supplier_name)s worth %(grand_total)s due on %(due_date)s | %(outstanding_amount)s outstanding' where name = 'Payable Voucher'") - sql("update `tabDocType` set search_fields = 'status,transaction_date,customer,lead,order_type' where name = 'Quotation'") + sql("update `tabDocType` set search_fields = 'status,transaction_date,customer,lead,order_type' where name = 'Quotation'") elif patch_no == 290: - count = sql("""SELECT * FROM `tabModule Def` + count = sql("""SELECT * FROM `tabModule Def` WHERE `module_name` LIKE 'Home'""") if not count: md = Document('Module Def') @@ -1236,14 +1236,14 @@ def execute(patch_no): rec = sql("select voucher_type, voucher_no, ifnull(is_cancelled, 'No') from `tab%s` where modified >= '2011-07-06 10:00:00' group by voucher_no" % t) for d in rec: sql("update `tab%s` set docstatus = %s where name = '%s'" % (d[0], d[2]=='No' and 1 or 2, d[1])) - + other_dt = ['Enquiry', 'Quotation', 'Sales Order', 'Indent', 'Purchase Order', 'Production Order', 'Customer Issue', 'Installation Note'] for dt in other_dt: rec = sql("select name, status from `tab%s` where modified >= '2011-07-06 10:00:00'" % dt) for r in rec: sql("update `tab%s` set docstatus = %s where name = '%s'" % (dt, (r[1] in ['Submitted', 'Closed'] and 1 or r[1]=='Cancelled' and 2 or 0), r[0])) - - + + dt_list = ['Delivery Note', 'Purchase Receipt'] for dt in dt_list: sql("update `tab%s` set status = 'Submitted' where docstatus = 1 and modified >='2011-07-06 10:00:00'" % dt) @@ -1254,7 +1254,7 @@ def execute(patch_no): tbl = sql("select options from `tabDocField` where fieldtype = 'Table' and parent = '%s'" % d) for t in tbl: sql("update `tab%s` t1, `tab%s` t2 set t1.docstatus = t2.docstatus where t1.parent = t2.name" % (t[0], d)) - + elif patch_no == 314: # delete double feed sql("delete from tabFeed where subject like 'New %'") @@ -1273,7 +1273,7 @@ def execute(patch_no): elif patch_no == 316: pass elif patch_no == 317: - sql("update `tabPage` set name = 'profile-settings' where page_name = 'Profile Settings'") + sql("update `tabPage` set name = 'profile-settings' where page_name = 'Profile Settings'") elif patch_no == 318: reload_doc('utilities', 'doctype', 'bulk_rename_tool') elif patch_no == 319: @@ -1300,7 +1300,7 @@ def execute(patch_no): elif patch_no == 327: # patch for support email settings now moved to email settings reload_doc('setup','doctype','email_settings') - + # map fields from support to email settings field_map = { 'support_email': 'email', @@ -1311,11 +1311,11 @@ def execute(patch_no): 'sync_support_mails': 'integrate_incoming', 'signature': 'support_signature' } - + for key in field_map: webnotes.conn.set_value('Email Settings',None,key, \ webnotes.conn.get_value('Support Email Settings',None,field_map[key])) - + # delete support email settings from webnotes.model import delete_doc delete_doc('DocType', 'Support Email Settings') @@ -1328,3 +1328,14 @@ def execute(patch_no): elif patch_no == 329: reload_doc('utilities', 'doctype', 'rename_tool') reload_doc('utilities', 'doctype', 'bulk_rename_tool') + elif patch_no == 330: + reload_doc('accounts', 'doctype', 'lease_agreement') + reload_doc('accounts', 'doctype', 'lease_installment') + + reload_doc('accounts', 'search_criteria', 'lease_agreement_list') + reload_doc('accounts', 'search_criteria', 'lease_monthly_future_installment_inflows') + reload_doc('accounts', 'search_criteria', 'lease_overdue_age_wise') + reload_doc('accounts', 'search_criteria', 'lease_overdue_list') + reload_doc('accounts', 'search_criteria', 'lease_receipts_client_wise') + reload_doc('accounts', 'search_criteria', 'lease_receipt_summary_year_to_date') + reload_doc('accounts', 'search_criteria', 'lease_yearly_future_installment_inflows') From bcdade51e312720ceb2ac3246a64dfebbae61999 Mon Sep 17 00:00:00 2001 From: Brahma K Date: Wed, 27 Jul 2011 12:11:09 +0530 Subject: [PATCH 15/24] Added Accounts Module Def --- patches/patch.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/patches/patch.py b/patches/patch.py index f5479191d2..bd726e53ea 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1339,3 +1339,5 @@ def execute(patch_no): reload_doc('accounts', 'search_criteria', 'lease_receipts_client_wise') reload_doc('accounts', 'search_criteria', 'lease_receipt_summary_year_to_date') reload_doc('accounts', 'search_criteria', 'lease_yearly_future_installment_inflows') + + reload_doc('accounts', 'Module Def', 'Accounts') From c95e6f6788b6185cc511add4b5bbb41b23ac1c5f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 27 Jul 2011 12:38:45 +0530 Subject: [PATCH 16/24] txt file removed from .gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index e9c8fc6687..56149a0d5d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ *.pyc *.comp.js -*.txt .DS_Store server_tools patch.log From a71160ebcc07f9168b3dddc5da5c3273cf278ff7 Mon Sep 17 00:00:00 2001 From: Brahma K Date: Wed, 27 Jul 2011 12:43:48 +0530 Subject: [PATCH 17/24] Added .txt in gitignore and added text files --- .../lease_agreement/lease_agreement.txt | 289 ++++++++++++++++++ .../lease_installment/lease_installment.txt | 91 ++++++ .../lease_agreement_list.txt | 30 ++ ...ase_monthly_future_installment_inflows.txt | 30 ++ .../lease_over_due_list.txt | 30 ++ .../lease_overdue_age_wise.txt | 30 ++ .../lease_receipt_summary_year_to_date.txt | 33 ++ .../lease_receipts_client_wise.txt | 30 ++ ...ease_yearly_future_installment_inflows.txt | 30 ++ 9 files changed, 593 insertions(+) create mode 100644 accounts/doctype/lease_agreement/lease_agreement.txt create mode 100644 accounts/doctype/lease_installment/lease_installment.txt create mode 100644 accounts/search_criteria/lease_agreement_list/lease_agreement_list.txt create mode 100644 accounts/search_criteria/lease_monthly_future_installment_inflows/lease_monthly_future_installment_inflows.txt create mode 100644 accounts/search_criteria/lease_over_due_list/lease_over_due_list.txt create mode 100644 accounts/search_criteria/lease_overdue_age_wise/lease_overdue_age_wise.txt create mode 100644 accounts/search_criteria/lease_receipt_summary_year_to_date/lease_receipt_summary_year_to_date.txt create mode 100644 accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.txt create mode 100644 accounts/search_criteria/lease_yearly_future_installment_inflows/lease_yearly_future_installment_inflows.txt diff --git a/accounts/doctype/lease_agreement/lease_agreement.txt b/accounts/doctype/lease_agreement/lease_agreement.txt new file mode 100644 index 0000000000..6fe06bf2f4 --- /dev/null +++ b/accounts/doctype/lease_agreement/lease_agreement.txt @@ -0,0 +1,289 @@ +# DocType, Lease Agreement +[ + + # These values are common in all dictionaries + { + 'creation': '2011-07-22 17:47:57', + 'docstatus': 0, + 'modified': '2011-07-25 06:36:04', + 'modified_by': 'Administrator', + 'owner': 'Administrator' + }, + + # These values are common for all DocType + { + '_last_update': '1311348373', + 'colour': 'White:FFF', + 'doctype': 'DocType', + 'module': 'Accounts', + 'name': '__common__', + 'section_style': 'Simple', + 'show_in_menu': 0, + 'version': 19 + }, + + # These values are common for all DocField + { + 'doctype': 'DocField', + 'name': '__common__', + 'parent': 'Lease Agreement', + 'parentfield': 'fields', + 'parenttype': 'DocType' + }, + + # These values are common for all DocPerm + { + 'doctype': 'DocPerm', + 'name': '__common__', + 'parent': 'Lease Agreement', + 'parentfield': 'permissions', + 'parenttype': 'DocType', + 'read': 1, + 'role': 'Accounts User' + }, + + # DocType, Lease Agreement + { + 'doctype': 'DocType', + 'name': 'Lease Agreement' + }, + + # DocPerm + { + 'cancel': 1, + 'create': 1, + 'doctype': 'DocPerm', + 'idx': 1, + 'permlevel': 0, + 'submit': 1, + 'write': 1 + }, + + # DocPerm + { + 'doctype': 'DocPerm', + 'idx': 2, + 'permlevel': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'naming_series', + 'fieldtype': 'Select', + 'idx': 1, + 'label': 'Naming Series', + 'options': '\nLA', + 'permlevel': 0, + 'reqd': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldtype': 'Section Break', + 'idx': 2, + 'label': 'Lessee Info.', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'account', + 'fieldtype': 'Link', + 'idx': 3, + 'label': 'Account', + 'options': 'Account', + 'permlevel': 0, + 'reqd': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'lessee_father', + 'fieldtype': 'Data', + 'idx': 4, + 'label': 'Lessee Father', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'lessee_nic', + 'fieldtype': 'Data', + 'idx': 5, + 'label': 'Lessee NIC', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'lessee_contact', + 'fieldtype': 'Data', + 'idx': 6, + 'label': 'Lessee Contact', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'lessee_address', + 'fieldtype': 'Text', + 'idx': 7, + 'label': 'Lessee Address', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldtype': 'Section Break', + 'idx': 8, + 'label': 'Vehicle Info.', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'model_no', + 'fieldtype': 'Data', + 'idx': 9, + 'label': 'Model No', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'engine_no', + 'fieldtype': 'Data', + 'idx': 10, + 'label': 'Engine No', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'chassis_no', + 'fieldtype': 'Data', + 'idx': 11, + 'label': 'Chassis No', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldtype': 'Section Break', + 'idx': 12, + 'label': 'Invoice and Payment Info.', + 'permlevel': 0 + }, + + # DocField + { + 'colour': 'White:FFF', + 'doctype': 'DocField', + 'fieldname': 'invoice', + 'fieldtype': 'Link', + 'idx': 13, + 'label': 'Invoice', + 'options': 'Receivable Voucher', + 'permlevel': 0, + 'reqd': 1, + 'trigger': 'Client' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'invoice_amount', + 'fieldtype': 'Currency', + 'idx': 14, + 'label': 'Invoice Amount', + 'permlevel': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'down_payment', + 'fieldtype': 'Currency', + 'idx': 15, + 'label': 'Down Payment', + 'permlevel': 0, + 'reqd': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'start_date', + 'fieldtype': 'Date', + 'idx': 16, + 'label': 'Start Date', + 'permlevel': 0, + 'reqd': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'no_of_installments', + 'fieldtype': 'Int', + 'idx': 17, + 'label': 'No of Installments', + 'permlevel': 0, + 'reqd': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'installment_amount', + 'fieldtype': 'Currency', + 'idx': 18, + 'label': 'Installment Amount', + 'permlevel': 0 + }, + + # DocField + { + 'colour': 'White:FFF', + 'doctype': 'DocField', + 'fieldtype': 'Button', + 'idx': 19, + 'label': 'Generate', + 'permlevel': 0, + 'trigger': 'Client' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'installments', + 'fieldtype': 'Table', + 'idx': 20, + 'label': 'Installments', + 'options': 'Lease Installment', + 'permlevel': 0 + }, + + # DocField + { + 'allow_on_submit': 1, + 'colour': 'White:FFF', + 'doctype': 'DocField', + 'fieldtype': 'Button', + 'idx': 21, + 'label': 'Installment Reciept', + 'permlevel': 0 + } +] \ No newline at end of file diff --git a/accounts/doctype/lease_installment/lease_installment.txt b/accounts/doctype/lease_installment/lease_installment.txt new file mode 100644 index 0000000000..2434a786b0 --- /dev/null +++ b/accounts/doctype/lease_installment/lease_installment.txt @@ -0,0 +1,91 @@ +# DocType, Lease Installment +[ + + # These values are common in all dictionaries + { + 'creation': '2011-07-22 17:49:33', + 'docstatus': 0, + 'modified': '2011-07-22 17:49:33', + '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': 5 + }, + + # These values are common for all DocField + { + 'doctype': 'DocField', + 'name': '__common__', + 'parent': 'Lease Installment', + 'parentfield': 'fields', + 'parenttype': 'DocType' + }, + + # DocType, Lease Installment + { + 'doctype': 'DocType', + 'name': 'Lease Installment' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'amount', + 'fieldtype': 'Currency', + 'idx': 1, + 'label': 'Amount', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'due_date', + 'fieldtype': 'Date', + 'idx': 2, + 'label': 'Due Date', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'cheque_number', + 'fieldtype': 'Data', + 'idx': 3, + 'label': 'Cheque Number', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'cheque_date', + 'fieldtype': 'Date', + 'idx': 4, + 'label': 'Cheque Date', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'jv_number', + 'fieldtype': 'Link', + 'hidden': 0, + 'idx': 5, + 'label': 'JV Number', + 'options': 'Journal Voucher', + 'permlevel': 1 + } +] \ No newline at end of file diff --git a/accounts/search_criteria/lease_agreement_list/lease_agreement_list.txt b/accounts/search_criteria/lease_agreement_list/lease_agreement_list.txt new file mode 100644 index 0000000000..77e46338d5 --- /dev/null +++ b/accounts/search_criteria/lease_agreement_list/lease_agreement_list.txt @@ -0,0 +1,30 @@ +# Search Criteria, lease_agreement_list +[ + + # These values are common in all dictionaries + { + 'creation': '2011-07-26 17:01:34', + 'docstatus': 0, + 'modified': '2011-07-26 18:25:54', + 'modified_by': 'Administrator', + 'owner': 'Administrator' + }, + + # These values are common for all Search Criteria + { + 'columns': 'GL Entry\x01ID,GL Entry\x01Owner,GL Entry\x01Posting Date,GL Entry\x01Aging Date,GL Entry\x01Account,GL Entry\x01Cost Center,GL Entry\x01Against,GL Entry\x01Against Voucher,GL Entry\x01Voucher Type,GL Entry\x01Voucher No,GL Entry\x01Remarks,GL Entry\x01Is Cancelled,GL Entry\x01Is Opening,GL Entry\x01Fiscal Year,GL Entry\x01Company', + 'criteria_name': 'Lease Agreement List', + 'doc_type': 'GL Entry', + 'doctype': 'Search Criteria', + 'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}", + 'module': 'Accounts', + 'name': '__common__', + 'standard': 'Yes' + }, + + # Search Criteria, lease_agreement_list + { + 'doctype': 'Search Criteria', + 'name': 'lease_agreement_list' + } +] \ No newline at end of file diff --git a/accounts/search_criteria/lease_monthly_future_installment_inflows/lease_monthly_future_installment_inflows.txt b/accounts/search_criteria/lease_monthly_future_installment_inflows/lease_monthly_future_installment_inflows.txt new file mode 100644 index 0000000000..3a41f8feee --- /dev/null +++ b/accounts/search_criteria/lease_monthly_future_installment_inflows/lease_monthly_future_installment_inflows.txt @@ -0,0 +1,30 @@ +# Search Criteria, lease_monthly_future_installment_inflows +[ + + # These values are common in all dictionaries + { + 'creation': '2011-07-26 16:45:07', + 'docstatus': 0, + 'modified': '2011-07-26 18:26:16', + 'modified_by': 'Administrator', + 'owner': 'Administrator' + }, + + # These values are common for all Search Criteria + { + 'columns': 'GL Entry\x01ID,GL Entry\x01Owner,GL Entry\x01Posting Date,GL Entry\x01Aging Date,GL Entry\x01Account,GL Entry\x01Cost Center,GL Entry\x01Against,GL Entry\x01Against Voucher,GL Entry\x01Voucher Type,GL Entry\x01Voucher No,GL Entry\x01Remarks,GL Entry\x01Is Cancelled,GL Entry\x01Is Opening,GL Entry\x01Fiscal Year,GL Entry\x01Company', + 'criteria_name': 'Lease Monthly Future Installment Inflows', + 'doc_type': 'GL Entry', + 'doctype': 'Search Criteria', + 'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}", + 'module': 'Accounts', + 'name': '__common__', + 'standard': 'Yes' + }, + + # Search Criteria, lease_monthly_future_installment_inflows + { + 'doctype': 'Search Criteria', + 'name': 'lease_monthly_future_installment_inflows' + } +] \ No newline at end of file diff --git a/accounts/search_criteria/lease_over_due_list/lease_over_due_list.txt b/accounts/search_criteria/lease_over_due_list/lease_over_due_list.txt new file mode 100644 index 0000000000..22bdc55d54 --- /dev/null +++ b/accounts/search_criteria/lease_over_due_list/lease_over_due_list.txt @@ -0,0 +1,30 @@ +# Search Criteria, lease_over_due_list +[ + + # These values are common in all dictionaries + { + 'creation': '2011-07-26 18:11:47', + 'docstatus': 0, + 'modified': '2011-07-26 18:27:01', + 'modified_by': 'Administrator', + 'owner': 'Administrator' + }, + + # These values are common for all Search Criteria + { + 'columns': 'GL Entry\x01ID,GL Entry\x01Owner,GL Entry\x01Posting Date,GL Entry\x01Aging Date,GL Entry\x01Account,GL Entry\x01Cost Center,GL Entry\x01Against,GL Entry\x01Against Voucher,GL Entry\x01Voucher Type,GL Entry\x01Voucher No,GL Entry\x01Remarks,GL Entry\x01Is Cancelled,GL Entry\x01Is Opening,GL Entry\x01Fiscal Year,GL Entry\x01Company', + 'criteria_name': 'Lease Over Due List', + 'doc_type': 'GL Entry', + 'doctype': 'Search Criteria', + 'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}", + 'module': 'Accounts', + 'name': '__common__', + 'standard': 'Yes' + }, + + # Search Criteria, lease_over_due_list + { + 'doctype': 'Search Criteria', + 'name': 'lease_over_due_list' + } +] \ No newline at end of file diff --git a/accounts/search_criteria/lease_overdue_age_wise/lease_overdue_age_wise.txt b/accounts/search_criteria/lease_overdue_age_wise/lease_overdue_age_wise.txt new file mode 100644 index 0000000000..d8e935bca1 --- /dev/null +++ b/accounts/search_criteria/lease_overdue_age_wise/lease_overdue_age_wise.txt @@ -0,0 +1,30 @@ +# Search Criteria, lease_overdue_age_wise +[ + + # These values are common in all dictionaries + { + 'creation': '2011-07-26 18:11:10', + 'docstatus': 0, + 'modified': '2011-07-26 18:26:40', + 'modified_by': 'Administrator', + 'owner': 'Administrator' + }, + + # These values are common for all Search Criteria + { + 'columns': 'GL Entry\x01ID,GL Entry\x01Owner,GL Entry\x01Posting Date,GL Entry\x01Aging Date,GL Entry\x01Account,GL Entry\x01Cost Center,GL Entry\x01Against,GL Entry\x01Against Voucher,GL Entry\x01Voucher Type,GL Entry\x01Voucher No,GL Entry\x01Remarks,GL Entry\x01Is Cancelled,GL Entry\x01Is Opening,GL Entry\x01Fiscal Year,GL Entry\x01Company', + 'criteria_name': 'Lease Overdue Age Wise', + 'doc_type': 'GL Entry', + 'doctype': 'Search Criteria', + 'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}", + 'module': 'Accounts', + 'name': '__common__', + 'standard': 'Yes' + }, + + # Search Criteria, lease_overdue_age_wise + { + 'doctype': 'Search Criteria', + 'name': 'lease_overdue_age_wise' + } +] \ No newline at end of file diff --git a/accounts/search_criteria/lease_receipt_summary_year_to_date/lease_receipt_summary_year_to_date.txt b/accounts/search_criteria/lease_receipt_summary_year_to_date/lease_receipt_summary_year_to_date.txt new file mode 100644 index 0000000000..04f16bb0cd --- /dev/null +++ b/accounts/search_criteria/lease_receipt_summary_year_to_date/lease_receipt_summary_year_to_date.txt @@ -0,0 +1,33 @@ +# Search Criteria, lease_receipt_summary_year_to_date +[ + + # These values are common in all dictionaries + { + 'creation': '2011-07-26 18:06:32', + 'docstatus': 0, + 'modified': '2011-07-26 18:27:43', + 'modified_by': 'Administrator', + 'owner': 'Administrator' + }, + + # These values are common for all Search Criteria + { + 'columns': 'GL Entry\x01ID,GL Entry\x01Owner,GL Entry\x01Posting Date,GL Entry\x01Aging Date,GL Entry\x01Account,GL Entry\x01Cost Center,GL Entry\x01Against,GL Entry\x01Against Voucher,GL Entry\x01Voucher Type,GL Entry\x01Voucher No,GL Entry\x01Remarks,GL Entry\x01Is Cancelled,GL Entry\x01Is Opening,GL Entry\x01Fiscal Year,GL Entry\x01Company', + 'criteria_name': 'Lease Receipt Summary (Year to date)', + 'doc_type': 'GL Entry', + 'doctype': 'Search Criteria', + 'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}", + 'module': 'Accounts', + 'name': '__common__', + 'page_len': 50, + 'sort_by': '`tabGL Entry`.`company`', + 'sort_order': 'DESC', + 'standard': 'Yes' + }, + + # Search Criteria, lease_receipt_summary_year_to_date + { + 'doctype': 'Search Criteria', + 'name': 'lease_receipt_summary_year_to_date' + } +] \ No newline at end of file diff --git a/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.txt b/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.txt new file mode 100644 index 0000000000..69795df882 --- /dev/null +++ b/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.txt @@ -0,0 +1,30 @@ +# Search Criteria, lease_receipts_client_wise +[ + + # These values are common in all dictionaries + { + 'creation': '2011-07-26 18:12:22', + 'docstatus': 0, + 'modified': '2011-07-26 18:27:18', + 'modified_by': 'Administrator', + 'owner': 'Administrator' + }, + + # These values are common for all Search Criteria + { + 'columns': 'GL Entry\x01ID,GL Entry\x01Owner,GL Entry\x01Posting Date,GL Entry\x01Aging Date,GL Entry\x01Account,GL Entry\x01Cost Center,GL Entry\x01Against,GL Entry\x01Against Voucher,GL Entry\x01Voucher Type,GL Entry\x01Voucher No,GL Entry\x01Remarks,GL Entry\x01Is Cancelled,GL Entry\x01Is Opening,GL Entry\x01Fiscal Year,GL Entry\x01Company', + 'criteria_name': 'Lease Receipts Client wise', + 'doc_type': 'GL Entry', + 'doctype': 'Search Criteria', + 'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}", + 'module': 'Accounts', + 'name': '__common__', + 'standard': 'Yes' + }, + + # Search Criteria, lease_receipts_client_wise + { + 'doctype': 'Search Criteria', + 'name': 'lease_receipts_client_wise' + } +] \ No newline at end of file diff --git a/accounts/search_criteria/lease_yearly_future_installment_inflows/lease_yearly_future_installment_inflows.txt b/accounts/search_criteria/lease_yearly_future_installment_inflows/lease_yearly_future_installment_inflows.txt new file mode 100644 index 0000000000..6e14165bd4 --- /dev/null +++ b/accounts/search_criteria/lease_yearly_future_installment_inflows/lease_yearly_future_installment_inflows.txt @@ -0,0 +1,30 @@ +# Search Criteria, lease_yearly_future_installment_inflows +[ + + # These values are common in all dictionaries + { + 'creation': '2011-07-26 16:24:45', + 'docstatus': 0, + 'modified': '2011-07-26 18:28:03', + 'modified_by': 'Administrator', + 'owner': 'Administrator' + }, + + # These values are common for all Search Criteria + { + 'columns': 'GL Entry\x01ID,GL Entry\x01Owner,GL Entry\x01Posting Date,GL Entry\x01Aging Date,GL Entry\x01Account,GL Entry\x01Cost Center,GL Entry\x01Against,GL Entry\x01Against Voucher,GL Entry\x01Voucher Type,GL Entry\x01Voucher No,GL Entry\x01Remarks,GL Entry\x01Is Cancelled,GL Entry\x01Is Opening,GL Entry\x01Fiscal Year,GL Entry\x01Company', + 'criteria_name': 'Lease Yearly Future Installment Inflows', + 'doc_type': 'GL Entry', + 'doctype': 'Search Criteria', + 'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}", + 'module': 'Accounts', + 'name': '__common__', + 'standard': 'Yes' + }, + + # Search Criteria, lease_yearly_future_installment_inflows + { + 'doctype': 'Search Criteria', + 'name': 'lease_yearly_future_installment_inflows' + } +] \ No newline at end of file From 3b1ebe0b24fef1eb0d86b7ec545a2316e68ecba6 Mon Sep 17 00:00:00 2001 From: Brahma K Date: Wed, 27 Jul 2011 13:04:11 +0530 Subject: [PATCH 18/24] Patch to give permission to Accounts Manager to Lease Agreement --- .../lease_agreement/lease_agreement.txt | 33 +++++++++++++++---- patches/patch.py | 5 +++ 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/accounts/doctype/lease_agreement/lease_agreement.txt b/accounts/doctype/lease_agreement/lease_agreement.txt index 6fe06bf2f4..1d35a10eb7 100644 --- a/accounts/doctype/lease_agreement/lease_agreement.txt +++ b/accounts/doctype/lease_agreement/lease_agreement.txt @@ -5,21 +5,21 @@ { 'creation': '2011-07-22 17:47:57', 'docstatus': 0, - 'modified': '2011-07-25 06:36:04', + 'modified': '2011-07-27 12:54:48', 'modified_by': 'Administrator', 'owner': 'Administrator' }, # These values are common for all DocType { - '_last_update': '1311348373', + '_last_update': '1311555967', 'colour': 'White:FFF', 'doctype': 'DocType', 'module': 'Accounts', 'name': '__common__', 'section_style': 'Simple', 'show_in_menu': 0, - 'version': 19 + 'version': 20 }, # These values are common for all DocField @@ -38,8 +38,7 @@ 'parent': 'Lease Agreement', 'parentfield': 'permissions', 'parenttype': 'DocType', - 'read': 1, - 'role': 'Accounts User' + 'read': 1 }, # DocType, Lease Agreement @@ -55,6 +54,7 @@ 'doctype': 'DocPerm', 'idx': 1, 'permlevel': 0, + 'role': 'Accounts User', 'submit': 1, 'write': 1 }, @@ -63,7 +63,28 @@ { 'doctype': 'DocPerm', 'idx': 2, - 'permlevel': 1 + 'permlevel': 1, + 'role': 'Accounts User' + }, + + # DocPerm + { + 'cancel': 1, + 'create': 1, + 'doctype': 'DocPerm', + 'idx': 3, + 'permlevel': 0, + 'role': 'Accounts Manager', + 'submit': 1, + 'write': 1 + }, + + # DocPerm + { + 'doctype': 'DocPerm', + 'idx': 4, + 'permlevel': 1, + 'role': 'Accounts Manager' }, # DocField diff --git a/patches/patch.py b/patches/patch.py index bd726e53ea..0ceb2a7b6d 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1341,3 +1341,8 @@ def execute(patch_no): reload_doc('accounts', 'search_criteria', 'lease_yearly_future_installment_inflows') reload_doc('accounts', 'Module Def', 'Accounts') + elif patch_no == 331: + p = get_obj('Patch Util') + # permission + p.add_permission('Lease Agreement', 'Accounts Manager', 0, read = 1, write=1,submit=1, cancel=1,amend=1) + p.add_permission('Lease Agreement', 'Accounts Manager', 1, read = 1) From 3085b1022412ab466af5fd394437681cfd1a138e Mon Sep 17 00:00:00 2001 From: Brahma K Date: Wed, 27 Jul 2011 13:08:11 +0530 Subject: [PATCH 19/24] Upload Account Transactions .txt added --- .../upload_accounts_transactions.txt | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 setup/doctype/upload_accounts_transactions/upload_accounts_transactions.txt diff --git a/setup/doctype/upload_accounts_transactions/upload_accounts_transactions.txt b/setup/doctype/upload_accounts_transactions/upload_accounts_transactions.txt new file mode 100644 index 0000000000..d637a886a6 --- /dev/null +++ b/setup/doctype/upload_accounts_transactions/upload_accounts_transactions.txt @@ -0,0 +1,126 @@ +# DocType, Upload Accounts Transactions +[ + + # These values are common in all dictionaries + { + 'creation': '2011-07-18 14:56:48', + 'docstatus': 0, + 'modified': '2011-07-19 12:19:13', + 'modified_by': 'Administrator', + 'owner': 'Administrator' + }, + + # These values are common for all DocType + { + '_last_update': '1310985428', + 'allow_attach': 1, + 'colour': 'White:FFF', + 'doctype': 'DocType', + 'issingle': 1, + 'max_attachments': 1, + 'module': 'Setup', + 'name': '__common__', + 'section_style': 'Simple', + 'show_in_menu': 1, + 'version': 5 + }, + + # These values are common for all DocField + { + 'doctype': 'DocField', + 'name': '__common__', + 'parent': 'Upload Accounts Transactions', + 'parentfield': 'fields', + 'parenttype': 'DocType', + 'permlevel': 0 + }, + + # These values are common for all DocPerm + { + 'cancel': 1, + 'create': 1, + 'doctype': 'DocPerm', + 'execute': 1, + 'idx': 1, + 'name': '__common__', + 'parent': 'Upload Accounts Transactions', + 'parentfield': 'permissions', + 'parenttype': 'DocType', + 'permlevel': 0, + 'read': 1, + 'role': 'Accounts Manager', + 'submit': 1, + 'write': 1 + }, + + # DocType, Upload Accounts Transactions + { + 'doctype': 'DocType', + 'name': 'Upload Accounts Transactions' + }, + + # DocPerm + { + 'doctype': 'DocPerm' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldtype': 'HTML', + 'idx': 1, + 'label': 'Usage', + 'options': '
\nUpload Account Transactions Help\n

To update the account transactions, upload a CSV file with five columns Date, Transaction Number, Account Name, Credit and Debit amount and click on the "Upload Account Transactions" button. The system will add the transactions.\n

' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'fiscal_year', + 'fieldtype': 'Link', + 'idx': 2, + 'label': 'Fiscal Year', + 'options': 'Fiscal Year', + 'reqd': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'company', + 'fieldtype': 'Link', + 'idx': 3, + 'label': 'Company', + 'options': 'Company', + 'reqd': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'default_cost_center', + 'fieldtype': 'Link', + 'idx': 4, + 'label': 'Default Cost Center', + 'options': 'Cost Center', + 'reqd': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'file_list', + 'fieldtype': 'Small Text', + 'hidden': 1, + 'idx': 5, + 'label': 'File List' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldtype': 'Button', + 'idx': 6, + 'label': 'Upload Accounts Transactions' + } +] \ No newline at end of file From a74f12a982df8b8d72140ffe1fc0579ea767e9b6 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 27 Jul 2011 13:11:39 +0530 Subject: [PATCH 20/24] salary slip restored --- hr/doctype/salary_slip/salary_slip.txt | 602 +++++++++++++++++++++++++ patches/erpnext_structure_cleanup.py | 2 +- 2 files changed, 603 insertions(+), 1 deletion(-) create mode 100644 hr/doctype/salary_slip/salary_slip.txt diff --git a/hr/doctype/salary_slip/salary_slip.txt b/hr/doctype/salary_slip/salary_slip.txt new file mode 100644 index 0000000000..423b6c03d8 --- /dev/null +++ b/hr/doctype/salary_slip/salary_slip.txt @@ -0,0 +1,602 @@ +# DocType, Salary Slip +[ + + # These values are common in all dictionaries + { + 'creation': '2010-08-08 17:09:20', + 'docstatus': 0, + 'modified': '2011-07-27 13:10:28', + 'modified_by': 'Administrator', + 'owner': 'Administrator' + }, + + # These values are common for all DocType + { + '_last_update': '1310019491', + 'colour': 'White:FFF', + 'doctype': 'DocType', + 'module': 'HR', + 'name': '__common__', + 'section_style': 'Simple', + 'server_code_error': ' ', + 'show_in_menu': 0, + 'subject': 'For %(employee_name)s, %(designation)s', + 'version': 393 + }, + + # These values are common for all DocField + { + 'doctype': 'DocField', + 'name': '__common__', + 'parent': 'Salary Slip', + 'parentfield': 'fields', + 'parenttype': 'DocType' + }, + + # These values are common for all DocPerm + { + 'doctype': 'DocPerm', + 'name': '__common__', + 'parent': 'Salary Slip', + 'parentfield': 'permissions', + 'parenttype': 'DocType', + 'read': 1 + }, + + # DocType, Salary Slip + { + 'doctype': 'DocType', + 'name': 'Salary Slip' + }, + + # DocPerm + { + 'amend': 0, + 'cancel': 0, + 'create': 0, + 'doctype': 'DocPerm', + 'idx': 1, + 'match': 'owner', + 'permlevel': 0, + 'role': 'Employee', + 'submit': 0, + 'write': 0 + }, + + # DocPerm + { + 'amend': 0, + 'create': 1, + 'doctype': 'DocPerm', + 'idx': 2, + 'permlevel': 0, + 'role': 'HR User', + 'submit': 1, + 'write': 1 + }, + + # DocPerm + { + 'amend': 1, + 'cancel': 1, + 'create': 1, + 'doctype': 'DocPerm', + 'idx': 3, + 'permlevel': 0, + 'role': 'HR Manager', + 'submit': 1, + 'write': 1 + }, + + # DocPerm + { + 'doctype': 'DocPerm', + 'idx': 4, + 'permlevel': 1, + 'role': 'HR User' + }, + + # DocPerm + { + 'doctype': 'DocPerm', + 'idx': 5, + 'permlevel': 1, + 'role': 'HR Manager' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldtype': 'Section Break', + 'idx': 1, + 'label': 'Basic Info', + 'oldfieldtype': 'Section Break', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldtype': 'Column Break', + 'idx': 2, + 'oldfieldtype': 'Column Break', + 'permlevel': 0, + 'width': '50%' + }, + + # DocField + { + 'colour': 'White:FFF', + 'doctype': 'DocField', + 'fieldname': 'employee', + 'fieldtype': 'Link', + 'idx': 3, + 'in_filter': 1, + 'label': 'Employee', + 'oldfieldname': 'employee', + 'oldfieldtype': 'Link', + 'options': 'Employee', + 'permlevel': 0, + 'reqd': 1, + 'search_index': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'employee_name', + 'fieldtype': 'Data', + 'idx': 4, + 'in_filter': 1, + 'label': 'Employee Name', + 'oldfieldname': 'employee_name', + 'oldfieldtype': 'Data', + 'permlevel': 1, + 'reqd': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'department', + 'fieldtype': 'Link', + 'idx': 5, + 'in_filter': 1, + 'label': 'Department', + 'oldfieldname': 'department', + 'oldfieldtype': 'Link', + 'options': 'Department', + 'permlevel': 1, + 'reqd': 0, + 'search_index': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'designation', + 'fieldtype': 'Link', + 'idx': 6, + 'in_filter': 1, + 'label': 'Designation', + 'oldfieldname': 'designation', + 'oldfieldtype': 'Link', + 'options': 'Designation', + 'permlevel': 1, + 'search_index': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'branch', + 'fieldtype': 'Link', + 'idx': 7, + 'in_filter': 1, + 'label': 'Branch', + 'oldfieldname': 'branch', + 'oldfieldtype': 'Link', + 'options': 'Branch', + 'permlevel': 1, + 'search_index': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'grade', + 'fieldtype': 'Link', + 'idx': 8, + 'in_filter': 1, + 'label': 'Grade', + 'oldfieldname': 'grade', + 'oldfieldtype': 'Link', + 'options': 'Grade', + 'permlevel': 1, + 'search_index': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'pf_no', + 'fieldtype': 'Data', + 'idx': 9, + 'label': 'PF No.', + 'oldfieldname': 'pf_no', + 'oldfieldtype': 'Data', + 'permlevel': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'esic_no', + 'fieldtype': 'Data', + 'idx': 10, + 'label': 'ESIC No.', + 'oldfieldname': 'esic_no', + 'oldfieldtype': 'Data', + 'permlevel': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'letter_head', + 'fieldtype': 'Link', + 'idx': 11, + 'label': 'Letter Head', + 'options': 'Letter Head', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldtype': 'Column Break', + 'idx': 12, + 'oldfieldtype': 'Column Break', + 'permlevel': 0, + 'width': '50%' + }, + + # DocField + { + 'colour': 'White:FFF', + 'doctype': 'DocField', + 'fieldname': 'fiscal_year', + 'fieldtype': 'Link', + 'idx': 13, + 'in_filter': 1, + 'label': 'Fiscal Year', + 'oldfieldname': 'fiscal_year', + 'oldfieldtype': 'Data', + 'options': 'Fiscal Year', + 'permlevel': 0, + 'reqd': 1, + 'search_index': 0 + }, + + # 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', + 'doctype': 'DocField', + 'fieldname': 'month', + 'fieldtype': 'Select', + 'idx': 15, + 'in_filter': 1, + 'label': 'Month', + 'oldfieldname': 'month', + 'oldfieldtype': 'Select', + 'options': '\n01\n02\n03\n04\n05\n06\n07\n08\n09\n10\n11\n12', + 'permlevel': 0, + 'reqd': 1, + 'search_index': 1, + 'trigger': 'Client', + 'width': '37%' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'total_days_in_month', + 'fieldtype': 'Data', + 'idx': 16, + 'label': 'Total days in month', + 'oldfieldname': 'total_days_in_month', + 'oldfieldtype': 'Int', + 'permlevel': 1, + 'reqd': 1 + }, + + # DocField + { + 'colour': 'White:FFF', + 'doctype': 'DocField', + 'fieldname': 'leave_without_pay', + 'fieldtype': 'Currency', + 'idx': 17, + 'label': 'Leave Without Pay', + 'oldfieldname': 'leave_without_pay', + 'oldfieldtype': 'Currency', + 'permlevel': 0, + 'trigger': 'Client' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'payment_days', + 'fieldtype': 'Float', + 'idx': 18, + 'label': 'Payment days', + 'oldfieldname': 'payment_days', + 'oldfieldtype': 'Float', + 'permlevel': 1, + 'reqd': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'bank_name', + 'fieldtype': 'Data', + 'idx': 19, + 'label': 'Bank Name', + 'oldfieldname': 'bank_name', + 'oldfieldtype': 'Data', + 'permlevel': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'bank_account_no', + 'fieldtype': 'Data', + 'idx': 20, + 'label': 'Bank Account No.', + 'oldfieldname': 'bank_account_no', + 'oldfieldtype': 'Data', + 'permlevel': 1 + }, + + # DocField + { + 'colour': 'White:FFF', + 'doctype': 'DocField', + 'fieldname': 'email_check', + 'fieldtype': 'Check', + 'idx': 21, + 'label': 'Email', + 'no_copy': 1, + 'oldfieldname': 'email_check', + 'oldfieldtype': 'Check', + 'permlevel': 0, + 'print_hide': 1, + 'report_hide': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'amended_from', + 'fieldtype': 'Data', + 'hidden': 0, + 'idx': 22, + 'label': 'Amended From', + 'no_copy': 1, + 'oldfieldname': 'amended_from', + 'oldfieldtype': 'Data', + 'permlevel': 0, + 'print_hide': 1, + 'report_hide': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'amendment_date', + 'fieldtype': 'Date', + 'hidden': 0, + 'idx': 23, + 'label': 'Amendment Date', + 'no_copy': 1, + 'oldfieldname': 'amendment_date', + 'oldfieldtype': 'Date', + 'permlevel': 0, + 'print_hide': 1, + 'report_hide': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldtype': 'Section Break', + 'idx': 24, + 'label': 'Earning & Deduction', + 'oldfieldtype': 'Section Break', + 'permlevel': 0 + }, + + # DocField + { + 'colour': 'White:FFF', + 'doctype': 'DocField', + 'fieldtype': 'Column Break', + 'idx': 25, + 'label': 'Earning', + 'oldfieldtype': 'Column Break', + 'permlevel': 0, + 'reqd': 0, + 'width': '50%' + }, + + # DocField + { + 'colour': 'White:FFF', + 'doctype': 'DocField', + 'fieldname': 'earning_details', + 'fieldtype': 'Table', + 'idx': 26, + 'label': 'Earning Details', + 'oldfieldname': 'earning_details', + 'oldfieldtype': 'Table', + 'options': 'SS Earning Detail', + 'permlevel': 0 + }, + + # DocField + { + 'colour': 'White:FFF', + 'doctype': 'DocField', + 'fieldtype': 'Column Break', + 'idx': 27, + 'label': 'Deduction', + 'oldfieldtype': 'Column Break', + 'permlevel': 0, + 'width': '50%' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'deduction_details', + 'fieldtype': 'Table', + 'idx': 28, + 'label': 'Deduction Details', + 'oldfieldname': 'deduction_details', + 'oldfieldtype': 'Table', + 'options': 'SS Deduction Detail', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldtype': 'Section Break', + 'idx': 29, + 'label': 'Totals', + 'oldfieldtype': 'Section Break', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldtype': 'Column Break', + 'idx': 30, + 'oldfieldtype': 'Column Break', + 'permlevel': 0, + 'width': '50%' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'arrear_amount', + 'fieldtype': 'Currency', + 'idx': 31, + 'label': 'Arrear Amount', + 'oldfieldname': 'arrear_amount', + 'oldfieldtype': 'Currency', + 'permlevel': 0 + }, + + # DocField + { + 'colour': 'White:FFF', + 'doctype': 'DocField', + 'fieldname': 'leave_encashment_amount', + 'fieldtype': 'Currency', + 'idx': 32, + 'label': 'Leave Encashment Amount', + 'oldfieldname': 'encashment_amount', + 'oldfieldtype': 'Currency', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'gross_pay', + 'fieldtype': 'Currency', + 'idx': 33, + 'label': 'Gross Pay', + 'oldfieldname': 'gross_pay', + 'oldfieldtype': 'Currency', + 'permlevel': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'total_deduction', + 'fieldtype': 'Currency', + 'idx': 34, + 'label': 'Total Deduction', + 'oldfieldname': 'total_deduction', + 'oldfieldtype': 'Currency', + 'permlevel': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldtype': 'Column Break', + 'idx': 35, + 'oldfieldtype': 'Column Break', + 'permlevel': 0, + 'width': '50%' + }, + + # DocField + { + 'colour': 'White:FFF', + 'description': 'Gross Pay + Arrear Amount +Encashment Amount - Total Deduction', + 'doctype': 'DocField', + 'fieldname': 'net_pay', + 'fieldtype': 'Currency', + 'idx': 36, + 'label': 'Net Pay', + 'oldfieldname': 'net_pay', + 'oldfieldtype': 'Currency', + 'permlevel': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'rounded_total', + 'fieldtype': 'Currency', + 'idx': 37, + 'label': 'Rounded Total', + 'permlevel': 1 + }, + + # DocField + { + 'description': 'Net Pay (in words) will be visible once you save the Salary Slip.', + 'doctype': 'DocField', + 'fieldname': 'total_in_words', + 'fieldtype': 'Data', + 'idx': 38, + 'label': 'Total in words', + 'oldfieldname': 'net_pay_in_words', + 'oldfieldtype': 'Data', + 'permlevel': 1 + } +] \ No newline at end of file diff --git a/patches/erpnext_structure_cleanup.py b/patches/erpnext_structure_cleanup.py index 8b765de19d..e78a82ef18 100644 --- a/patches/erpnext_structure_cleanup.py +++ b/patches/erpnext_structure_cleanup.py @@ -195,6 +195,6 @@ def run_patches(): sync_mapper() delete_unwanted_modules() # landed cost wizard link in stock - reload_doc('stock', 'Module Def', 'stock') + reload_doc('stock', 'Module Def', 'Stock') sql("commit") From d29916b7f5859ba1f5b1378401cdf5fe03333d05 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 27 Jul 2011 14:26:23 +0530 Subject: [PATCH 21/24] file_list field hidden in bulk rename tool --- .../lease_agreement_list/lease_agreement_list.txt | 4 ++-- .../lease_monthly_future_installment_inflows.txt | 4 ++-- .../lease_overdue_age_wise/lease_overdue_age_wise.txt | 4 ++-- .../lease_receipt_summary_year_to_date.txt | 4 ++-- .../lease_receipts_client_wise.txt | 4 ++-- .../lease_yearly_future_installment_inflows.txt | 4 ++-- patches/patch.py | 4 +++- utilities/doctype/bulk_rename_tool/bulk_rename_tool.txt | 8 ++++---- 8 files changed, 19 insertions(+), 17 deletions(-) diff --git a/accounts/search_criteria/lease_agreement_list/lease_agreement_list.txt b/accounts/search_criteria/lease_agreement_list/lease_agreement_list.txt index 77e46338d5..164da38af2 100644 --- a/accounts/search_criteria/lease_agreement_list/lease_agreement_list.txt +++ b/accounts/search_criteria/lease_agreement_list/lease_agreement_list.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2011-07-26 17:01:34', + 'creation': '2011-07-27 13:14:29', 'docstatus': 0, - 'modified': '2011-07-26 18:25:54', + 'modified': '2011-07-27 13:14:29', 'modified_by': 'Administrator', 'owner': 'Administrator' }, diff --git a/accounts/search_criteria/lease_monthly_future_installment_inflows/lease_monthly_future_installment_inflows.txt b/accounts/search_criteria/lease_monthly_future_installment_inflows/lease_monthly_future_installment_inflows.txt index 3a41f8feee..a531bb9f27 100644 --- a/accounts/search_criteria/lease_monthly_future_installment_inflows/lease_monthly_future_installment_inflows.txt +++ b/accounts/search_criteria/lease_monthly_future_installment_inflows/lease_monthly_future_installment_inflows.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2011-07-26 16:45:07', + 'creation': '2011-07-27 13:14:29', 'docstatus': 0, - 'modified': '2011-07-26 18:26:16', + 'modified': '2011-07-27 13:14:29', 'modified_by': 'Administrator', 'owner': 'Administrator' }, diff --git a/accounts/search_criteria/lease_overdue_age_wise/lease_overdue_age_wise.txt b/accounts/search_criteria/lease_overdue_age_wise/lease_overdue_age_wise.txt index d8e935bca1..dcd0f94aaa 100644 --- a/accounts/search_criteria/lease_overdue_age_wise/lease_overdue_age_wise.txt +++ b/accounts/search_criteria/lease_overdue_age_wise/lease_overdue_age_wise.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2011-07-26 18:11:10', + 'creation': '2011-07-27 13:14:29', 'docstatus': 0, - 'modified': '2011-07-26 18:26:40', + 'modified': '2011-07-27 13:14:29', 'modified_by': 'Administrator', 'owner': 'Administrator' }, diff --git a/accounts/search_criteria/lease_receipt_summary_year_to_date/lease_receipt_summary_year_to_date.txt b/accounts/search_criteria/lease_receipt_summary_year_to_date/lease_receipt_summary_year_to_date.txt index 04f16bb0cd..405c8a30c5 100644 --- a/accounts/search_criteria/lease_receipt_summary_year_to_date/lease_receipt_summary_year_to_date.txt +++ b/accounts/search_criteria/lease_receipt_summary_year_to_date/lease_receipt_summary_year_to_date.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2011-07-26 18:06:32', + 'creation': '2011-07-27 13:14:29', 'docstatus': 0, - 'modified': '2011-07-26 18:27:43', + 'modified': '2011-07-27 13:14:29', 'modified_by': 'Administrator', 'owner': 'Administrator' }, diff --git a/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.txt b/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.txt index 69795df882..eff40878e4 100644 --- a/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.txt +++ b/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2011-07-26 18:12:22', + 'creation': '2011-07-27 13:14:29', 'docstatus': 0, - 'modified': '2011-07-26 18:27:18', + 'modified': '2011-07-27 13:14:29', 'modified_by': 'Administrator', 'owner': 'Administrator' }, diff --git a/accounts/search_criteria/lease_yearly_future_installment_inflows/lease_yearly_future_installment_inflows.txt b/accounts/search_criteria/lease_yearly_future_installment_inflows/lease_yearly_future_installment_inflows.txt index 6e14165bd4..aa522241b4 100644 --- a/accounts/search_criteria/lease_yearly_future_installment_inflows/lease_yearly_future_installment_inflows.txt +++ b/accounts/search_criteria/lease_yearly_future_installment_inflows/lease_yearly_future_installment_inflows.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2011-07-26 16:24:45', + 'creation': '2011-07-27 13:14:29', 'docstatus': 0, - 'modified': '2011-07-26 18:28:03', + 'modified': '2011-07-27 13:14:29', 'modified_by': 'Administrator', 'owner': 'Administrator' }, diff --git a/patches/patch.py b/patches/patch.py index 0ceb2a7b6d..13da883f31 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 330 +last_patch = 332 #------------------------------------------- @@ -1346,3 +1346,5 @@ def execute(patch_no): # permission p.add_permission('Lease Agreement', 'Accounts Manager', 0, read = 1, write=1,submit=1, cancel=1,amend=1) p.add_permission('Lease Agreement', 'Accounts Manager', 1, read = 1) + elif patch_no == 332: + sql("update `tabDocField` set permlevel=1, hidden = 1 where parent = 'Bulk Rename Tool' and fieldname = 'file_list'") diff --git a/utilities/doctype/bulk_rename_tool/bulk_rename_tool.txt b/utilities/doctype/bulk_rename_tool/bulk_rename_tool.txt index fb998628a2..155d3da2ca 100644 --- a/utilities/doctype/bulk_rename_tool/bulk_rename_tool.txt +++ b/utilities/doctype/bulk_rename_tool/bulk_rename_tool.txt @@ -3,16 +3,16 @@ # These values are common in all dictionaries { - 'creation': '2011-07-08 11:14:15', + 'creation': '2011-07-07 17:47:52', 'docstatus': 0, - 'modified': '2011-07-26 00:59:27', + 'modified': '2011-07-27 13:19:22', 'modified_by': 'Administrator', 'owner': 'Administrator' }, # These values are common for all DocType { - '_last_update': '1310035501', + '_last_update': '1311622167', 'allow_attach': 1, 'autoname': 'field:rename_doctype', 'colour': 'White:FFF', @@ -21,7 +21,7 @@ 'name': '__common__', 'section_style': 'Simple', 'show_in_menu': 0, - 'version': 6 + 'version': 7 }, # These values are common for all DocField From 7081d5e3001923e2783123258b54dfbcce7dd65e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 27 Jul 2011 15:43:37 +0530 Subject: [PATCH 22/24] Check if any gl entry exists instead of current balance while delete/cancel or conveted from ledger to group or vice versa Excluded trashed account from Balance sheet and P&L statement Added is_cancelled check in mis control --- accounts/doctype/account/account.py | 18 +++++++++--------- analysis/doctype/mis_control/mis_control.py | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/accounts/doctype/account/account.py b/accounts/doctype/account/account.py index f5e4a6d6d9..52c66a9adf 100644 --- a/accounts/doctype/account/account.py +++ b/accounts/doctype/account/account.py @@ -94,8 +94,8 @@ class DocType: def convert_group_to_ledger(self): if self.check_if_child_exists(): msgprint("Account: %s has existing child. You can not convert this account to ledger" % (self.doc.name), raise_exception=1) - elif self.check_prev_bal_exists(): - msgprint("Account with balance can not be converted to ledger.", raise_exception=1) + elif self.check_gle_exists(): + msgprint("Account with existing transaction can not be converted to ledger.", raise_exception=1) else: self.doc.group_or_ledger = 'Ledger' self.doc.save() @@ -104,8 +104,8 @@ class DocType: # Convert ledger to group # ================================================================== def convert_ledger_to_group(self): - if self.check_prev_bal_exists(): - msgprint("Account with balance can not be converted to group.", raise_exception=1) + if self.check_gle_exists(): + msgprint("Account with existing transaction can not be converted to group.", raise_exception=1) else: self.doc.group_or_ledger = 'Group' self.doc.save() @@ -113,9 +113,9 @@ class DocType: # Check if any previous balance exists # ================================================================== - def check_prev_bal_exists(self): - bal = sql("select balance from `tabAccount Balance` where parent = '%s' and ifnull(balance, 0) > 0" % (self.doc.name)) - return bal and flt(bal[0][0]) or 0 + def check_gle_exists(self): + exists = sql("select name from `tabGL Entry` where account = '%s' and ifnull(is_cancelled, 'No') = 'No'" % (self.doc.name)) + return exists and exists[0][0] or '' # check if child exists # ================================================================== @@ -231,8 +231,8 @@ class DocType: # Account with balance cannot be inactive # ================================================================== def check_balance_before_trash(self): - if flt(self.get_curr_bal()) != 0: - msgprint("Account with existing balance can not be trashed", raise_exception=1) + if self.check_gle_exists(): + msgprint("Account with existing transaction can not be trashed", raise_exception=1) if self.check_if_child_exists(): msgprint("Child account exists for this account. You can not trash this account.", raise_exception=1) diff --git a/analysis/doctype/mis_control/mis_control.py b/analysis/doctype/mis_control/mis_control.py index 08a71f28e1..5af36e9927 100644 --- a/analysis/doctype/mis_control/mis_control.py +++ b/analysis/doctype/mis_control/mis_control.py @@ -195,7 +195,7 @@ class DocType: # Get Children # ------------ def get_children(self, parent_account, level, pl, company, fy): - cl = sql("select distinct account_name, name, debit_or_credit, lft, rgt from `tabAccount` where ifnull(parent_account, '') = %s and ifnull(is_pl_account, 'No')=%s and company=%s order by name asc", (parent_account, pl, company)) + cl = sql("select distinct account_name, name, debit_or_credit, lft, rgt from `tabAccount` where ifnull(parent_account, '') = %s and ifnull(is_pl_account, 'No')=%s and company=%s and docstatus != 2 order by name asc", (parent_account, pl, company)) level0_diff = [0 for p in self.period_list] if pl=='Yes' and level==0: # switch for income & expenses cl = [c for c in cl] @@ -295,7 +295,7 @@ class DocType: sd = self.ysd.strftime('%Y-%m-%d') cond = "" - bal = sql("select SUM(t1.debit), SUM(t1.credit) from `tabGL Entry` t1, `tabAccount` t2 WHERE t1.posting_date >= '%s' AND t1.posting_date <= '%s' AND t1.company = '%s' AND t1.account = t2.name AND t2.lft >= %s AND t2.rgt <= %s and ifnull(is_opening,'No') = 'No' %s" % (sd,ed,company,lft,rgt, cond)) + bal = sql("select SUM(t1.debit), SUM(t1.credit) from `tabGL Entry` t1, `tabAccount` t2 WHERE t1.posting_date >= '%s' AND t1.posting_date <= '%s' AND t1.company = '%s' AND t1.account = t2.name AND t2.lft >= %s AND t2.rgt <= %s and ifnull(t1.is_opening,'No') = 'No' and ifnull(t1.is_cancelled, 'No') = 'No' %s" % (sd,ed,company,lft,rgt, cond)) bal = bal and (flt(bal[0][0]) - flt(bal[0][1])) or 0 @@ -316,7 +316,7 @@ class DocType: a = sql("select account_name, name, debit_or_credit, lft, rgt, is_pl_account from `tabAccount` where account_name=%s and company=%s", (acc, company), as_dict=1) if a: a = a[0] - bal = sql("select SUM(IFNULL(t1.debit,0)), SUM(IFNULL(t1.credit,0)) from `tabGL Entry` t1, `tabAccount` t2 WHERE t1.posting_date >= %s AND t1.posting_date <= %s AND t1.account = t2.name AND t2.lft >= %s AND t2.rgt <= %s and ifnull(is_opening, 'No') = 'No'", (sd,ed,a['lft'],a['rgt'])) + bal = sql("select SUM(IFNULL(t1.debit,0)), SUM(IFNULL(t1.credit,0)) from `tabGL Entry` t1, `tabAccount` t2 WHERE t1.posting_date >= %s AND t1.posting_date <= %s AND t1.account = t2.name AND t2.lft >= %s AND t2.rgt <= %s and ifnull(is_opening, 'No') = 'No' and ifnull(t1.is_cancelled, 'No') = 'No'", (sd,ed,a['lft'],a['rgt'])) if a['debit_or_credit']=='Debit': bal = flt(flt(bal[0][0]) - flt(bal[0][1])) else: @@ -341,13 +341,13 @@ class DocType: rec_grp = sql("select receivables_group from tabCompany where name=%s", company) if rec_grp: pa_lft_rgt = sql("select lft, rgt from tabAccount where name=%s and company=%s", (rec_grp[0][0], company))[0] - return sql("select t1.account_name, SUM(t2.debit) from tabAccount t1, `tabGL Entry` t2 where t1.lft > %s and t1.rgt < %s and t2.account = t1.name GROUP BY t1.name ORDER BY SUM(t2.debit) desc limit 5", (pa_lft_rgt[0], pa_lft_rgt[1])) + return sql("select t1.account_name, SUM(t2.debit) from tabAccount t1, `tabGL Entry` t2 where t1.lft > %s and t1.rgt < %s and t2.account = t1.name and ifnull(t2.is_cancelled, 'No') = 'No' GROUP BY t1.name ORDER BY SUM(t2.debit) desc limit 5", (pa_lft_rgt[0], pa_lft_rgt[1])) else: return [] def get_top_5_exp(self, company): a = sql("select distinct account_name, name, debit_or_credit, lft, rgt from `tabAccount` where account_name=%s and company=%s", ('Expenses', company), as_dict=1)[0] - return sql("select t1.account_name, SUM(t2.debit) from tabAccount t1, `tabGL Entry` t2 where t1.lft>%s and t1.rgt<%s and t1.group_or_ledger = 'Ledger' and t2.account = t1.name and t2.voucher_type != 'Period Closing Voucher' GROUP BY t1.name ORDER BY SUM(t2.debit) desc limit 5", (a['lft'],a['rgt'])) + return sql("select t1.account_name, SUM(t2.debit) from tabAccount t1, `tabGL Entry` t2 where t1.lft>%s and t1.rgt<%s and t1.group_or_ledger = 'Ledger' and t2.account = t1.name and ifnull(t2.is_cancelled, 'No') = 'No' and t2.voucher_type != 'Period Closing Voucher' GROUP BY t1.name ORDER BY SUM(t2.debit) desc limit 5", (a['lft'],a['rgt'])) def bl(self, acc, company): dt = getdate(nowdate()) From f1353e231de51432f7e6bef19c071e7207983ccf Mon Sep 17 00:00:00 2001 From: Brahma K Date: Thu, 28 Jul 2011 12:23:45 +0530 Subject: [PATCH 23/24] Added js,py and txt files related to Lease Agreement and its reports --- accounts/Module Def/Accounts/Accounts.txt | 18 +++++++++--------- .../doctype/lease_agreement/lease_agreement.js | 14 +++++++++++++- .../lease_agreement/lease_agreement.txt | 6 +++--- .../lease_agreement_list.js | 11 +++++++++++ .../lease_agreement_list.py | 13 +++++++++++++ .../lease_agreement_list.sql | 3 +++ .../lease_agreement_list.txt | 2 +- ...lease_monthly_future_installment_inflows.js | 14 ++++++++++++++ ...lease_monthly_future_installment_inflows.py | 13 +++++++++++++ ...ease_monthly_future_installment_inflows.sql | 9 +++++++++ .../lease_over_due_list/lease_over_due_list.js | 14 ++++++++++++++ .../lease_over_due_list/lease_over_due_list.py | 14 ++++++++++++++ .../lease_over_due_list.sql | 7 +++++++ .../lease_overdue_age_wise.js | 14 ++++++++++++++ .../lease_overdue_age_wise.py | 16 ++++++++++++++++ .../lease_overdue_age_wise.sql | 9 +++++++++ .../__init__.py | 0 .../lease_receipt_summary_month_wise.js | 11 +++++++++++ .../lease_receipt_summary_month_wise.py | 13 +++++++++++++ .../lease_receipt_summary_month_wise.sql | 5 +++++ .../lease_receipt_summary_month_wise.txt} | 15 ++++++--------- .../lease_receipts_client_wise.js | 11 +++++++++++ .../lease_receipts_client_wise.py | 12 ++++++++++++ .../lease_receipts_client_wise.sql | 5 +++++ .../lease_receipts_client_wise.txt | 7 ++++--- .../lease_yearly_future_installment_inflows.js | 14 ++++++++++++++ .../lease_yearly_future_installment_inflows.py | 12 ++++++++++++ ...lease_yearly_future_installment_inflows.sql | 9 +++++++++ 28 files changed, 265 insertions(+), 26 deletions(-) create mode 100644 accounts/search_criteria/lease_agreement_list/lease_agreement_list.js create mode 100644 accounts/search_criteria/lease_agreement_list/lease_agreement_list.py create mode 100644 accounts/search_criteria/lease_agreement_list/lease_agreement_list.sql create mode 100644 accounts/search_criteria/lease_monthly_future_installment_inflows/lease_monthly_future_installment_inflows.js create mode 100644 accounts/search_criteria/lease_monthly_future_installment_inflows/lease_monthly_future_installment_inflows.py create mode 100644 accounts/search_criteria/lease_monthly_future_installment_inflows/lease_monthly_future_installment_inflows.sql create mode 100644 accounts/search_criteria/lease_over_due_list/lease_over_due_list.js create mode 100644 accounts/search_criteria/lease_over_due_list/lease_over_due_list.py create mode 100644 accounts/search_criteria/lease_over_due_list/lease_over_due_list.sql create mode 100644 accounts/search_criteria/lease_overdue_age_wise/lease_overdue_age_wise.js create mode 100644 accounts/search_criteria/lease_overdue_age_wise/lease_overdue_age_wise.py create mode 100644 accounts/search_criteria/lease_overdue_age_wise/lease_overdue_age_wise.sql rename accounts/search_criteria/{lease_receipt_summary_year_to_date => lease_receipt_summary_month_wise}/__init__.py (100%) create mode 100644 accounts/search_criteria/lease_receipt_summary_month_wise/lease_receipt_summary_month_wise.js create mode 100644 accounts/search_criteria/lease_receipt_summary_month_wise/lease_receipt_summary_month_wise.py create mode 100644 accounts/search_criteria/lease_receipt_summary_month_wise/lease_receipt_summary_month_wise.sql rename accounts/search_criteria/{lease_receipt_summary_year_to_date/lease_receipt_summary_year_to_date.txt => lease_receipt_summary_month_wise/lease_receipt_summary_month_wise.txt} (69%) create mode 100644 accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.js create mode 100644 accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.py create mode 100644 accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.sql create mode 100644 accounts/search_criteria/lease_yearly_future_installment_inflows/lease_yearly_future_installment_inflows.js create mode 100644 accounts/search_criteria/lease_yearly_future_installment_inflows/lease_yearly_future_installment_inflows.py create mode 100644 accounts/search_criteria/lease_yearly_future_installment_inflows/lease_yearly_future_installment_inflows.sql diff --git a/accounts/Module Def/Accounts/Accounts.txt b/accounts/Module Def/Accounts/Accounts.txt index 35e7e5d38d..512b460b82 100644 --- a/accounts/Module Def/Accounts/Accounts.txt +++ b/accounts/Module Def/Accounts/Accounts.txt @@ -5,7 +5,7 @@ { 'creation': '2010-09-25 10:50:34', 'docstatus': 0, - 'modified': '2011-07-27 11:43:40', + 'modified': '2011-07-28 12:01:10', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -358,7 +358,7 @@ # Module Def Item { 'display_name': 'Lease Agreement List', - 'doc_name': 'Lease Agreement List', + 'doc_name': 'GL Entry', 'doc_type': 'Reports', 'doctype': 'Module Def Item', 'idx': 33 @@ -367,7 +367,7 @@ # Module Def Item { 'display_name': 'Lease Monthly Future Installment Inflows', - 'doc_name': 'Lease Monthly Future Installment Inflows', + 'doc_name': 'GL Entry', 'doc_type': 'Reports', 'doctype': 'Module Def Item', 'idx': 34 @@ -376,7 +376,7 @@ # Module Def Item { 'display_name': 'Lease Overdue Age Wise', - 'doc_name': 'Lease Overdue Age Wise', + 'doc_name': 'GL Entry', 'doc_type': 'Reports', 'doctype': 'Module Def Item', 'idx': 35 @@ -385,7 +385,7 @@ # Module Def Item { 'display_name': 'Lease Overdue List', - 'doc_name': 'Lease Overdue List', + 'doc_name': 'GL Entry', 'doc_type': 'Reports', 'doctype': 'Module Def Item', 'idx': 36 @@ -394,7 +394,7 @@ # Module Def Item { 'display_name': 'Lease Receipts Client Wise', - 'doc_name': 'Lease Receipts Client Wise', + 'doc_name': 'GL Entry', 'doc_type': 'Reports', 'doctype': 'Module Def Item', 'idx': 37 @@ -402,8 +402,8 @@ # Module Def Item { - 'display_name': 'Lease Receipt Summary Year to Date', - 'doc_name': 'Lease Receipt Summary Year to Date', + 'display_name': 'Lease Receipt Summary Month Wise', + 'doc_name': 'GL Entry', 'doc_type': 'Reports', 'doctype': 'Module Def Item', 'idx': 38 @@ -412,7 +412,7 @@ # Module Def Item { 'display_name': 'Lease Yearly Future Installment Inflows', - 'doc_name': 'Lease Yearly Future Installment Inflows', + 'doc_name': 'GL Entry', 'doc_type': 'Reports', 'doctype': 'Module Def Item', 'idx': 39 diff --git a/accounts/doctype/lease_agreement/lease_agreement.js b/accounts/doctype/lease_agreement/lease_agreement.js index 8c681a11b2..83e8500483 100644 --- a/accounts/doctype/lease_agreement/lease_agreement.js +++ b/accounts/doctype/lease_agreement/lease_agreement.js @@ -1,5 +1,17 @@ $.extend(cur_frm.cscript, { - Generate: function(doc, dt, dn) { + Generate: function(doc, dt, dn) {msgprint(doc); + if(doc.installment_amount==''){ + msgprint('Set Installment Amount before generating schedule'); + return; + } + if(doc.no_of_installments==''){ + msgprint('Set Number of Installments before generating schedule'); + return; + } + if(doc.start_date==''){ + msgprint('Set Start Date before generating schedule'); + return; + } cur_frm.cscript.clear_installments(doc); tot=0;i=0; while(tot '%(date)s') + +group by date_format(due_date,'%M-%Y') + +order by year(due_date),month(due_date) \ No newline at end of file diff --git a/accounts/search_criteria/lease_over_due_list/lease_over_due_list.js b/accounts/search_criteria/lease_over_due_list/lease_over_due_list.js new file mode 100644 index 0000000000..2d89611410 --- /dev/null +++ b/accounts/search_criteria/lease_over_due_list/lease_over_due_list.js @@ -0,0 +1,14 @@ +report.customize_filters = function() { + this.hide_all_filters(); + + this.add_filter({fieldname:'date', label:'Date', fieldtype:'Date', options:'',ignore : 1, parent:'GL Entry', 'in_first_page':1}); + + this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Date'].df['report_default']=dateutil.obj_to_str(new Date()); +// this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df['report_default']=dateutil.obj_to_str(new Date()); + + this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df.filter_hide=1; + +} + +$dh(this.mytabs.tabs['More Filters']); +$dh(this.mytabs.tabs['Select Columns']); diff --git a/accounts/search_criteria/lease_over_due_list/lease_over_due_list.py b/accounts/search_criteria/lease_over_due_list/lease_over_due_list.py new file mode 100644 index 0000000000..869d46a55f --- /dev/null +++ b/accounts/search_criteria/lease_over_due_list/lease_over_due_list.py @@ -0,0 +1,14 @@ +data =[ + ['Agreement No.','Data','100px',''], + ['Lessee Name','Data','300px',''], + ['Amount','Currency','120px',''], + ['Age','Data','100px',''] + ] + +for d in data: + colnames.append(d[0]) + coltypes.append(d[1]) + colwidths.append(d[2]) + coloptions.append(d[3]) + col_idx[d[0]] = len(colnames)-1 + diff --git a/accounts/search_criteria/lease_over_due_list/lease_over_due_list.sql b/accounts/search_criteria/lease_over_due_list/lease_over_due_list.sql new file mode 100644 index 0000000000..1789f7e543 --- /dev/null +++ b/accounts/search_criteria/lease_over_due_list/lease_over_due_list.sql @@ -0,0 +1,7 @@ +select la.name,la.account,lai.amount,cast('%(date)s' as date)-due_date as age + +from `tabLease Agreement` la,`tabLease Installment` lai + +where la.name=lai.parent and lai.due_date cast('%(date)s' as date)) + +order by cast('%(date)s' as date)-due_date desc \ No newline at end of file diff --git a/accounts/search_criteria/lease_overdue_age_wise/lease_overdue_age_wise.js b/accounts/search_criteria/lease_overdue_age_wise/lease_overdue_age_wise.js new file mode 100644 index 0000000000..2d89611410 --- /dev/null +++ b/accounts/search_criteria/lease_overdue_age_wise/lease_overdue_age_wise.js @@ -0,0 +1,14 @@ +report.customize_filters = function() { + this.hide_all_filters(); + + this.add_filter({fieldname:'date', label:'Date', fieldtype:'Date', options:'',ignore : 1, parent:'GL Entry', 'in_first_page':1}); + + this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Date'].df['report_default']=dateutil.obj_to_str(new Date()); +// this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df['report_default']=dateutil.obj_to_str(new Date()); + + this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df.filter_hide=1; + +} + +$dh(this.mytabs.tabs['More Filters']); +$dh(this.mytabs.tabs['Select Columns']); diff --git a/accounts/search_criteria/lease_overdue_age_wise/lease_overdue_age_wise.py b/accounts/search_criteria/lease_overdue_age_wise/lease_overdue_age_wise.py new file mode 100644 index 0000000000..5e16489841 --- /dev/null +++ b/accounts/search_criteria/lease_overdue_age_wise/lease_overdue_age_wise.py @@ -0,0 +1,16 @@ +data =[ + ['Lessee Name','Data','300px',''], + ['Below 30 Days','Currency','120px',''], + ['Below 90 Days','Currency','120px',''], + ['Below 180 Days','Currency','120px',''], + ['Below 360 Days','Currency','120px',''], + ['Above 360 Days','Currency','120px',''], + ] + +for d in data: + colnames.append(d[0]) + coltypes.append(d[1]) + colwidths.append(d[2]) + coloptions.append(d[3]) + col_idx[d[0]] = len(colnames)-1 + diff --git a/accounts/search_criteria/lease_overdue_age_wise/lease_overdue_age_wise.sql b/accounts/search_criteria/lease_overdue_age_wise/lease_overdue_age_wise.sql new file mode 100644 index 0000000000..2e6912e23a --- /dev/null +++ b/accounts/search_criteria/lease_overdue_age_wise/lease_overdue_age_wise.sql @@ -0,0 +1,9 @@ +select account,sum(od_30)as od_30,sum(od_90)as od_90,sum(od_180)as od_180,sum(od_360)as od_360,sum(od_1yr)as od_1yr from +( + select account,case when age<=30 then amount end as od_30,case when age between 31 and 90 then amount end as od_90,case when age between 91 and 180 then amount end as od_180,case when age between 181 and 360 then amount end as od_360,case when age>360 then amount end as od_1yr from + ( + select la.account,lai.amount,cast('%(date)s' as date)-due_date as age + from `tabLease Agreement` la,`tabLease Installment` lai + where la.name=lai.parent and lai.due_date<'%(date)s' and (lai.cheque_date is null or lai.cheque_date > '%(date)s') + )a +)b group by account order by account diff --git a/accounts/search_criteria/lease_receipt_summary_year_to_date/__init__.py b/accounts/search_criteria/lease_receipt_summary_month_wise/__init__.py similarity index 100% rename from accounts/search_criteria/lease_receipt_summary_year_to_date/__init__.py rename to accounts/search_criteria/lease_receipt_summary_month_wise/__init__.py diff --git a/accounts/search_criteria/lease_receipt_summary_month_wise/lease_receipt_summary_month_wise.js b/accounts/search_criteria/lease_receipt_summary_month_wise/lease_receipt_summary_month_wise.js new file mode 100644 index 0000000000..4cb3d2b336 --- /dev/null +++ b/accounts/search_criteria/lease_receipt_summary_month_wise/lease_receipt_summary_month_wise.js @@ -0,0 +1,11 @@ +report.customize_filters = function() { + this.hide_all_filters(); + + this.add_filter({fieldname:'date', label:'Date', fieldtype:'Date', options:'',ignore : 1, parent:'GL Entry', 'in_first_page':1}); + + this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Date'].df['report_default']=sys_defaults.year_start_date; + this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df['report_default']=dateutil.obj_to_str(new Date()); +} + +$dh(this.mytabs.tabs['More Filters']); +$dh(this.mytabs.tabs['Select Columns']); diff --git a/accounts/search_criteria/lease_receipt_summary_month_wise/lease_receipt_summary_month_wise.py b/accounts/search_criteria/lease_receipt_summary_month_wise/lease_receipt_summary_month_wise.py new file mode 100644 index 0000000000..8e5b8ad00b --- /dev/null +++ b/accounts/search_criteria/lease_receipt_summary_month_wise/lease_receipt_summary_month_wise.py @@ -0,0 +1,13 @@ +data =[ + ['Month','Data','100px',''], + ['Year','Data','100px',''], + ['Amount','Currency','120px',''] + ] + +for d in data: + colnames.append(d[0]) + coltypes.append(d[1]) + colwidths.append(d[2]) + coloptions.append(d[3]) + col_idx[d[0]] = len(colnames)-1 + diff --git a/accounts/search_criteria/lease_receipt_summary_month_wise/lease_receipt_summary_month_wise.sql b/accounts/search_criteria/lease_receipt_summary_month_wise/lease_receipt_summary_month_wise.sql new file mode 100644 index 0000000000..cdd48b8915 --- /dev/null +++ b/accounts/search_criteria/lease_receipt_summary_month_wise/lease_receipt_summary_month_wise.sql @@ -0,0 +1,5 @@ +SELECT date_format(gl.posting_date,'%M'),year(gl.posting_date),sum(gl.credit) as amount +FROM `tabGL Entry` gl, `tabAccount` a +WHERE gl.account=a.name and a.master_type='Customer' and gl.credit>0 and gl.posting_date between '%(date)s' and '%(date1)s' +GROUP BY month(gl.posting_date),year(gl.posting_date) +ORDER BY year(gl.posting_date),month(gl.posting_date) diff --git a/accounts/search_criteria/lease_receipt_summary_year_to_date/lease_receipt_summary_year_to_date.txt b/accounts/search_criteria/lease_receipt_summary_month_wise/lease_receipt_summary_month_wise.txt similarity index 69% rename from accounts/search_criteria/lease_receipt_summary_year_to_date/lease_receipt_summary_year_to_date.txt rename to accounts/search_criteria/lease_receipt_summary_month_wise/lease_receipt_summary_month_wise.txt index 04f16bb0cd..f63462fa5a 100644 --- a/accounts/search_criteria/lease_receipt_summary_year_to_date/lease_receipt_summary_year_to_date.txt +++ b/accounts/search_criteria/lease_receipt_summary_month_wise/lease_receipt_summary_month_wise.txt @@ -1,11 +1,11 @@ -# Search Criteria, lease_receipt_summary_year_to_date +# Search Criteria, lease_receipt_summary_month_wise [ # These values are common in all dictionaries { - 'creation': '2011-07-26 18:06:32', + 'creation': '2011-07-27 18:48:29', 'docstatus': 0, - 'modified': '2011-07-26 18:27:43', + 'modified': '2011-07-28 09:59:51', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -13,21 +13,18 @@ # These values are common for all Search Criteria { 'columns': 'GL Entry\x01ID,GL Entry\x01Owner,GL Entry\x01Posting Date,GL Entry\x01Aging Date,GL Entry\x01Account,GL Entry\x01Cost Center,GL Entry\x01Against,GL Entry\x01Against Voucher,GL Entry\x01Voucher Type,GL Entry\x01Voucher No,GL Entry\x01Remarks,GL Entry\x01Is Cancelled,GL Entry\x01Is Opening,GL Entry\x01Fiscal Year,GL Entry\x01Company', - 'criteria_name': 'Lease Receipt Summary (Year to date)', + 'criteria_name': 'Lease Receipt Summary Month Wise', 'doc_type': 'GL Entry', 'doctype': 'Search Criteria', 'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}", 'module': 'Accounts', 'name': '__common__', - 'page_len': 50, - 'sort_by': '`tabGL Entry`.`company`', - 'sort_order': 'DESC', 'standard': 'Yes' }, - # Search Criteria, lease_receipt_summary_year_to_date + # Search Criteria, lease_receipt_summary_month_wise { 'doctype': 'Search Criteria', - 'name': 'lease_receipt_summary_year_to_date' + 'name': 'lease_receipt_summary_month_wise' } ] \ No newline at end of file diff --git a/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.js b/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.js new file mode 100644 index 0000000000..4cb3d2b336 --- /dev/null +++ b/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.js @@ -0,0 +1,11 @@ +report.customize_filters = function() { + this.hide_all_filters(); + + this.add_filter({fieldname:'date', label:'Date', fieldtype:'Date', options:'',ignore : 1, parent:'GL Entry', 'in_first_page':1}); + + this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Date'].df['report_default']=sys_defaults.year_start_date; + this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df['report_default']=dateutil.obj_to_str(new Date()); +} + +$dh(this.mytabs.tabs['More Filters']); +$dh(this.mytabs.tabs['Select Columns']); diff --git a/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.py b/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.py new file mode 100644 index 0000000000..b84ff9fe5a --- /dev/null +++ b/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.py @@ -0,0 +1,12 @@ +data =[ + ['Lessee Name','Data','300px',''], + ['Amount','Currency','120px',''] + ] + +for d in data: + colnames.append(d[0]) + coltypes.append(d[1]) + colwidths.append(d[2]) + coloptions.append(d[3]) + col_idx[d[0]] = len(colnames)-1 + diff --git a/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.sql b/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.sql new file mode 100644 index 0000000000..f951388aaf --- /dev/null +++ b/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.sql @@ -0,0 +1,5 @@ +SELECT gl.account,sum(gl.credit) as amount +FROM `tabGL Entry` gl, `tabAccount` a +WHERE gl.account=a.name and a.master_type='Customer' and gl.posting_date between '%(date)s' and '%(date1)s' +GROUP BY gl.account +ORDER BY posting_date diff --git a/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.txt b/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.txt index 69795df882..25c15c267b 100644 --- a/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.txt +++ b/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2011-07-26 18:12:22', + 'creation': '2011-07-28 12:13:41', 'docstatus': 0, - 'modified': '2011-07-26 18:27:18', + 'modified': '2011-07-28 12:16:13', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -13,12 +13,13 @@ # These values are common for all Search Criteria { 'columns': 'GL Entry\x01ID,GL Entry\x01Owner,GL Entry\x01Posting Date,GL Entry\x01Aging Date,GL Entry\x01Account,GL Entry\x01Cost Center,GL Entry\x01Against,GL Entry\x01Against Voucher,GL Entry\x01Voucher Type,GL Entry\x01Voucher No,GL Entry\x01Remarks,GL Entry\x01Is Cancelled,GL Entry\x01Is Opening,GL Entry\x01Fiscal Year,GL Entry\x01Company', - 'criteria_name': 'Lease Receipts Client wise', + 'criteria_name': 'Lease Receipts Client Wise', 'doc_type': 'GL Entry', 'doctype': 'Search Criteria', 'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}", 'module': 'Accounts', 'name': '__common__', + 'page_len': 50, 'standard': 'Yes' }, diff --git a/accounts/search_criteria/lease_yearly_future_installment_inflows/lease_yearly_future_installment_inflows.js b/accounts/search_criteria/lease_yearly_future_installment_inflows/lease_yearly_future_installment_inflows.js new file mode 100644 index 0000000000..2d89611410 --- /dev/null +++ b/accounts/search_criteria/lease_yearly_future_installment_inflows/lease_yearly_future_installment_inflows.js @@ -0,0 +1,14 @@ +report.customize_filters = function() { + this.hide_all_filters(); + + this.add_filter({fieldname:'date', label:'Date', fieldtype:'Date', options:'',ignore : 1, parent:'GL Entry', 'in_first_page':1}); + + this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Date'].df['report_default']=dateutil.obj_to_str(new Date()); +// this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df['report_default']=dateutil.obj_to_str(new Date()); + + this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df.filter_hide=1; + +} + +$dh(this.mytabs.tabs['More Filters']); +$dh(this.mytabs.tabs['Select Columns']); diff --git a/accounts/search_criteria/lease_yearly_future_installment_inflows/lease_yearly_future_installment_inflows.py b/accounts/search_criteria/lease_yearly_future_installment_inflows/lease_yearly_future_installment_inflows.py new file mode 100644 index 0000000000..0163ba62f2 --- /dev/null +++ b/accounts/search_criteria/lease_yearly_future_installment_inflows/lease_yearly_future_installment_inflows.py @@ -0,0 +1,12 @@ +data =[ + ['Year','Data','100px',''], + ['Amount','Currency','120px',''] + ] + +for d in data: + colnames.append(d[0]) + coltypes.append(d[1]) + colwidths.append(d[2]) + coloptions.append(d[3]) + col_idx[d[0]] = len(colnames)-1 + diff --git a/accounts/search_criteria/lease_yearly_future_installment_inflows/lease_yearly_future_installment_inflows.sql b/accounts/search_criteria/lease_yearly_future_installment_inflows/lease_yearly_future_installment_inflows.sql new file mode 100644 index 0000000000..ec6c8166d0 --- /dev/null +++ b/accounts/search_criteria/lease_yearly_future_installment_inflows/lease_yearly_future_installment_inflows.sql @@ -0,0 +1,9 @@ +select year(date_sub(due_date,interval 6 MONTH)) as yr,sum(amount) + +from `tabLease Agreement` la,`tabLease Installment` lai + +where la.name=lai.parent and (lai.cheque_date is null or lai.cheque_date > '%(date)s') + +group by year(date_sub(due_date,interval 6 MONTH)) + +order by yr \ No newline at end of file From 67b8da652cad0d43b98ae4af14c9330122721a5b Mon Sep 17 00:00:00 2001 From: Brahma K Date: Thu, 28 Jul 2011 12:58:14 +0530 Subject: [PATCH 24/24] Added Lease Agreement text files --- .../lease_agreement_list.txt | 30 ++++++++++++++++++ .../lease_receipt_summary_month_wise.txt | 30 ++++++++++++++++++ .../lease_receipts_client_wise.txt | 31 +++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 accounts/search_criteria/lease_agreement_list/lease_agreement_list.txt create mode 100644 accounts/search_criteria/lease_receipt_summary_month_wise/lease_receipt_summary_month_wise.txt create mode 100644 accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.txt diff --git a/accounts/search_criteria/lease_agreement_list/lease_agreement_list.txt b/accounts/search_criteria/lease_agreement_list/lease_agreement_list.txt new file mode 100644 index 0000000000..f7c9f84623 --- /dev/null +++ b/accounts/search_criteria/lease_agreement_list/lease_agreement_list.txt @@ -0,0 +1,30 @@ +# Search Criteria, lease_agreement_list +[ + + # These values are common in all dictionaries + { + 'creation': '2011-07-26 17:01:34', + 'docstatus': 0, + 'modified': '2011-07-28 12:55:50', + 'modified_by': 'Administrator', + 'owner': 'Administrator' + }, + + # These values are common for all Search Criteria + { + 'columns': 'GL Entry\x01ID,GL Entry\x01Owner,GL Entry\x01Posting Date,GL Entry\x01Aging Date,GL Entry\x01Account,GL Entry\x01Cost Center,GL Entry\x01Against,GL Entry\x01Against Voucher,GL Entry\x01Voucher Type,GL Entry\x01Voucher No,GL Entry\x01Remarks,GL Entry\x01Is Cancelled,GL Entry\x01Is Opening,GL Entry\x01Fiscal Year,GL Entry\x01Company', + 'criteria_name': 'Lease Agreement List', + 'doc_type': 'GL Entry', + 'doctype': 'Search Criteria', + 'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}", + 'module': 'Accounts', + 'name': '__common__', + 'standard': 'Yes' + }, + + # Search Criteria, lease_agreement_list + { + 'doctype': 'Search Criteria', + 'name': 'lease_agreement_list' + } +] \ No newline at end of file diff --git a/accounts/search_criteria/lease_receipt_summary_month_wise/lease_receipt_summary_month_wise.txt b/accounts/search_criteria/lease_receipt_summary_month_wise/lease_receipt_summary_month_wise.txt new file mode 100644 index 0000000000..6e1b266ea5 --- /dev/null +++ b/accounts/search_criteria/lease_receipt_summary_month_wise/lease_receipt_summary_month_wise.txt @@ -0,0 +1,30 @@ +# Search Criteria, lease_receipt_summary_month_wise +[ + + # These values are common in all dictionaries + { + 'creation': '2011-07-27 18:48:29', + 'docstatus': 0, + 'modified': '2011-07-28 12:56:35', + 'modified_by': 'Administrator', + 'owner': 'Administrator' + }, + + # These values are common for all Search Criteria + { + 'columns': 'GL Entry\x01ID,GL Entry\x01Owner,GL Entry\x01Posting Date,GL Entry\x01Aging Date,GL Entry\x01Account,GL Entry\x01Cost Center,GL Entry\x01Against,GL Entry\x01Against Voucher,GL Entry\x01Voucher Type,GL Entry\x01Voucher No,GL Entry\x01Remarks,GL Entry\x01Is Cancelled,GL Entry\x01Is Opening,GL Entry\x01Fiscal Year,GL Entry\x01Company', + 'criteria_name': 'Lease Receipt Summary Month Wise', + 'doc_type': 'GL Entry', + 'doctype': 'Search Criteria', + 'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}", + 'module': 'Accounts', + 'name': '__common__', + 'standard': 'Yes' + }, + + # Search Criteria, lease_receipt_summary_month_wise + { + 'doctype': 'Search Criteria', + 'name': 'lease_receipt_summary_month_wise' + } +] \ No newline at end of file diff --git a/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.txt b/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.txt new file mode 100644 index 0000000000..26c0ff7a1c --- /dev/null +++ b/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.txt @@ -0,0 +1,31 @@ +# Search Criteria, lease_receipts_client_wise +[ + + # These values are common in all dictionaries + { + 'creation': '2011-07-28 12:13:41', + 'docstatus': 0, + 'modified': '2011-07-28 12:56:47', + 'modified_by': 'Administrator', + 'owner': 'Administrator' + }, + + # These values are common for all Search Criteria + { + 'columns': 'GL Entry\x01ID,GL Entry\x01Owner,GL Entry\x01Posting Date,GL Entry\x01Aging Date,GL Entry\x01Account,GL Entry\x01Cost Center,GL Entry\x01Against,GL Entry\x01Against Voucher,GL Entry\x01Voucher Type,GL Entry\x01Voucher No,GL Entry\x01Remarks,GL Entry\x01Is Cancelled,GL Entry\x01Is Opening,GL Entry\x01Fiscal Year,GL Entry\x01Company', + 'criteria_name': 'Lease Receipts Client Wise', + 'doc_type': 'GL Entry', + 'doctype': 'Search Criteria', + 'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}", + 'module': 'Accounts', + 'name': '__common__', + 'page_len': 50, + 'standard': 'Yes' + }, + + # Search Criteria, lease_receipts_client_wise + { + 'doctype': 'Search Criteria', + 'name': 'lease_receipts_client_wise' + } +] \ No newline at end of file