fixed conflict while merging master and live

This commit is contained in:
Nabin Hait 2011-07-28 15:33:42 +05:30
commit f541b746d1
65 changed files with 1980 additions and 1531 deletions

1
.gitignore vendored
View File

@ -1,6 +1,5 @@
*.pyc
*.comp.js
*.txt
.DS_Store
server_tools
patch.log

View File

@ -1,722 +1,441 @@
# 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-28 12:01:10',
'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': 'GL Entry',
'doc_type': 'Reports',
'doctype': 'Module Def Item',
'idx': 33
},
# Module Def Item
{
'display_name': 'Lease Monthly Future Installment Inflows',
'doc_name': 'GL Entry',
'doc_type': 'Reports',
'doctype': 'Module Def Item',
'idx': 34
},
# Module Def Item
{
'display_name': 'Lease Overdue Age Wise',
'doc_name': 'GL Entry',
'doc_type': 'Reports',
'doctype': 'Module Def Item',
'idx': 35
},
# Module Def Item
{
'display_name': 'Lease Overdue List',
'doc_name': 'GL Entry',
'doc_type': 'Reports',
'doctype': 'Module Def Item',
'idx': 36
},
# Module Def Item
{
'display_name': 'Lease Receipts Client Wise',
'doc_name': 'GL Entry',
'doc_type': 'Reports',
'doctype': 'Module Def Item',
'idx': 37
},
# Module Def Item
{
'display_name': 'Lease Receipt Summary Month Wise',
'doc_name': 'GL Entry',
'doc_type': 'Reports',
'doctype': 'Module Def Item',
'idx': 38
},
# Module Def Item
{
'display_name': 'Lease Yearly Future Installment Inflows',
'doc_name': 'GL Entry',
'doc_type': 'Reports',
'doctype': 'Module Def Item',
'idx': 39
},
# 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'
}
]

View File

@ -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)

View File

@ -425,3 +425,4 @@ In Account := %s User := %s has Repaired Outstanding Amount For %s : %s and foll
fy_obj = get_obj('Fiscal Year', fy[0])
for a in set(ac_list):
fy_obj.repost(a)

View File

@ -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'
}
]

View File

@ -0,0 +1,78 @@
$.extend(cur_frm.cscript, {
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<flt(doc.invoice_amount)-flt(doc.down_payment)){
d = LocalDB.add_child(doc, 'Lease Installment', 'installments');
d.amount = flt(doc.installment_amount) < flt(doc.invoice_amount)-flt(doc.down_payment)-tot ? flt(doc.installment_amount) : flt(doc.invoice_amount)-flt(doc.down_payment)-tot
d.due_date = dateutil.add_months(doc.start_date, i+1);
tot += flt(doc.installment_amount)
i++;
}
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('Lease Installment', doc.name, 'installments', 'Lease Agreement'),
function(i, d) {
LocalDB.delete_doc('Lease Installment', d.name);
}
)
},
no_of_installments: function(doc)
{
if(flt(doc.no_of_installments)!=0) {
doc.installment_amount = (flt(doc.invoice_amount)- flt(doc.down_payment))/flt(doc.no_of_installments);
refresh_field('installment_amount');
}
},
'Installment Reciept': function(doc, dt, dn) {
var d = new wn.widgets.Dialog({
width: 500,
title: 'Add a new payment installment',
fields: [
{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(make_doclist(dt,dn),'lease_installment_post',data,function(){cur_frm.refresh(); d.hide();});
}
}
}
})
cur_frm.add_fetch('invoice','grand_total','invoice_amount');
cur_frm.fields_dict.invoice.get_query=function(doc){
return "SELECT tv.name FROM `tabReceivable Voucher` tv WHERE debit_to='"+doc.account+"' and tv.%(key)s like '%s' ORDER BY tv.name LIMIT 50"
}

View File

