diff --git a/accounts/Module Def/Accounts/Accounts.txt b/accounts/Module Def/Accounts/Accounts.txt index 3d70ff8701..bd3cbbf7fd 100644 --- a/accounts/Module Def/Accounts/Accounts.txt +++ b/accounts/Module Def/Accounts/Accounts.txt @@ -1,722 +1,387 @@ +# 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-26 18:14:48', + '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': 3, + '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 + { + 'description': 'Lease Agreement for Vehicles', + 'display_name': 'Lease Agreement', + 'doc_name': 'Lease Agreement', + '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 Item + { + 'display_name': 'Lease Agreement List', + 'doc_name': 'Lease Agreement List', + 'doc_type': 'Reports', + 'doctype': 'Module Def Item', + 'idx': 33 + }, + + # 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/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/journal_voucher/journal_voucher.txt b/accounts/doctype/journal_voucher/journal_voucher.txt deleted file mode 100644 index 1260ec94d1..0000000000 --- a/accounts/doctype/journal_voucher/journal_voucher.txt +++ /dev/null @@ -1,829 +0,0 @@ -# DocType, Journal Voucher -[ - - # These values are common in all dictionaries - { - 'creation': '2010-08-08 17:09:06', - 'docstatus': 0, - 'modified': '2011-04-06 14:41:47', - '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': '1309508838', - 'colour': 'White:FFF', - 'doctype': 'DocType', - 'module': 'Accounts', - 'name': '__common__', - 'search_fields': 'voucher_type,posting_date, due_date, cheque_no', - 'section_style': 'Tabbed', - 'server_code_error': ' ', - 'show_in_menu': 0, - 'subject': ' ', - 'tag_fields': 'voucher_type', - 'version': 307 - }, - - # These values are common for all DocFormat - { - 'doctype': 'DocFormat', - 'name': '__common__', - 'parent': 'Journal Voucher', - 'parentfield': 'formats', - 'parenttype': 'DocType' - }, - - # These values are common for all DocPerm - { - 'doctype': 'DocPerm', - 'name': '__common__', - 'parent': 'Journal Voucher', - 'parentfield': 'permissions', - 'parenttype': 'DocType', - 'read': 1 - }, - - # DocType, Journal Voucher - { - 'doctype': 'DocType', - 'name': 'Journal Voucher' - }, - - # DocPerm - { - 'amend': 0, - 'cancel': 0, - 'create': 0, - 'doctype': 'DocPerm', - 'idx': 1, - 'permlevel': 1, - 'role': 'Accounts Manager', - 'submit': 0, - 'write': 0 - }, - - # DocPerm - { - 'amend': 1, - 'cancel': 1, - 'create': 1, - 'doctype': 'DocPerm', - 'idx': 2, - 'permlevel': 0, - 'role': 'Accounts Manager', - 'submit': 1, - 'write': 1 - }, - - # DocPerm - { - 'amend': 1, - 'cancel': 1, - 'create': 1, - 'doctype': 'DocPerm', - 'idx': 3, - 'permlevel': 0, - 'role': 'Accounts User', - 'submit': 1, - 'write': 1 - }, - - # DocPerm - { - 'amend': 0, - 'cancel': 0, - 'create': 0, - 'doctype': 'DocPerm', - 'idx': 4, - 'permlevel': 1, - 'role': 'Accounts User', - 'submit': 0, - 'write': 0 - }, - - # DocFormat - { - 'doctype': 'DocFormat', - 'format': 'Payment Receipt Voucher', - 'idx': 1 - }, - - # DocFormat - { - 'doctype': 'DocFormat', - 'format': 'Cheque Printing Format', - 'idx': 2 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldtype': 'Section Break', - 'idx': 1, - 'label': 'Basic Info', - 'oldfieldtype': 'Section Break', - 'permlevel': 0 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldtype': 'Section Break', - 'idx': 2, - 'label': '1. Select Series and Dates', - 'oldfieldtype': 'Section Break', - 'options': 'Simple', - 'permlevel': 0 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldtype': 'Column Break', - 'idx': 3, - 'oldfieldtype': 'Column Break', - 'permlevel': 0, - 'width': '50%' - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'voucher_type', - 'fieldtype': 'Select', - 'idx': 4, - 'in_filter': 1, - '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', - 'permlevel': 0, - 'print_hide': 0, - 'search_index': 1 - }, - - # DocField - { - 'colour': 'White:FFF', - 'depends_on': "eval:doc.voucher_type == 'Write Off Voucher'", - 'doctype': 'DocField', - 'fieldname': 'write_off_amount', - 'fieldtype': 'Currency', - 'idx': 5, - 'label': 'Write Off Amount <=', - 'permlevel': 0, - 'print_hide': 1, - 'report_hide': 1 - }, - - # DocField - { - 'colour': 'White:FFF', - 'default': 'Accounts Receivable', - 'depends_on': "eval:doc.voucher_type == 'Write Off Voucher'", - 'doctype': 'DocField', - 'fieldname': 'write_off_based_on', - 'fieldtype': 'Select', - 'idx': 6, - 'label': 'Write Off Based On', - 'options': 'Accounts Receivable\nAccounts Payable', - 'permlevel': 0, - 'print_hide': 1, - 'report_hide': 1 - }, - - # DocField - { - 'colour': 'White:FFF', - 'description': 'To manage multiple series please go to Setup > Manage Series', - 'doctype': 'DocField', - 'fieldname': 'naming_series', - 'fieldtype': 'Select', - 'idx': 7, - 'label': 'Series', - 'no_copy': 1, - 'oldfieldname': 'naming_series', - 'oldfieldtype': 'Select', - 'options': 'JV', - 'permlevel': 0, - 'print_hide': 1, - 'reqd': 1 - }, - - # DocField - { - 'colour': 'White:FFF', - 'default': 'Today', - 'doctype': 'DocField', - 'fieldname': 'voucher_date', - 'fieldtype': 'Date', - 'idx': 8, - 'in_filter': 1, - 'label': 'Voucher Date', - 'no_copy': 1, - 'oldfieldname': 'voucher_date', - 'oldfieldtype': 'Date', - 'permlevel': 0, - 'print_hide': 0, - 'reqd': 1, - 'search_index': 0 - }, - - # DocField - { - 'description': 'The date at which current entry will get or has actually executed.', - 'doctype': 'DocField', - 'fieldname': 'posting_date', - 'fieldtype': 'Date', - 'idx': 9, - 'in_filter': 1, - 'label': 'Posting Date', - 'no_copy': 1, - 'oldfieldname': 'posting_date', - 'oldfieldtype': 'Date', - 'permlevel': 0, - 'reqd': 1, - 'search_index': 1 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'due_date', - 'fieldtype': 'Date', - 'idx': 10, - 'label': 'Due Date', - 'oldfieldname': 'due_date', - 'oldfieldtype': 'Date', - 'permlevel': 0, - 'print_hide': 0 - }, - - # DocField - { - 'description': 'The date at which current entry is corrected in the system.', - 'doctype': 'DocField', - 'fieldname': 'amendment_date', - 'fieldtype': 'Date', - 'idx': 11, - 'label': 'Amendment Date', - 'no_copy': 1, - 'oldfieldname': 'amendment_date', - 'oldfieldtype': 'Date', - 'permlevel': 0, - 'print_hide': 1 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'amended_from', - 'fieldtype': 'Link', - 'idx': 12, - 'label': 'Amended From', - 'no_copy': 1, - 'oldfieldname': 'amended_from', - 'oldfieldtype': 'Link', - 'options': 'Journal Voucher', - 'permlevel': 1, - 'print_hide': 1, - 'search_index': 0 - }, - - # DocField - { - 'colour': 'White:FFF', - 'depends_on': "eval:doc.voucher_type == 'Write Off Voucher'", - 'doctype': 'DocField', - 'fieldtype': 'Button', - 'idx': 13, - 'label': 'Get Outstanding Invoices', - 'options': 'get_outstanding_invoices', - 'permlevel': 0, - 'print_hide': 1, - 'trigger': 'Server' - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldtype': 'Column Break', - 'idx': 14, - 'oldfieldtype': 'Column Break', - 'permlevel': 0, - 'width': '50%' - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'cheque_no', - 'fieldtype': 'Data', - 'idx': 15, - 'in_filter': 1, - 'label': 'Cheque No', - 'no_copy': 1, - 'oldfieldname': 'cheque_no', - 'oldfieldtype': 'Data', - 'permlevel': 0, - 'search_index': 0 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'cheque_date', - 'fieldtype': 'Date', - 'idx': 16, - 'label': 'Cheque Date', - 'no_copy': 1, - 'oldfieldname': 'cheque_date', - 'oldfieldtype': 'Date', - 'permlevel': 0 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'clearance_date', - 'fieldtype': 'Date', - 'idx': 17, - 'in_filter': 1, - 'label': 'Clearance Date', - 'no_copy': 1, - 'oldfieldname': 'clearance_date', - 'oldfieldtype': 'Date', - 'permlevel': 1, - 'print_hide': 0, - 'search_index': 0 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'user_remark', - 'fieldtype': 'Small Text', - 'idx': 18, - 'in_filter': 1, - 'label': 'User Remark', - 'no_copy': 1, - 'oldfieldname': 'user_remark', - 'oldfieldtype': 'Small Text', - 'permlevel': 0 - }, - - # DocField - { - 'description': 'User Remark will be added to Auto Remark', - 'doctype': 'DocField', - 'fieldname': 'remark', - 'fieldtype': 'Small Text', - 'idx': 19, - 'label': 'Remark', - 'no_copy': 1, - 'oldfieldname': 'remark', - 'oldfieldtype': 'Small Text', - 'permlevel': 1, - 'reqd': 0 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldtype': 'Section Break', - 'idx': 20, - 'label': '2. Add / Edit GL Entries', - 'oldfieldtype': 'Section Break', - 'options': 'Simple', - 'permlevel': 0 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'entries', - 'fieldtype': 'Table', - 'idx': 21, - 'label': 'Entries', - 'oldfieldname': 'entries', - 'oldfieldtype': 'Table', - 'options': 'Journal Voucher Detail', - 'permlevel': 0, - 'print_hide': 0 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldtype': 'Button', - 'idx': 22, - 'label': 'Get Balance', - 'oldfieldtype': 'Button', - 'permlevel': 0, - 'trigger': 'Client' - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'total_debit', - 'fieldtype': 'Currency', - 'idx': 23, - 'in_filter': 1, - 'label': 'Total Debit', - 'no_copy': 1, - 'oldfieldname': 'total_debit', - 'oldfieldtype': 'Currency', - 'permlevel': 1 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'total_credit', - 'fieldtype': 'Currency', - 'idx': 24, - 'in_filter': 1, - 'label': 'Total Credit', - 'no_copy': 1, - 'oldfieldname': 'total_credit', - 'oldfieldtype': 'Currency', - 'permlevel': 1 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'difference', - 'fieldtype': 'Currency', - 'idx': 25, - 'label': 'Difference', - 'no_copy': 1, - 'oldfieldname': 'difference', - 'oldfieldtype': 'Currency', - 'permlevel': 1, - 'print_hide': 1 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldtype': 'Section Break', - 'idx': 26, - 'label': 'Addtional Info', - 'oldfieldtype': 'Section Break', - 'permlevel': 0 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldtype': 'Column Break', - 'idx': 27, - 'oldfieldtype': 'Column Break', - 'permlevel': 0, - 'width': '50%' - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'bill_no', - 'fieldtype': 'Data', - 'idx': 28, - 'label': 'Bill No', - 'oldfieldname': 'bill_no', - 'oldfieldtype': 'Data', - 'permlevel': 0, - 'print_hide': 1 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'bill_date', - 'fieldtype': 'Date', - 'idx': 29, - 'label': 'Bill Date', - 'oldfieldname': 'bill_date', - 'oldfieldtype': 'Date', - 'permlevel': 0, - 'print_hide': 1 - }, - - # DocField - { - 'colour': 'White:FFF', - 'default': 'No', - 'doctype': 'DocField', - 'fieldname': 'is_opening', - 'fieldtype': 'Select', - 'idx': 30, - 'in_filter': 1, - 'label': 'Is Opening', - 'oldfieldname': 'is_opening', - 'oldfieldtype': 'Select', - 'options': 'No\nYes', - 'permlevel': 0, - 'print_hide': 1, - 'search_index': 0, - 'trigger': 'Client' - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'aging_date', - 'fieldtype': 'Date', - 'idx': 31, - 'label': 'Aging Date', - 'no_copy': 0, - 'oldfieldname': 'aging_date', - 'oldfieldtype': 'Date', - 'permlevel': 0, - 'print_hide': 1 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'cancel_reason', - 'fieldtype': 'Data', - 'idx': 32, - 'label': 'Cancel Reason', - 'no_copy': 1, - 'oldfieldname': 'cancel_reason', - 'oldfieldtype': 'Data', - 'permlevel': 1, - 'print_hide': 1 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'pay_to_recd_from', - 'fieldtype': 'Data', - 'hidden': 0, - 'idx': 33, - 'label': 'Pay To / Recd From', - 'no_copy': 1, - 'permlevel': 0, - 'print_hide': 1, - 'report_hide': 1 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'total_amount', - 'fieldtype': 'Data', - 'hidden': 0, - 'idx': 34, - 'label': 'Total Amount', - 'no_copy': 1, - 'permlevel': 1, - 'print_hide': 1, - 'report_hide': 1 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'total_amount_in_words', - 'fieldtype': 'Data', - 'hidden': 0, - 'idx': 35, - 'label': 'Total Amount in Words', - 'no_copy': 1, - 'permlevel': 1, - 'print_hide': 1, - 'report_hide': 1 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldtype': 'Column Break', - 'idx': 36, - 'oldfieldtype': 'Column Break', - 'permlevel': 0, - 'width': '50%' - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'fiscal_year', - 'fieldtype': 'Select', - 'idx': 37, - 'in_filter': 1, - 'label': 'Fiscal Year', - 'oldfieldname': 'fiscal_year', - 'oldfieldtype': 'Select', - 'options': 'link:Fiscal Year', - 'permlevel': 0, - 'print_hide': 1, - 'reqd': 1, - 'search_index': 0 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'company', - 'fieldtype': 'Link', - 'idx': 38, - 'in_filter': 1, - 'label': 'Company', - 'oldfieldname': 'company', - 'oldfieldtype': 'Link', - 'options': 'Company', - 'permlevel': 0, - 'print_hide': 1, - 'reqd': 1, - 'search_index': 0 - }, - - # DocField - { - 'allow_on_submit': 1, - 'colour': 'White:FFF', - 'doctype': 'DocField', - 'fieldname': 'select_print_heading', - 'fieldtype': 'Link', - 'idx': 39, - 'label': 'Select Print Heading', - 'no_copy': 1, - 'oldfieldname': 'select_print_heading', - 'oldfieldtype': 'Link', - 'options': 'Print Heading', - 'permlevel': 0, - 'print_hide': 1, - 'report_hide': 1, - 'search_index': 0, - 'trigger': 'Client' - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldtype': 'Section Break', - 'idx': 40, - 'oldfieldtype': 'Section Break', - 'options': 'Simple', - 'permlevel': 0 - }, - - # DocField - { - 'allow_on_submit': 1, - 'doctype': 'DocField', - 'fieldtype': 'Button', - 'idx': 41, - 'label': 'View Ledger Entry', - 'oldfieldtype': 'Button', - 'permlevel': 0, - 'print_hide': 1, - 'trigger': 'Client' - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldtype': 'Section Break', - 'idx': 42, - 'label': 'TDS', - 'oldfieldtype': 'Section Break', - 'permlevel': 0, - 'print_hide': 0 - }, - - # DocField - { - 'default': 'No', - 'doctype': 'DocField', - 'fieldname': 'tds_applicable', - 'fieldtype': 'Select', - 'idx': 43, - 'in_filter': 1, - 'label': 'TDS Applicable', - 'no_copy': 1, - 'oldfieldname': 'tds_applicable', - 'oldfieldtype': 'Select', - 'options': '\nYes\nNo', - 'permlevel': 0, - 'print_hide': 1, - 'search_index': 0 - }, - - # DocField - { - 'colour': 'White:FFF', - 'doctype': 'DocField', - 'fieldname': 'tds_category', - 'fieldtype': 'Select', - 'hidden': 0, - 'idx': 44, - 'in_filter': 1, - 'label': 'TDS Category', - 'no_copy': 1, - 'oldfieldname': 'tds_category', - 'oldfieldtype': 'Select', - 'options': 'link:TDS Category', - 'permlevel': 0, - 'print_hide': 1, - 'search_index': 0, - 'trigger': 'Client' - }, - - # DocField - { - 'colour': 'White:FFF', - 'doctype': 'DocField', - 'fieldname': 'supplier_account', - 'fieldtype': 'Link', - 'hidden': 0, - 'idx': 45, - 'label': 'Supplier Account', - 'no_copy': 1, - 'oldfieldname': 'supplier_account', - 'oldfieldtype': 'Link', - 'options': 'Account', - 'permlevel': 0, - 'print_hide': 1, - 'search_index': 0, - 'trigger': 'Client' - }, - - # DocField - { - 'colour': 'White:FFF', - 'doctype': 'DocField', - 'fieldtype': 'Button', - 'idx': 46, - 'label': 'Get TDS', - 'no_copy': 0, - 'oldfieldtype': 'Button', - 'permlevel': 0, - 'trigger': 'Client' - }, - - # DocField - { - 'colour': 'White:FFF', - 'description': 'Tax Code will be populated based on account head mentioned in TDS Category master', - 'doctype': 'DocField', - 'fieldname': 'tax_code', - 'fieldtype': 'Link', - 'idx': 47, - 'label': 'TDS Account Head', - 'no_copy': 1, - 'oldfieldname': 'tax_code', - 'oldfieldtype': 'Link', - 'options': 'Account', - 'permlevel': 0, - 'print_hide': 1, - 'search_index': 0 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'rate', - 'fieldtype': 'Currency', - 'idx': 48, - 'label': 'Rate', - 'no_copy': 1, - 'oldfieldname': 'rate', - 'oldfieldtype': 'Currency', - 'permlevel': 0, - 'print_hide': 1, - 'trigger': 'Client' - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'ded_amount', - 'fieldtype': 'Currency', - 'idx': 49, - 'label': 'Amount', - 'no_copy': 1, - 'oldfieldname': 'ded_amount', - 'oldfieldtype': 'Currency', - 'permlevel': 0, - 'print_hide': 1, - 'trigger': 'Client' - } -] \ No newline at end of file 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