@ -0,0 +1,37 @@
import webnotes
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 Lease Id using naming_series pattern
"""
self.doc.name = make_autoname(self.doc.naming_series+ '.#####')
def lease_installment_post(self, args):
"""
Posts the Installment receipt into Journal Voucher
"""
next_inst = sql("select amount,name from `tabLease Installment` where parent=%s and ifnull(cheque_number,'')='' order by due_date limit 1",self.doc.name)
data = json.loads(args)
data['voucher_type']='Lease 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 `tabLease 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]

View File

@ -0,0 +1,310 @@
# DocType, Lease Agreement
[
# These values are common in all dictionaries
{
'creation': '2011-07-22 17:47:57',
'docstatus': 0,
'modified': '2011-07-27 15:33:55',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all DocType
{
'_last_update': '1311555967',
'colour': 'White:FFF',
'doctype': 'DocType',
'module': 'Accounts',
'name': '__common__',
'section_style': 'Simple',
'show_in_menu': 0,
'version': 21
},
# 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
},
# DocType, Lease Agreement
{
'doctype': 'DocType',
'name': 'Lease Agreement'
},
# DocPerm
{
'cancel': 1,
'create': 1,
'doctype': 'DocPerm',
'idx': 1,
'permlevel': 0,
'role': 'Accounts User',
'submit': 1,
'write': 1
},
# DocPerm
{
'doctype': 'DocPerm',
'idx': 2,
'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
{
'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': 'Lessee 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
}
]

View File

@ -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
}
]

View File

View File

@ -0,0 +1,54 @@
$.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();
},
/* 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');
} 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:'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(make_doclist(dt,dn),'loan_installment_post',data,function(){cur_frm.refresh(); d.hide();});
}
}
}
})

View File

@ -0,0 +1,48 @@
import webnotes
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):
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
"""
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)
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]))
self.doclist = [Document(d.doctype, d.name) for d in self.doclist]

View File

@ -0,0 +1,172 @@
# DocType, Loan
[
# These values are common in all dictionaries
{
'creation': '2011-07-15 10:35:26',
'docstatus': 0,
'modified': '2011-07-18 12:12:19',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all DocType
{
'_last_update': '1310963215',
'colour': 'White:FFF',
'doctype': 'DocType',
'module': 'Accounts',
'name': '__common__',
'section_style': 'Simple',
'show_in_menu': 0,
'version': 15
},
# 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
{
'doctype': 'DocPerm',
'name': '__common__',
'parent': 'Loan',
'parentfield': 'permissions',
'parenttype': 'DocType',
'read': 1,
'role': 'Accounts User'
},
# DocType, Loan
{
'doctype': 'DocType',
'name': 'Loan'
},
# 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': '\nLOAN',
'reqd': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'account',
'fieldtype': 'Link',
'idx': 2,
'label': 'Account',
'options': 'Account',
'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': 5,
'label': 'Loan Amount',
'reqd': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'start_date',
'fieldtype': 'Date',
'idx': 6,
'label': 'Start Date',
'reqd': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'no_of_installments',
'fieldtype': 'Int',
'idx': 7,
'label': 'No of Installments',
'reqd': 1
},
# DocField
{
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldtype': 'Button',
'idx': 8,
'label': 'Generate',
'trigger': 'Client'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'installments',
'fieldtype': 'Table',
'idx': 9,
'label': 'Installments',
'options': 'Loan Installment'
},
# DocField
{
'allow_on_submit': 1,
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldtype': 'Button',
'idx': 10,
'label': 'Installment Reciept'
}
]

View File

@ -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()

View File

@ -0,0 +1,111 @@
# DocType, Loan Installment
[
# These values are common in all dictionaries
{
'creation': '2011-07-15 10:36:42',
'docstatus': 0,
'modified': '2011-07-15 15:48:34',
'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': 4
},
# These values are common for all DocField
{
'doctype': 'DocField',
'name': '__common__',
'parent': 'Loan Installment',
'parentfield': 'fields',
'parenttype': 'DocType'
},
# DocType, Loan Installment
{
'doctype': 'DocType',
'name': 'Loan 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': 'deposit_date',
'fieldtype': 'Date',
'idx': 5,
'label': 'Deposit Date',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'realized_date',
'fieldtype': 'Date',
'idx': 6,
'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
}
]

View File

@ -19,4 +19,4 @@ report.customize_filters = function() {
this.dt.set_no_limit(1);
}
this.mytabs.items['Select Columns'].hide()
//this.mytabs.items['Select Columns'].hide()

View File

@ -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']);

View File

@ -0,0 +1,13 @@
data =[
['Agreement No.','Data','100px',''],
['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

View File

@ -0,0 +1,3 @@
select la.name, la.account, la.invoice_amount
from `tabLease Agreement` la
where start_date between '%(date)s' and '%(date1)s' order by la.name

View File

@ -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'
}
]

View File

@ -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']);

View File

@ -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

View File

@ -0,0 +1,9 @@
select date_format(due_date,'%M') as mnt,year(due_date),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 date_format(due_date,'%M-%Y')
order by year(due_date),month(due_date)

View File

@ -0,0 +1,30 @@
# Search Criteria, lease_monthly_future_installment_inflows
[
# These values are common in all dictionaries
{
'creation': '2011-07-27 13:14:29',
'docstatus': 0,
'modified': '2011-07-27 13:14:29',
'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'
}
]

View File

@ -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']);

View File

@ -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

View File

@ -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) and (lai.cheque_date is null or lai.cheque_date > cast('%(date)s' as date))
order by cast('%(date)s' as date)-due_date desc

View File

@ -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'
}
]

View File

@ -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']);

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,30 @@
# Search Criteria, lease_overdue_age_wise
[
# These values are common in all dictionaries
{
'creation': '2011-07-27 13:14:29',
'docstatus': 0,
'modified': '2011-07-27 13:14:29',
'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'
}
]

View File

@ -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']);

View File

@ -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

View File

@ -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)

View File

@ -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'
}
]

View File

@ -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']);

View File

@ -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

View File

@ -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

View File

@ -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'
}
]

View File

@ -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']);

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,30 @@
# Search Criteria, lease_yearly_future_installment_inflows
[
# These values are common in all dictionaries
{
'creation': '2011-07-27 13:14:29',
'docstatus': 0,
'modified': '2011-07-27 13:14:29',
'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'
}
]

View File

@ -0,0 +1,27 @@
from webnotes.model.doc import make_autoname, Document, addchild
# Posts JV
def post_jv(data):
jv = Document('Journal Voucher')
jv.voucher_type = data.get('voucher_type')
jv.naming_series = data.get('naming_series')
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 = data.get('fiscal_year') # To be modified to take care
jv.company = data.get('company')
jv.save(1)
jc = addchild(jv,'entries','Journal Voucher Detail',0)
jc.account = data.get('debit_account')
jc.debit = data.get('amount')
jc.save()
jc = addchild(jv,'entries','Journal Voucher Detail',0)
jc.account = data.get('credit_account')
jc.credit = data.get('amount')
jc.save()
return jv.name

View File

@ -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())

View File

@ -1,2 +1,3 @@
msgprint(colwidths)
colwidths[col_idx['Pending Quantity To Receive']] = '200px'
colwidths[col_idx['Pending Amount To Receive']] = '200px'

View File

@ -5,7 +5,7 @@
{
'creation': '2010-08-08 17:09:20',
'docstatus': 0,
'modified': '2011-07-18 15:30:04',
'modified': '2011-07-27 13:10:28',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
@ -21,7 +21,7 @@
'server_code_error': ' ',
'show_in_menu': 0,
'subject': 'For %(employee_name)s, %(designation)s',
'version': 392
'version': 393
},
# These values are common for all DocField
@ -55,44 +55,10 @@
'cancel': 0,
'create': 0,
'doctype': 'DocPerm',
'idx': 1,
'match': 'owner',
'permlevel': 0,
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': 'DocPerm',
'match': 'owner',
'permlevel': 0,
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': 'DocPerm',
'match': 'owner',
'permlevel': 0,
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': 'DocPerm',
'match': 'owner',
'permlevel': 0,
'role': 'Employee',
'submit': 0,
'write': 0
},
@ -102,7 +68,7 @@
'amend': 0,
'create': 1,
'doctype': 'DocPerm',
'idx': 3,
'idx': 2,
'permlevel': 0,
'role': 'HR User',
'submit': 1,
@ -115,7 +81,7 @@
'cancel': 1,
'create': 1,
'doctype': 'DocPerm',
'idx': 4,
'idx': 3,
'permlevel': 0,
'role': 'HR Manager',
'submit': 1,
@ -125,7 +91,7 @@
# DocPerm
{
'doctype': 'DocPerm',
'idx': 5,
'idx': 4,
'permlevel': 1,
'role': 'HR User'
},
@ -133,7 +99,7 @@
# DocPerm
{
'doctype': 'DocPerm',
'idx': 6,
'idx': 5,
'permlevel': 1,
'role': 'HR Manager'
},
@ -285,28 +251,6 @@
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'letter_head',
'fieldtype': 'Link',
'idx': 11,
'label': 'Letter Head',
'options': 'Letter Head',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'letter_head',
'fieldtype': 'Link',
'idx': 11,
'label': 'Letter Head',
'options': 'Letter Head',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
@ -347,32 +291,6 @@
'reqd': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'company',
'fieldtype': 'Select',
'idx': 14,
'in_filter': 1,
'label': 'Company',
'options': 'link:Company',
'permlevel': 0,
'reqd': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'company',
'fieldtype': 'Select',
'idx': 14,
'in_filter': 1,
'label': 'Company',
'options': 'link:Company',
'permlevel': 0,
'reqd': 1
},
# DocField
{
'colour': 'White:FFF',

View File

@ -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")

View File

@ -1,7 +1,7 @@
# REMEMBER to update this
# ========================
last_patch = 329
last_patch = 332
#-------------------------------------------
@ -56,7 +56,6 @@ def execute(patch_no):
pass
elif patch_no == 40:
import_from_files(record_list=[['stock','doctype','item']])
elif patch_no == 42:
acc = sql("select name, lft, rgt from tabAccount where account_name in ('Incomes', 'Expenses')")
@ -125,7 +124,6 @@ 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=[['selling','doctype','sales_order_detail']])
elif patch_no == 58:
# module def patches
@ -160,7 +158,6 @@ 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=[['buying','doctype','supplier_quotation']])
# Adding Status Filter
sql("update tabDocType set search_fields = concat('status,',search_fields) where name IN ('Delivery Note','Leave Transaction')")
@ -169,7 +166,6 @@ def execute(patch_no):
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'], ['stock', 'doctype', 'sales_and_purchase_return_wizard'], ['stock', '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')")
@ -351,7 +347,6 @@ 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=[['hr','doctype','leave_application'],['hr','doctype','leave_allocation'],['hr','doctype','leave_control_panel'],['hr','doctype','holiday_list'],['hr','doctype','holiday_list_detail'],['hr','Module Def','Payroll']])
elif patch_no == 80:
# Holiday List
@ -405,7 +400,6 @@ def execute(patch_no):
elif patch_no == 81:
# Import Modules
import_from_files(record_list=[['hr','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 +426,11 @@ 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=[['hr','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=[['hr','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 +449,8 @@ 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=[['selling','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 +480,6 @@ 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=[['hr','search_criteria','stdsrch_00001'],['hr','search_criteria','stdsrch_00002'],['hr','search_criteria','stdsrch_00003'],['hr','Module Def','Payroll'],['hr','doctype','leave_application'],['hr','doctype','leave_allocation']])
elif patch_no == 105:
# Employee Leave Balance
@ -951,7 +940,6 @@ def execute(patch_no):
elif patch_no == 239:
reload_doc('core', 'doctype', 'docfield')
reload_doc('core', 'doctype', 'doctype')
from patches.old_patches.feed_patch import set_subjects_and_tagfields
set_subjects_and_tagfields()
elif patch_no == 240:
@ -1328,3 +1316,23 @@ 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_over_due_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')
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)
elif patch_no == 332:
sql("update `tabDocField` set permlevel=1, hidden = 1 where parent = 'Bulk Rename Tool' and fieldname = 'file_list'")

View File

@ -0,0 +1,18 @@
//--------- ONLOAD -------------
cur_frm.cscript.onload = function(doc, cdt, cdn) {
}
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
if(!doc.file_list) {
set_field_options('Upload Accounts Transactions Help', '<div class="help_box">To upload transactions, please attach a (.csv) file with 5 columns - <b>Date, Transaction Number, Account, Debit Amount, Credit Amount</b> (no headings necessary). See attachments box in the right column</div>')
} else {
set_field_options('Upload Accounts Transactions Help', '<div class="help_box">To update transactions from the attachment, please click on "Upload Accounts Transactions"</div>')
}
}
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) { });
}
}

View File

@ -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("<b>%s</b> 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

View File

@ -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': '<div class="help_box">\n<b>Upload Account Transactions Help</b>\n<p>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</div>'
},
# 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'
}
]

View File

@ -3,9 +3,9 @@
# 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'
},