Merge branch 'master' of github.com:webnotes/erpnext

This commit is contained in:
Rushabh Mehta
2011-07-27 15:40:17 +05:30
124 changed files with 1717 additions and 1451 deletions

1
.gitignore vendored
View File

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

View File

@@ -5,7 +5,7 @@
{ {
'creation': '2010-09-25 10:50:34', 'creation': '2010-09-25 10:50:34',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-07-15 10:43:04', 'modified': '2011-07-27 11:43:40',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
@@ -40,7 +40,7 @@
'module_icon': 'Accounts.gif', 'module_icon': 'Accounts.gif',
'module_label': 'Accounts', 'module_label': 'Accounts',
'module_name': 'Accounts', 'module_name': 'Accounts',
'module_seq': 5, 'module_seq': 3,
'name': '__common__' 'name': '__common__'
}, },
@@ -107,8 +107,9 @@
# Module Def Item # Module Def Item
{ {
'display_name': 'Loan', 'description': 'Lease Agreement for Vehicles',
'doc_name': 'Loan', 'display_name': 'Lease Agreement',
'doc_name': 'Lease Agreement',
'doc_type': 'Forms', 'doc_type': 'Forms',
'doctype': 'Module Def Item', 'doctype': 'Module Def Item',
'idx': 6 'idx': 6
@@ -354,6 +355,69 @@
'idx': 32 '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 Item
{
'display_name': 'Lease Monthly Future Installment Inflows',
'doc_name': 'Lease Monthly Future Installment Inflows',
'doc_type': 'Reports',
'doctype': 'Module Def Item',
'idx': 34
},
# Module Def Item
{
'display_name': 'Lease Overdue Age Wise',
'doc_name': 'Lease Overdue Age Wise',
'doc_type': 'Reports',
'doctype': 'Module Def Item',
'idx': 35
},
# Module Def Item
{
'display_name': 'Lease Overdue List',
'doc_name': 'Lease Overdue List',
'doc_type': 'Reports',
'doctype': 'Module Def Item',
'idx': 36
},
# Module Def Item
{
'display_name': 'Lease Receipts Client Wise',
'doc_name': 'Lease Receipts Client Wise',
'doc_type': 'Reports',
'doctype': 'Module Def Item',
'idx': 37
},
# Module Def Item
{
'display_name': 'Lease Receipt Summary Year to Date',
'doc_name': 'Lease Receipt Summary Year to Date',
'doc_type': 'Reports',
'doctype': 'Module Def Item',
'idx': 38
},
# Module Def Item
{
'display_name': 'Lease Yearly Future Installment Inflows',
'doc_name': 'Lease Yearly Future Installment Inflows',
'doc_type': 'Reports',
'doctype': 'Module Def Item',
'idx': 39
},
# Module Def Role # Module Def Role
{ {
'doctype': 'Module Def Role', 'doctype': 'Module Def Role',

View File

@@ -12,7 +12,7 @@
# These values are common for all DocType # These values are common for all DocType
{ {
'_last_update': '1308829300', '_last_update': '1309508836',
'allow_copy': 1, 'allow_copy': 1,
'allow_trash': 1, 'allow_trash': 1,
'colour': 'White:FFF', 'colour': 'White:FFF',
@@ -179,7 +179,7 @@
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
'permlevel': 1, 'permlevel': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -225,7 +225,7 @@
'options': '\nLedger\nGroup', 'options': '\nLedger\nGroup',
'permlevel': 1, 'permlevel': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -259,7 +259,7 @@
'oldfieldname': 'debit_or_credit', 'oldfieldname': 'debit_or_credit',
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
'permlevel': 1, 'permlevel': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -274,7 +274,7 @@
'oldfieldtype': 'Select', 'oldfieldtype': 'Select',
'options': 'Yes\nNo', 'options': 'Yes\nNo',
'permlevel': 1, 'permlevel': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -344,7 +344,7 @@
'options': 'Company', 'options': 'Company',
'permlevel': 1, 'permlevel': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField

View File

@@ -174,7 +174,7 @@
'oldfieldname': 'fiscal_year', 'oldfieldname': 'fiscal_year',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Fiscal Year', 'options': 'Fiscal Year',
'search_index': 1 'search_index': 0
}, },
# DocField # DocField

View File

@@ -182,6 +182,7 @@
'options': 'Company', 'options': 'Company',
'permlevel': 0, 'permlevel': 0,
'reqd': 1, 'reqd': 1,
'search_index': 0,
'trigger': 'Client' 'trigger': 'Client'
}, },
@@ -227,7 +228,8 @@
'oldfieldname': 'distribution_id', 'oldfieldname': 'distribution_id',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Budget Distribution', 'options': 'Budget Distribution',
'permlevel': 0 'permlevel': 0,
'search_index': 0
}, },
# DocField # DocField

View File

@@ -182,7 +182,7 @@
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Company', 'options': 'Company',
'permlevel': 0, 'permlevel': 0,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField

View File

@@ -12,7 +12,7 @@
# These values are common for all DocType # These values are common for all DocType
{ {
'_last_update': '1294312170', '_last_update': '1309508838',
'autoname': 'GL.#######', 'autoname': 'GL.#######',
'colour': 'White:FFF', 'colour': 'White:FFF',
'doctype': 'DocType', 'doctype': 'DocType',
@@ -119,7 +119,7 @@
'label': 'Aging Date', 'label': 'Aging Date',
'oldfieldname': 'aging_date', 'oldfieldname': 'aging_date',
'oldfieldtype': 'Date', 'oldfieldtype': 'Date',
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -221,7 +221,7 @@
'oldfieldname': 'voucher_type', 'oldfieldname': 'voucher_type',
'oldfieldtype': 'Select', 'oldfieldtype': 'Select',
'options': 'Journal Voucher\nReceivable Voucher\nPayable Voucher', 'options': 'Journal Voucher\nReceivable Voucher\nPayable Voucher',
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -262,7 +262,7 @@
'oldfieldname': 'is_cancelled', 'oldfieldname': 'is_cancelled',
'oldfieldtype': 'Select', 'oldfieldtype': 'Select',
'options': 'No\nYes', 'options': 'No\nYes',
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -276,7 +276,7 @@
'oldfieldname': 'is_opening', 'oldfieldname': 'is_opening',
'oldfieldtype': 'Select', 'oldfieldtype': 'Select',
'options': 'No\nYes', 'options': 'No\nYes',
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -304,7 +304,7 @@
'oldfieldname': 'fiscal_year', 'oldfieldname': 'fiscal_year',
'oldfieldtype': 'Select', 'oldfieldtype': 'Select',
'options': 'link:Fiscal Year', 'options': 'link:Fiscal Year',
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -318,6 +318,6 @@
'oldfieldname': 'company', 'oldfieldname': 'company',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Company', 'options': 'Company',
'search_index': 1 'search_index': 0
} }
] ]

View File

@@ -1,802 +0,0 @@
# DocType, Journal Voucher
[
# These values are common in all dictionaries
{
'creation': '2010-08-08 17:09:06',
'docstatus': 0,
'modified': '2011-07-15 14:37:05',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all DocType
{
'_last_update': '1310533805',
'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': 308
},
# These values are common for all DocField
{
'doctype': 'DocField',
'name': '__common__',
'parent': 'Journal Voucher',
'parentfield': 'fields',
'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
},
# 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\nLoan Receipt',
'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': 1
},
# 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
},
# 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': 1
},
# 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': 1
},
# 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': 1,
'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': 1
},
# 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': 1
},
# 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,
'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': 1
},
# 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': 1,
'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,
'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
},
# 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

@@ -69,7 +69,7 @@
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Cost Center', 'options': 'Cost Center',
'permlevel': 0, 'permlevel': 0,
'search_index': 1, 'search_index': 0,
'width': '180px' 'width': '180px'
}, },

View File

@@ -0,0 +1,66 @@
$.extend(cur_frm.cscript, {
Generate: function(doc, dt, dn) {
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 12:54:48',
'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': 20
},
# 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': '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

@@ -12,7 +12,7 @@
# These values are common for all DocType # These values are common for all DocType
{ {
'_last_update': '1308741898', '_last_update': '1309508838',
'colour': 'White:FFF', 'colour': 'White:FFF',
'doctype': 'DocType', 'doctype': 'DocType',
'module': 'Accounts', 'module': 'Accounts',
@@ -221,6 +221,7 @@
'options': 'Supplier', 'options': 'Supplier',
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'search_index': 1,
'trigger': 'Client' 'trigger': 'Client'
}, },
@@ -326,7 +327,7 @@
'oldfieldtype': 'Date', 'oldfieldtype': 'Date',
'permlevel': 0, 'permlevel': 0,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -342,7 +343,7 @@
'oldfieldtype': 'Date', 'oldfieldtype': 'Date',
'permlevel': 0, 'permlevel': 0,
'print_hide': 0, 'print_hide': 0,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -378,7 +379,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -394,7 +395,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 0, 'reqd': 0,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -690,7 +691,7 @@
'options': 'No\nYes', 'options': 'No\nYes',
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'search_index': 1, 'search_index': 0,
'trigger': 'Client' 'trigger': 'Client'
}, },
@@ -768,7 +769,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -785,7 +786,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -1084,7 +1085,7 @@
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField

View File

@@ -147,7 +147,8 @@
'oldfieldtype': 'Select', 'oldfieldtype': 'Select',
'options': 'link:Fiscal Year', 'options': 'link:Fiscal Year',
'permlevel': 0, 'permlevel': 0,
'reqd': 1 'reqd': 1,
'search_index': 1
}, },
# DocField # DocField

View File

@@ -172,7 +172,8 @@
'oldfieldname': 'company', 'oldfieldname': 'company',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Company', 'options': 'Company',
'reqd': 1 'reqd': 1,
'search_index': 0
}, },
# DocField # DocField
@@ -193,7 +194,8 @@
'oldfieldname': 'customer_account', 'oldfieldname': 'customer_account',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Account', 'options': 'Account',
'reqd': 0 'reqd': 0,
'search_index': 0
}, },
# DocField # DocField
@@ -206,7 +208,8 @@
'oldfieldname': 'cash_bank_account', 'oldfieldname': 'cash_bank_account',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Account', 'options': 'Account',
'reqd': 1 'reqd': 1,
'search_index': 0
}, },
# DocField # DocField
@@ -219,7 +222,8 @@
'oldfieldname': 'income_account', 'oldfieldname': 'income_account',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Account', 'options': 'Account',
'reqd': 1 'reqd': 1,
'search_index': 0
}, },
# DocField # DocField
@@ -232,7 +236,8 @@
'oldfieldname': 'warehouse', 'oldfieldname': 'warehouse',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Warehouse', 'options': 'Warehouse',
'reqd': 1 'reqd': 1,
'search_index': 0
}, },
# DocField # DocField
@@ -245,7 +250,8 @@
'oldfieldname': 'cost_center', 'oldfieldname': 'cost_center',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Cost Center', 'options': 'Cost Center',
'reqd': 1 'reqd': 1,
'search_index': 0
}, },
# DocField # DocField
@@ -257,7 +263,8 @@
'label': 'Charge', 'label': 'Charge',
'oldfieldname': 'charge', 'oldfieldname': 'charge',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Other Charges' 'options': 'Other Charges',
'search_index': 0
}, },
# DocField # DocField
@@ -282,7 +289,8 @@
'label': 'Terms', 'label': 'Terms',
'oldfieldname': 'tc_name', 'oldfieldname': 'tc_name',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Term' 'options': 'Term',
'search_index': 0
}, },
# DocField # DocField

View File

@@ -151,6 +151,7 @@
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Cost Center', 'options': 'Cost Center',
'permlevel': 0, 'permlevel': 0,
'search_index': 0,
'trigger': 'Client' 'trigger': 'Client'
}, },

View File

@@ -111,7 +111,7 @@
'options': 'Item Group', 'options': 'Item Group',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField

View File

@@ -12,7 +12,7 @@
# These values are common for all DocType # These values are common for all DocType
{ {
'_last_update': '1308741898', '_last_update': '1309508839',
'change_log': '1. Change in pull_details method dt.-26-06-2009', 'change_log': '1. Change in pull_details method dt.-26-06-2009',
'colour': 'White:FFF', 'colour': 'White:FFF',
'doctype': 'DocType', 'doctype': 'DocType',
@@ -323,7 +323,7 @@
'oldfieldtype': 'Date', 'oldfieldtype': 'Date',
'permlevel': 0, 'permlevel': 0,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -342,7 +342,7 @@
'oldfieldtype': 'Date', 'oldfieldtype': 'Date',
'permlevel': 0, 'permlevel': 0,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -433,7 +433,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -903,7 +903,7 @@
'options': 'No\nYes', 'options': 'No\nYes',
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'search_index': 1, 'search_index': 0,
'trigger': 'Client' 'trigger': 'Client'
}, },
@@ -1027,7 +1027,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -1045,7 +1045,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -1116,7 +1116,7 @@
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField

View File

@@ -243,6 +243,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1,
'trigger': 'Client', 'trigger': 'Client',
'width': '120px' 'width': '120px'
}, },
@@ -262,6 +263,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 0, 'reqd': 0,
'search_index': 1,
'trigger': 'Client', 'trigger': 'Client',
'width': '120px' 'width': '120px'
}, },

View File

@@ -80,7 +80,8 @@
'oldfieldname': 'cost_center_other_charges', 'oldfieldname': 'cost_center_other_charges',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Cost Center', 'options': 'Cost Center',
'permlevel': 0 'permlevel': 0,
'search_index': 0
}, },
# DocField # DocField

View File

@@ -51,7 +51,7 @@
'label': 'Company', 'label': 'Company',
'oldfieldname': 'company', 'oldfieldname': 'company',
'options': 'Company', 'options': 'Company',
'search_index': 1 'search_index': 0
}, },
# DocField # DocField

View File

@@ -207,7 +207,7 @@
'options': 'link:Fiscal Year', 'options': 'link:Fiscal Year',
'permlevel': 0, 'permlevel': 0,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -269,7 +269,7 @@
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Company', 'options': 'Company',
'permlevel': 0, 'permlevel': 0,
'search_index': 1, 'search_index': 0,
'trigger': 'Client' 'trigger': 'Client'
}, },

View File

@@ -2,134 +2,145 @@
# ------------------------------------------------------------------ # ------------------------------------------------------------------
if not filter_values.get('posting_date') or not filter_values.get('posting_date1'): if not filter_values.get('posting_date') or not filter_values.get('posting_date1'):
msgprint("Please select From Posting Date and To Posting Date ") msgprint("Please select From Posting Date and To Posting Date ")
raise Exception raise Exception
else: else:
from_date = filter_values.get('posting_date') from_date = filter_values.get('posting_date')
to_date = filter_values.get('posting_date1') to_date = filter_values.get('posting_date1')
if not filter_values['range_1'] or not filter_values['range_2'] or not filter_values['range_3'] or not filter_values['range_4']: if not filter_values['range_1'] or not filter_values['range_2'] or not filter_values['range_3'] or not filter_values['range_4']:
msgprint("Please select aging ranges in no of days in 'More Filters' ") msgprint("Please select aging ranges in no of days in 'More Filters' ")
raise Exception raise Exception
# validate Range # validate Range
range_list = ['range_1','range_2','range_3','range_4'] range_list = ['range_1','range_2','range_3','range_4']
for r in range(len(range_list)-1): for r in range(len(range_list)-1):
if not cint(filter_values[range_list[r]]) < cint(filter_values[range_list[r + 1]]): if not cint(filter_values[range_list[r]]) < cint(filter_values[range_list[r + 1]]):
msgprint("Range %s should be less than Range %s." % (cstr(r+1),cstr(r+2))) msgprint("Range %s should be less than Range %s." % (cstr(r+1),cstr(r+2)))
raise Exception raise Exception
# Add columns # Add columns
# ------------------------------------------------------------------ # ------------------------------------------------------------------
data = [['Aging Date','Date','80px',''], data = [['Aging Date','Date','80px',''],
['Transaction Date','Date','80px',''], ['Transaction Date','Date','80px',''],
['Account','Data','120px',''], ['Account','Data','120px',''],
['Against Voucher Type','Data','120px',''], ['Against Voucher Type','Data','120px',''],
['Against Voucher','Data','120px',''], ['Against Voucher','Data','120px',''],
['Voucher Type','Data','120px',''], ['Voucher Type','Data','120px',''],
['Voucher No','Data','120px',''], ['Voucher No','Data','120px',''],
['Remarks','Data','160px',''], ['Remarks','Data','160px',''],
['Supplier Type', 'Data', '80px', ''], ['Supplier Type', 'Data', '80px', ''],
['Due Date', 'Data', '80px', ''], ['Due Date', 'Data', '80px', ''],
['Bill No','Data','80px',''], ['Bill No','Data','80px',''],
['Bill Date','Data','80px',''], ['Bill Date','Data','80px',''],
['Opening Amt','Currency','120px',''], ['Opening Amt','Currency','120px',''],
['Outstanding Amt','Currency','120px',''], ['Outstanding Amt','Currency','120px',''],
['Age (Days)', 'Currency', '150px', ''], ['Age (Days)', 'Currency', '150px', ''],
['0-'+cstr(filter_values['range_1']),'Currency','100px',''], ['0-'+cstr(filter_values['range_1']),'Currency','100px',''],
[cstr(cint(filter_values['range_1']) + 1)+ '-' +cstr(filter_values['range_2']),'Currency','100px',''], [cstr(cint(filter_values['range_1']) + 1)+ '-' +cstr(filter_values['range_2']),'Currency','100px',''],
[cstr(cint(filter_values['range_2']) + 1)+ '-' +cstr(filter_values['range_3']),'Currency','100px',''], [cstr(cint(filter_values['range_2']) + 1)+ '-' +cstr(filter_values['range_3']),'Currency','100px',''],
[cstr(cint(filter_values['range_3']) + 1)+ '-' +cstr(filter_values['range_4']),'Currency','100px',''], [cstr(cint(filter_values['range_3']) + 1)+ '-' +cstr(filter_values['range_4']),'Currency','100px',''],
[cstr(filter_values['range_4']) + '-Above','Currency','100px','']] [cstr(filter_values['range_4']) + '-Above','Currency','100px','']]
for d in data: for d in data:
colnames.append(d[0]) colnames.append(d[0])
coltypes.append(d[1]) coltypes.append(d[1])
colwidths.append(d[2]) colwidths.append(d[2])
coloptions.append(d[3]) coloptions.append(d[3])
col_idx[d[0]] = len(colnames)-1 col_idx[d[0]] = len(colnames)-1
# ageing based on # ageing based on
# ------------------------------------------------------------------ # ------------------------------------------------------------------
aging_based_on = 'Aging Date' aging_based_on = 'Aging Date'
if filter_values.has_key('aging_based_on') and filter_values['aging_based_on']: if filter_values.has_key('aging_based_on') and filter_values['aging_based_on']:
aging_based_on = filter_values['aging_based_on'].split(NEWLINE)[-1] aging_based_on = filter_values['aging_based_on'].split(NEWLINE)[-1]
if len(res) > 600 and from_export == 0: if len(res) > 600 and from_export == 0:
msgprint("This is a very large report and cannot be shown in the browser as it is likely to make your browser very slow.Please select Account or click on 'Export' to open in excel") msgprint("This is a very large report and cannot be shown in the browser as it is likely to make your browser very slow.Please select Account or click on 'Export' to open in excel")
raise Exception raise Exception
# ------------------------------------------------------------------ # ------------------------------------------------------------------
# main loop starts here # main loop starts here
# ------------------------------------------------------------------ # ------------------------------------------------------------------
# get supplier type
supp_type_dict = {}
for each in sql("select t2.name, t1.supplier_type from tabSupplier t1, tabAccount t2 where t1.name = t2.account_name group by t2.name"):
supp_type_dict[each[0]] = each[1]
# get due_date, bill_no, bill_date from PV
pv_dict = {}
for t in sql("select name, due_date, bill_no, bill_date from `tabPayable Voucher` group by name"):
pv_dict[t[0]] = [cstr(t[1]), t[2], cstr(t[3])]
# pv outside this period
pv_outside_period = [d[0] for d in sql("select distinct name from `tabPayable Voucher` where (posting_date < '%s' or posting_date > '%s') and docstatus = 1" % (from_date, to_date))]
out = [] out = []
total_booking_amt, total_outstanding_amt = 0,0 total_booking_amt, total_outstanding_amt = 0,0
for r in res: for r in res:
# get supplier type outstanding_amt, due_date, bill_no, bill_date, cond = 0, '','','', ''
supplier_type = sql("select t1.supplier_type from tabSupplier t1, tabAccount t2 where t1.name = t2.account_name and t2.name = '%s'" % r[col_idx['Account']]) booking_amt = r.pop(8)
r.append(supplier_type and cstr(supplier_type[0][0]) or '')
outstanding_amt, booking_amt, due_date, bill_no, bill_date, cond = 0,0, '','','', '' # supplier type
r.append(supp_type_dict.get(r[col_idx['Account']], ''))
# if entry against Payable Voucher # if entry against Payable Voucher
if r[col_idx['Against Voucher']] and r[col_idx['Voucher Type']] == 'Payable Voucher': if r[col_idx['Against Voucher']] and r[col_idx['Voucher Type']] == 'Payable Voucher':
due_date, bill_no, bill_date = [cstr(t) for t in sql("select due_date,bill_no,bill_date from `tabPayable Voucher` where name = %s", r[col_idx['Voucher No']])[0]] r += pv_dict.get(r[col_idx['Voucher No']], ['', '', ''])
cond = " and ifnull(against_voucher, '') = '%s'" % r[col_idx['Against Voucher']]
# get opening # if entry against JV & and not adjusted within period
booking_amt = sql("select credit from `tabGL Entry` where account = %s and voucher_no = %s and is_cancelled = 'No'", (r[col_idx['Account']], r[col_idx['Voucher No']])) elif r[col_idx['Against Voucher Type']] == 'Payable Voucher' and r[col_idx['Against Voucher']] in pv_outside_period:
booking_amt = booking_amt and flt(booking_amt[0][0]) or 0 booking_amt = 0
cond = " and voucher_no = '%s' and ifnull(against_voucher, '') = '%s'" % (r[col_idx['Voucher No']], r[col_idx['Against Voucher']])
cond = " and against_voucher = '%s' and against_voucher is not null" % r[col_idx['Against Voucher']] # if un-adjusted
elif not r[col_idx['Against Voucher']]:
booking_amt = 0
cond = " and ((voucher_no = '%s' and ifnull(against_voucher, '') = '') or (ifnull(against_voucher, '') = '%s' and voucher_type = 'Journal Voucher'))" % (r[col_idx['Voucher No']], r[col_idx['Voucher No']])
# if entry against JV & and not adjusted within period if cond:
elif r[col_idx['Against Voucher Type']] == 'Payable Voucher' and sql("select name from `tabPayable Voucher` where name = '%s' and (posting_date < '%s' or posting_date > '%s') and docstatus = 1" % (r[col_idx['Against Voucher']], from_date, to_date)): outstanding_amt = flt(sql("select sum(ifnull(credit, 0))-sum(ifnull(debit, 0)) from `tabGL Entry` where account = '%s' and ifnull(is_cancelled, 'No') = 'No' and posting_date <= '%s' %s" % (r[col_idx['Account']], to_date, cond))[0][0] or 0)
cond = " and voucher_no = '%s' and ifnull(against_voucher, '') = '%s'" % (r[col_idx['Voucher No']], r[col_idx['Against Voucher']])
# if un-adjusted # add to total outstanding
elif not r[col_idx['Against Voucher']]: total_outstanding_amt += flt(outstanding_amt)
cond = " and ((voucher_no = '%s' and ifnull(against_voucher, '') = '') or (ifnull(against_voucher, '') = '%s' and voucher_type = 'Journal Voucher'))" % (r[col_idx['Voucher No']], r[col_idx['Voucher No']])
if cond: # add to total booking amount
outstanding_amt = flt(sql("select sum(ifnull(credit, 0))-sum(ifnull(debit, 0)) from `tabGL Entry` where account = '%s' and ifnull(is_cancelled, 'No') = 'No' and posting_date <= '%s' %s" % (r[col_idx['Account']], to_date, cond))[0][0] or 0) if outstanding_amt and r[col_idx['Voucher Type']] == 'Payable Voucher' and r[col_idx['Against Voucher']]:
total_booking_amt += flt(booking_amt)
# add to total outstanding r += [booking_amt, outstanding_amt]
total_outstanding_amt += flt(outstanding_amt)
# add to total booking amount # split into date ranges
if outstanding_amt and r[col_idx['Voucher Type']] == 'Payable Voucher' and r[col_idx['Against Voucher']]: val_l1 = val_l2 = val_l3 = val_l4 = val_l5_above= 0
total_booking_amt += flt(booking_amt) if r[col_idx[aging_based_on]]:
diff = (getdate(to_date) - getdate(r[col_idx[aging_based_on]])).days
if diff < cint(filter_values['range_1']):
val_l1 = outstanding_amt
if diff >= cint(filter_values['range_1']) and diff < cint(filter_values['range_2']):
val_l2 = outstanding_amt
if diff >= cint(filter_values['range_2']) and diff < cint(filter_values['range_3']):
val_l3 = outstanding_amt
if diff >= cint(filter_values['range_3']) and diff < cint(filter_values['range_4']):
val_l4 = outstanding_amt
if diff >= cint(filter_values['range_4']):
val_l5_above = outstanding_amt
r += [due_date, bill_no, bill_date, booking_amt, outstanding_amt] r += [diff, val_l1, val_l2, val_l3, val_l4, val_l5_above]
# split into date ranges # Only show that entry which has outstanding
val_l1 = val_l2 = val_l3 = val_l4 = val_l5_above= 0 if abs(flt(outstanding_amt)) > 0.001:
if r[col_idx[aging_based_on]]: out.append(r)
diff = (getdate(to_date) - getdate(r[col_idx[aging_based_on]])).days
if diff < cint(filter_values['range_1']):
val_l1 = outstanding_amt
if diff >= cint(filter_values['range_1']) and diff < cint(filter_values['range_2']):
val_l2 = outstanding_amt
if diff >= cint(filter_values['range_2']) and diff < cint(filter_values['range_3']):
val_l3 = outstanding_amt
if diff >= cint(filter_values['range_3']) and diff < cint(filter_values['range_4']):
val_l4 = outstanding_amt
if diff >= cint(filter_values['range_4']):
val_l5_above = outstanding_amt
r += [diff, val_l1, val_l2, val_l3, val_l4, val_l5_above] if len(out) > 300 and from_export == 0:
msgprint("This is a very large report and cannot be shown in the browser as it is likely to make your browser very slow.Please select Account or click on 'Export' to open in excel")
# Only show that entry which has outstanding raise Exception
if abs(flt(outstanding_amt)) > 0.001:
out.append(r)
if len(out) > 300 and from_export == 0:
msgprint("This is a very large report and cannot be shown in the browser as it is likely to make your browser very slow.Please select Account or click on 'Export' to open in excel")
raise Exception
# Append Extra rows to RES # Append Extra rows to RES

View File

@@ -1,26 +1,11 @@
SELECT * SELECT DISTINCT `tabGL Entry`.`Aging_date`,`tabGL Entry`.`transaction_date`,`tabGL Entry`.`account`, `tabGL Entry`.`against_voucher_type`, `tabGL Entry`.`against_voucher`,`tabGL Entry`.`voucher_type`,`tabGL Entry`.`voucher_no`, `tabGL Entry`.`remarks`, `tabGL Entry`.`credit`
FROM ( FROM `tabGL Entry`,`tabAccount`
WHERE `tabGL Entry`.`posting_date`>= '%(posting_date)s'
SELECT a.posting_date, a.voucher_no, a.account, a.credit AS inv_amount, ifnull( a.credit, 0 ) - ifnull( b.debit, 0 ) AS outstanding AND `tabGL Entry`.`posting_date`<= '%(posting_date1)s'
FROM ( AND `tabGL Entry`.`account` LIKE '%(account)s%%'
AND `tabGL Entry`.`company` LIKE '%(company)s%%'
SELECT gl . * AND ((ifnull(`tabGL Entry`.voucher_type,'') = 'Payable Voucher' and `tabGL Entry`.credit>0) OR `tabGL Entry`.voucher_type = 'Journal Voucher')
FROM `tabGL Entry` gl, `tabAccount` acc AND `tabGL Entry`.`is_cancelled` = 'No'
WHERE gl.account = acc.name AND `tabAccount`.master_type = 'Supplier'
AND acc.master_type = 'Supplier' AND `tabAccount`.name = `tabGL Entry`.account
AND ifnull( gl.is_cancelled, 'No' ) = 'No' ORDER BY `tabGL Entry`.`posting_date`
AND gl.credit >0
AND gl.posting_date <= current_date
)a
LEFT JOIN (
SELECT against_voucher, account, sum( debit ) AS debit
FROM `tabGL Entry`
WHERE ifnull( is_cancelled, 'No' ) = 'No'
AND posting_date <= current_date
GROUP BY against_voucher, account
)b ON a.voucher_no = b.against_voucher
AND a.account = b.account
)c
WHERE outstanding !=0
ORDER BY posting_date, voucher_no

View File

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

View File

@@ -0,0 +1,30 @@
# Search Criteria, lease_agreement_list
[
# 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 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,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,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,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,33 @@
# Search Criteria, lease_receipt_summary_year_to_date
[
# 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 Receipt Summary (Year to date)',
'doc_type': 'GL Entry',
'doctype': 'Search Criteria',
'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}",
'module': 'Accounts',
'name': '__common__',
'page_len': 50,
'sort_by': '`tabGL Entry`.`company`',
'sort_order': 'DESC',
'standard': 'Yes'
},
# Search Criteria, lease_receipt_summary_year_to_date
{
'doctype': 'Search Criteria',
'name': 'lease_receipt_summary_year_to_date'
}
]

View File

@@ -0,0 +1,30 @@
# Search Criteria, lease_receipts_client_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 Receipts Client wise',
'doc_type': 'GL Entry',
'doctype': 'Search Criteria',
'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}",
'module': 'Accounts',
'name': '__common__',
'standard': 'Yes'
},
# Search Criteria, lease_receipts_client_wise
{
'doctype': 'Search Criteria',
'name': 'lease_receipts_client_wise'
}
]

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

@@ -282,6 +282,7 @@
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
'options': 'Sales Order', 'options': 'Sales Order',
'permlevel': 0, 'permlevel': 0,
'search_index': 0,
'width': '100px' 'width': '100px'
}, },
@@ -338,7 +339,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1, 'search_index': 0,
'width': '150px' 'width': '150px'
}, },
@@ -357,7 +358,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1, 'search_index': 0,
'width': '150px' 'width': '150px'
}, },
@@ -487,7 +488,8 @@
'options': 'Term', 'options': 'Term',
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'report_hide': 1 'report_hide': 1,
'search_index': 0
}, },
# DocField # DocField

View File

@@ -85,7 +85,7 @@
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
'permlevel': 0, 'permlevel': 0,
'reqd': 1, 'reqd': 1,
'search_index': 1, 'search_index': 0,
'width': '100px' 'width': '100px'
}, },
@@ -132,6 +132,7 @@
'options': 'Brand', 'options': 'Brand',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 1,
'search_index': 0,
'width': '100px' 'width': '100px'
}, },
@@ -151,7 +152,7 @@
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 1,
'reqd': 0, 'reqd': 0,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -199,6 +200,7 @@
'options': 'UOM', 'options': 'UOM',
'permlevel': 1, 'permlevel': 1,
'reqd': 1, 'reqd': 1,
'search_index': 0,
'width': '50px' 'width': '50px'
}, },

View File

@@ -54,7 +54,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -89,7 +89,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -182,6 +182,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 0, 'print_hide': 0,
'reqd': 1, 'reqd': 1,
'search_index': 0,
'trigger': 'Client', 'trigger': 'Client',
'width': '100px' 'width': '100px'
}, },
@@ -331,7 +332,8 @@
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Brand', 'options': 'Brand',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1 'print_hide': 1,
'search_index': 0
}, },
# DocField # DocField
@@ -348,7 +350,7 @@
'options': 'Item Group', 'options': 'Item Group',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField

View File

@@ -206,7 +206,8 @@
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Serial No', 'options': 'Serial No',
'permlevel': 0, 'permlevel': 0,
'print_hide': 0 'print_hide': 0,
'search_index': 0
}, },
# DocField # DocField
@@ -219,7 +220,8 @@
'oldfieldname': 'batch_no', 'oldfieldname': 'batch_no',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Batch', 'options': 'Batch',
'permlevel': 0 'permlevel': 0,
'search_index': 0
}, },
# DocField # DocField
@@ -255,7 +257,7 @@
'options': 'Delivery Note', 'options': 'Delivery Note',
'permlevel': 0, 'permlevel': 0,
'print_hide': 0, 'print_hide': 0,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField

View File

@@ -5,7 +5,7 @@
{ {
'creation': '2010-08-08 17:09:26', 'creation': '2010-08-08 17:09:26',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-05-10 17:42:21', 'modified': '2011-07-19 16:18:58',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
@@ -25,7 +25,7 @@
'show_in_menu': 0, 'show_in_menu': 0,
'subject': ' ', 'subject': ' ',
'tag_fields': 'supplier_type', 'tag_fields': 'supplier_type',
'version': 86 'version': 87
}, },
# These values are common for all DocField # These values are common for all DocField
@@ -163,24 +163,11 @@
'permlevel': 0 'permlevel': 0
}, },
# DocField
{
'doctype': 'DocField',
'fieldname': 'supplier_status',
'fieldtype': 'Select',
'idx': 6,
'label': 'Supplier Status',
'oldfieldname': 'supplier_status',
'oldfieldtype': 'Select',
'options': '\nApproved\nUnapproved',
'permlevel': 0
},
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break',
'idx': 7, 'idx': 6,
'label': 'Address & Contacts', 'label': 'Address & Contacts',
'oldfieldtype': 'Column Break', 'oldfieldtype': 'Column Break',
'permlevel': 0 'permlevel': 0
@@ -192,7 +179,7 @@
'depends_on': 'eval:doc.__islocal', 'depends_on': 'eval:doc.__islocal',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'HTML', 'fieldtype': 'HTML',
'idx': 8, 'idx': 7,
'label': 'Address Desc', 'label': 'Address Desc',
'options': '<em>Addresses will appear only when you save the supplier</em>', 'options': '<em>Addresses will appear only when you save the supplier</em>',
'permlevel': 0 'permlevel': 0
@@ -203,7 +190,7 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'HTML', 'fieldtype': 'HTML',
'idx': 9, 'idx': 8,
'label': 'Address HTML', 'label': 'Address HTML',
'permlevel': 1 'permlevel': 1
}, },
@@ -212,7 +199,7 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Column Break', 'fieldtype': 'Column Break',
'idx': 10, 'idx': 9,
'permlevel': 0, 'permlevel': 0,
'width': '50%' 'width': '50%'
}, },
@@ -223,7 +210,7 @@
'depends_on': 'eval:doc.__islocal', 'depends_on': 'eval:doc.__islocal',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'HTML', 'fieldtype': 'HTML',
'idx': 11, 'idx': 10,
'label': 'Contact Desc', 'label': 'Contact Desc',
'options': '<em>Contact Details will appear only when you save the supplier</em>', 'options': '<em>Contact Details will appear only when you save the supplier</em>',
'permlevel': 0 'permlevel': 0
@@ -233,7 +220,7 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'HTML', 'fieldtype': 'HTML',
'idx': 12, 'idx': 11,
'label': 'Contact HTML', 'label': 'Contact HTML',
'permlevel': 1 'permlevel': 1
}, },
@@ -242,7 +229,7 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break',
'idx': 13, 'idx': 12,
'label': 'More Info', 'label': 'More Info',
'oldfieldtype': 'Section Break', 'oldfieldtype': 'Section Break',
'permlevel': 0 'permlevel': 0
@@ -255,7 +242,7 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'company', 'fieldname': 'company',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 14, 'idx': 13,
'in_filter': 1, 'in_filter': 1,
'label': 'Company', 'label': 'Company',
'oldfieldname': 'company', 'oldfieldname': 'company',
@@ -263,7 +250,7 @@
'options': 'Company', 'options': 'Company',
'permlevel': 0, 'permlevel': 0,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -273,7 +260,7 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'supplier_details', 'fieldname': 'supplier_details',
'fieldtype': 'Text', 'fieldtype': 'Text',
'idx': 15, 'idx': 14,
'label': 'Supplier Details', 'label': 'Supplier Details',
'oldfieldname': 'supplier_details', 'oldfieldname': 'supplier_details',
'oldfieldtype': 'Code', 'oldfieldtype': 'Code',
@@ -284,7 +271,7 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Column Break', 'fieldtype': 'Column Break',
'idx': 16, 'idx': 15,
'permlevel': 0, 'permlevel': 0,
'width': '50%' 'width': '50%'
}, },
@@ -294,7 +281,7 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'credit_days', 'fieldname': 'credit_days',
'fieldtype': 'Int', 'fieldtype': 'Int',
'idx': 17, 'idx': 16,
'label': 'Credit Days', 'label': 'Credit Days',
'permlevel': 0 'permlevel': 0
}, },
@@ -304,7 +291,7 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'website', 'fieldname': 'website',
'fieldtype': 'Data', 'fieldtype': 'Data',
'idx': 18, 'idx': 17,
'label': 'Website', 'label': 'Website',
'oldfieldname': 'website', 'oldfieldname': 'website',
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
@@ -317,7 +304,7 @@
'depends_on': 'eval:!doc.__islocal', 'depends_on': 'eval:!doc.__islocal',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break',
'idx': 19, 'idx': 18,
'label': 'Transaction History', 'label': 'Transaction History',
'oldfieldtype': 'Section Break', 'oldfieldtype': 'Section Break',
'permlevel': 0 'permlevel': 0
@@ -329,7 +316,7 @@
'depends_on': 'eval:!doc.__islocal', 'depends_on': 'eval:!doc.__islocal',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'HTML', 'fieldtype': 'HTML',
'idx': 20, 'idx': 19,
'label': 'History HTML', 'label': 'History HTML',
'oldfieldtype': 'HTML', 'oldfieldtype': 'HTML',
'permlevel': 0 'permlevel': 0
@@ -340,7 +327,7 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'trash_reason', 'fieldname': 'trash_reason',
'fieldtype': 'Small Text', 'fieldtype': 'Small Text',
'idx': 21, 'idx': 20,
'label': 'Trash Reason', 'label': 'Trash Reason',
'oldfieldname': 'trash_reason', 'oldfieldname': 'trash_reason',
'oldfieldtype': 'Small Text', 'oldfieldtype': 'Small Text',

View File

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

View File

@@ -141,7 +141,7 @@
'oldfieldtype': 'Select', 'oldfieldtype': 'Select',
'options': '\nPresent\nAbsent\nHalf Day', 'options': '\nPresent\nAbsent\nHalf Day',
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -193,7 +193,7 @@
'oldfieldname': 'att_date', 'oldfieldname': 'att_date',
'oldfieldtype': 'Date', 'oldfieldtype': 'Date',
'reqd': 1, 'reqd': 1,
'search_index': 0 'search_index': 1
}, },
# DocField # DocField

View File

@@ -75,7 +75,7 @@
'oldfieldtype': 'Select', 'oldfieldtype': 'Select',
'options': '\nGraduate\nPost Graduate\nUnder Graduate', 'options': '\nGraduate\nPost Graduate\nUnder Graduate',
'reqd': 0, 'reqd': 0,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField

View File

@@ -173,7 +173,8 @@
'oldfieldname': 'employee_name', 'oldfieldname': 'employee_name',
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
'permlevel': 0, 'permlevel': 0,
'reqd': 1 'reqd': 1,
'search_index': 1
}, },
# DocField # DocField
@@ -275,7 +276,7 @@
'options': '\nActive\nLeft', 'options': '\nActive\nLeft',
'permlevel': 0, 'permlevel': 0,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -408,7 +409,8 @@
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Department', 'options': 'Department',
'permlevel': 0, 'permlevel': 0,
'reqd': 1 'reqd': 1,
'search_index': 1
}, },
# DocField # DocField

View File

@@ -189,7 +189,7 @@
'oldfieldname': 'employee_name', 'oldfieldname': 'employee_name',
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
'permlevel': 1, 'permlevel': 1,
'search_index': 1, 'search_index': 0,
'width': '150px' 'width': '150px'
}, },

View File

@@ -136,7 +136,7 @@
'in_filter': 1, 'in_filter': 1,
'label': 'Employee Name', 'label': 'Employee Name',
'permlevel': 1, 'permlevel': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField

View File

@@ -3,9 +3,9 @@
# These values are common in all dictionaries # These values are common in all dictionaries
{ {
'creation': '2011-02-17 13:25:56', 'creation': '2011-02-10 14:10:08',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-07-08 13:28:15', 'modified': '2011-07-11 12:48:49',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
@@ -54,28 +54,28 @@
# DocPerm # DocPerm
{ {
'amend': 0, 'amend': 1,
'cancel': 0, 'cancel': 1,
'create': 1, 'create': 1,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 1, 'idx': 1,
'match': 'owner',
'permlevel': 0, 'permlevel': 0,
'role': 'Employee', 'submit': 1,
'submit': 0,
'write': 1 'write': 1
}, },
# DocPerm # DocPerm
{ {
'amend': 1, 'amend': 0,
'cancel': 1, 'cancel': 0,
'create': 1, 'create': 0,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 2, 'idx': 2,
'match': 'owner',
'permlevel': 0, 'permlevel': 0,
'role': 'HR User', 'submit': 0,
'submit': 1, 'write': 0
'write': 1
}, },
# DocPerm # DocPerm
@@ -86,6 +86,19 @@
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 3, 'idx': 3,
'permlevel': 0, 'permlevel': 0,
'role': 'HR User',
'submit': 1,
'write': 1
},
# DocPerm
{
'amend': 1,
'cancel': 1,
'create': 1,
'doctype': 'DocPerm',
'idx': 4,
'permlevel': 0,
'role': 'HR Manager', 'role': 'HR Manager',
'submit': 1, 'submit': 1,
'write': 1 'write': 1
@@ -93,28 +106,18 @@
# DocPerm # DocPerm
{ {
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 4, 'idx': 5,
'permlevel': 1, 'permlevel': 1,
'role': 'HR User', 'role': 'HR User'
'submit': 0,
'write': 0
}, },
# DocPerm # DocPerm
{ {
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 5, 'idx': 6,
'permlevel': 1, 'permlevel': 1,
'role': 'HR Manager', 'role': 'HR Manager'
'submit': 0,
'write': 0
}, },
# DocField # DocField
@@ -149,7 +152,7 @@
'in_filter': 1, 'in_filter': 1,
'label': 'Employee Name', 'label': 'Employee Name',
'permlevel': 1, 'permlevel': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -201,7 +204,7 @@
'options': 'link:Fiscal Year', 'options': 'link:Fiscal Year',
'permlevel': 0, 'permlevel': 0,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -234,6 +237,7 @@
'idx': 10, 'idx': 10,
'label': 'From Date', 'label': 'From Date',
'permlevel': 0, 'permlevel': 0,
'search_index': 1,
'trigger': 'Client' 'trigger': 'Client'
}, },
@@ -246,6 +250,7 @@
'idx': 11, 'idx': 11,
'label': 'To Date', 'label': 'To Date',
'permlevel': 0, 'permlevel': 0,
'search_index': 1,
'trigger': 'Client' 'trigger': 'Client'
}, },

View File

@@ -5,7 +5,7 @@
{ {
'creation': '2010-08-08 17:09:20', 'creation': '2010-08-08 17:09:20',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-07-14 16:07:20', 'modified': '2011-07-27 13:10:28',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
@@ -21,7 +21,7 @@
'server_code_error': ' ', 'server_code_error': ' ',
'show_in_menu': 0, 'show_in_menu': 0,
'subject': 'For %(employee_name)s, %(designation)s', 'subject': 'For %(employee_name)s, %(designation)s',
'version': 392 'version': 393
}, },
# These values are common for all DocField # These values are common for all DocField
@@ -55,19 +55,7 @@
'cancel': 0, 'cancel': 0,
'create': 0, 'create': 0,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'match': 'owner', 'idx': 1,
'permlevel': 0,
'role': 'Employee',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': 'DocPerm',
'match': 'owner', 'match': 'owner',
'permlevel': 0, 'permlevel': 0,
'role': 'Employee', 'role': 'Employee',
@@ -80,7 +68,7 @@
'amend': 0, 'amend': 0,
'create': 1, 'create': 1,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 3, 'idx': 2,
'permlevel': 0, 'permlevel': 0,
'role': 'HR User', 'role': 'HR User',
'submit': 1, 'submit': 1,
@@ -93,7 +81,7 @@
'cancel': 1, 'cancel': 1,
'create': 1, 'create': 1,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 4, 'idx': 3,
'permlevel': 0, 'permlevel': 0,
'role': 'HR Manager', 'role': 'HR Manager',
'submit': 1, 'submit': 1,
@@ -103,7 +91,7 @@
# DocPerm # DocPerm
{ {
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 5, 'idx': 4,
'permlevel': 1, 'permlevel': 1,
'role': 'HR User' 'role': 'HR User'
}, },
@@ -111,7 +99,7 @@
# DocPerm # DocPerm
{ {
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 6, 'idx': 5,
'permlevel': 1, 'permlevel': 1,
'role': 'HR Manager' 'role': 'HR Manager'
}, },
@@ -150,7 +138,7 @@
'options': 'Employee', 'options': 'Employee',
'permlevel': 0, 'permlevel': 0,
'reqd': 1, 'reqd': 1,
'search_index': 0 'search_index': 1
}, },
# DocField # DocField
@@ -180,7 +168,7 @@
'options': 'Department', 'options': 'Department',
'permlevel': 1, 'permlevel': 1,
'reqd': 0, 'reqd': 0,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -195,7 +183,7 @@
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Designation', 'options': 'Designation',
'permlevel': 1, 'permlevel': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -210,7 +198,7 @@
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Branch', 'options': 'Branch',
'permlevel': 1, 'permlevel': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -225,7 +213,7 @@
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Grade', 'options': 'Grade',
'permlevel': 1, 'permlevel': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -287,7 +275,7 @@
'options': 'Fiscal Year', 'options': 'Fiscal Year',
'permlevel': 0, 'permlevel': 0,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField

View File

@@ -115,7 +115,8 @@
'label': 'Tag 1', 'label': 'Tag 1',
'oldfieldname': 'tag_1', 'oldfieldname': 'tag_1',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Question Tag' 'options': 'Question Tag',
'search_index': 0
}, },
# DocField # DocField
@@ -136,7 +137,8 @@
'label': 'Tag 2', 'label': 'Tag 2',
'oldfieldname': 'tag_2', 'oldfieldname': 'tag_2',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Question Tag' 'options': 'Question Tag',
'search_index': 0
}, },
# DocField # DocField
@@ -148,7 +150,8 @@
'label': 'Tag 3', 'label': 'Tag 3',
'oldfieldname': 'tag_3', 'oldfieldname': 'tag_3',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Question Tag' 'options': 'Question Tag',
'search_index': 0
}, },
# DocField # DocField

View File

@@ -195,6 +195,6 @@ def run_patches():
sync_mapper() sync_mapper()
delete_unwanted_modules() delete_unwanted_modules()
# landed cost wizard link in stock # landed cost wizard link in stock
reload_doc('stock', 'Module Def', 'stock') reload_doc('stock', 'Module Def', 'Stock')
sql("commit") sql("commit")

View File

@@ -2,6 +2,9 @@
This patch removes wrong indexs and add proper indexes in tables This patch removes wrong indexs and add proper indexes in tables
""" """
import webnotes
sql = webnotes.conn.sql
from webnotes.utils import cint, cstr
def create_proper_index(): def create_proper_index():
from webnotes.modules.export_module import export_to_files from webnotes.modules.export_module import export_to_files
@@ -264,29 +267,29 @@ def create_proper_index():
'Print Heading': [], 'Print Heading': [],
'TDS Rate Detail': ['category'] 'TDS Rate Detail': ['category']
} }
#sql("commit") # only required if run from login
exist_dt = [cstr(d[0]) for d in sql("select name from `tabDocType`")]
for dt in dt_index_fields.keys(): for dt in [d for d in dt_index_fields.keys() if d in exist_dt]:
current_index = sql("show indexes from `tab%s`" % dt) try:
current_index = sql("show indexes from `tab%s`" % dt)
proper_index = dt_index_fields[dt] proper_index = dt_index_fields[dt]
for d in current_index: for d in current_index:
if d[4] not in ['name', 'parent', 'parenttype']: if d[4] not in ['name', 'parent', 'parenttype']:
if d[4] not in proper_index: if d[4] not in proper_index:
sql("ALTER TABLE `tab%s` DROP INDEX %s" % (dt, d[4])) sql("ALTER TABLE `tab%s` DROP INDEX %s" % (dt, d[4]))
sql("start transaction") sql("start transaction")
sql("UPDATE `tabDocField` SET search_index = 0 WHERE fieldname = '%s' AND parent = '%s'" % (d[4], dt)) sql("UPDATE `tabDocField` SET search_index = 0 WHERE fieldname = '%s' AND parent = '%s'" % (d[4], dt))
sql("commit") sql("commit")
else: else:
proper_index.remove(d[4]) proper_index.remove(d[4])
for d in proper_index: for d in proper_index:
sql("ALTER TABLE `tab%s` ADD INDEX ( `%s` ) " % (dt, d)) sql("ALTER TABLE `tab%s` ADD INDEX ( `%s` ) " % (dt, d))
sql("start transaction") sql("start transaction")
sql("UPDATE `tabDocField` SET search_index = 1 WHERE fieldname = '%s' AND parent = '%s'" % (d, dt)) sql("UPDATE `tabDocField` SET search_index = 1 WHERE fieldname = '%s' AND parent = '%s'" % (d, dt))
sql("commit") sql("commit")
except:
sql("start transaction") continue
dt_module = sql("select module from `tabDocType` where name = '%s'" % dt)[0][0]
export_to_files(record_list = [['DocType', dt]], record_module = dt_module)
sql("commit")

View File

@@ -1,7 +1,7 @@
# REMEMBER to update this # REMEMBER to update this
# ======================== # ========================
last_patch = 327 last_patch = 332
#------------------------------------------- #-------------------------------------------
@@ -1322,3 +1322,29 @@ def execute(patch_no):
reload_doc('support','doctype','support_ticket') reload_doc('support','doctype','support_ticket')
sql("delete from tabDocField where fieldname='problem_description' and parent='Support Ticket'") sql("delete from tabDocField where fieldname='problem_description' and parent='Support Ticket'")
elif patch_no == 328:
if webnotes.conn.get_value('Control Panel', None, 'account_id') != 'axjanak2011':
sql("delete from `tabDocField` where fieldname = 'supplier_status' and parent = 'Supplier'")
elif patch_no == 329:
reload_doc('utilities', 'doctype', 'rename_tool')
reload_doc('utilities', 'doctype', 'bulk_rename_tool')
elif patch_no == 330:
reload_doc('accounts', 'doctype', 'lease_agreement')
reload_doc('accounts', 'doctype', 'lease_installment')
reload_doc('accounts', 'search_criteria', 'lease_agreement_list')
reload_doc('accounts', 'search_criteria', 'lease_monthly_future_installment_inflows')
reload_doc('accounts', 'search_criteria', 'lease_overdue_age_wise')
reload_doc('accounts', 'search_criteria', 'lease_overdue_list')
reload_doc('accounts', 'search_criteria', 'lease_receipts_client_wise')
reload_doc('accounts', 'search_criteria', 'lease_receipt_summary_year_to_date')
reload_doc('accounts', 'search_criteria', 'lease_yearly_future_installment_inflows')
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

@@ -12,6 +12,7 @@
# These values are common for all DocType # These values are common for all DocType
{ {
'_last_update': '1309508837',
'allow_attach': 0, 'allow_attach': 0,
'allow_copy': 0, 'allow_copy': 0,
'allow_email': 0, 'allow_email': 0,

View File

@@ -114,6 +114,7 @@
'options': 'Workstation', 'options': 'Workstation',
'permlevel': 0, 'permlevel': 0,
'reqd': 1, 'reqd': 1,
'search_index': 0,
'trigger': 'Client' 'trigger': 'Client'
}, },

View File

@@ -99,6 +99,7 @@
'oldfieldname': 'bom_created', 'oldfieldname': 'bom_created',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Bill Of Materials', 'options': 'Bill Of Materials',
'permlevel': 1 'permlevel': 1,
'search_index': 0
} }
] ]

View File

@@ -162,7 +162,8 @@
'label': 'Stock UOM', 'label': 'Stock UOM',
'oldfieldname': 'stock_uom', 'oldfieldname': 'stock_uom',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'UOM' 'options': 'UOM',
'search_index': 0
}, },
# DocField # DocField

View File

@@ -131,7 +131,7 @@
'oldfieldtype': 'Date', 'oldfieldtype': 'Date',
'permlevel': 0, 'permlevel': 0,
'reqd': 1, 'reqd': 1,
'search_index': 1, 'search_index': 0,
'width': '100px' 'width': '100px'
}, },
@@ -146,6 +146,7 @@
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Bill Of Materials', 'options': 'Bill Of Materials',
'permlevel': 0, 'permlevel': 0,
'search_index': 0,
'width': '100px' 'width': '100px'
}, },

View File

@@ -180,6 +180,7 @@
'options': 'Bill Of Materials', 'options': 'Bill Of Materials',
'permlevel': 1, 'permlevel': 1,
'reqd': 1, 'reqd': 1,
'search_index': 0,
'trigger': 'Client' 'trigger': 'Client'
}, },
@@ -306,7 +307,8 @@
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Warehouse', 'options': 'Warehouse',
'permlevel': 0, 'permlevel': 0,
'reqd': 1 'reqd': 1,
'search_index': 0
}, },
# DocField # DocField
@@ -323,7 +325,8 @@
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Warehouse', 'options': 'Warehouse',
'permlevel': 0, 'permlevel': 0,
'reqd': 1 'reqd': 1,
'search_index': 0
}, },
# DocField # DocField
@@ -367,7 +370,8 @@
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Company', 'options': 'Company',
'permlevel': 0, 'permlevel': 0,
'reqd': 1 'reqd': 1,
'search_index': 0
}, },
# DocField # DocField

View File

@@ -86,7 +86,8 @@
'oldfieldname': 'state', 'oldfieldname': 'state',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'State', 'options': 'State',
'permlevel': 0 'permlevel': 0,
'search_index': 0
}, },
# DocField # DocField
@@ -100,7 +101,8 @@
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Territory', 'options': 'Territory',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1 'print_hide': 1,
'search_index': 0
}, },
# DocField # DocField

View File

@@ -94,7 +94,8 @@
'oldfieldname': 'project_name', 'oldfieldname': 'project_name',
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
'permlevel': 0, 'permlevel': 0,
'reqd': 1 'reqd': 1,
'search_index': 1
}, },
# DocField # DocField
@@ -112,7 +113,7 @@
'options': 'Open\nCompleted\nCancelled', 'options': 'Open\nCompleted\nCancelled',
'permlevel': 0, 'permlevel': 0,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -356,7 +357,7 @@
'oldfieldname': 'customer_name', 'oldfieldname': 'customer_name',
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
'permlevel': 1, 'permlevel': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -401,6 +402,7 @@
'options': 'Territory', 'options': 'Territory',
'permlevel': 0, 'permlevel': 0,
'reqd': 0, 'reqd': 0,
'search_index': 0,
'trigger': 'Client' 'trigger': 'Client'
}, },
@@ -438,7 +440,8 @@
'oldfieldname': 'customer_group', 'oldfieldname': 'customer_group',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Customer Group', 'options': 'Customer Group',
'permlevel': 1 'permlevel': 1,
'search_index': 0
}, },
# DocField # DocField

View File

@@ -145,7 +145,8 @@
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Profile', 'options': 'Profile',
'permlevel': 0, 'permlevel': 0,
'reqd': 1 'reqd': 1,
'search_index': 0
}, },
# DocField # DocField

View File

@@ -75,6 +75,7 @@
'options': 'Activity Type', 'options': 'Activity Type',
'permlevel': 0, 'permlevel': 0,
'reqd': 1, 'reqd': 1,
'search_index': 0,
'width': '200px' 'width': '200px'
}, },

View File

@@ -5,14 +5,14 @@
{ {
'creation': '2010-08-08 17:08:56', 'creation': '2010-08-08 17:08:56',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-05-26 17:31:31', 'modified': '2011-07-20 10:42:05',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
# These values are common for all DocType # These values are common for all DocType
{ {
'_last_update': '1306834669', '_last_update': '1309508837',
'allow_print': 0, 'allow_print': 0,
'allow_trash': 1, 'allow_trash': 1,
'colour': 'White:FFF', 'colour': 'White:FFF',
@@ -26,7 +26,7 @@
'show_in_menu': 0, 'show_in_menu': 0,
'subject': "eval:'%(customer_name)s'=='%(name)s' ? ' ' : '%(customer_name)s'", 'subject': "eval:'%(customer_name)s'=='%(name)s' ? ' ' : '%(customer_name)s'",
'tag_fields': 'customer_group,customer_type', 'tag_fields': 'customer_group,customer_type',
'version': 431 'version': 433
}, },
# These values are common for all DocField # These values are common for all DocField
@@ -176,7 +176,7 @@
'idx': 4, 'idx': 4,
'label': 'Series', 'label': 'Series',
'no_copy': 1, 'no_copy': 1,
'options': '\nCUST\nCUSTMUM', 'options': '\nCUST\nCUSTMUM\nCUSTOM',
'permlevel': 0, 'permlevel': 0,
'print_hide': 0 'print_hide': 0
}, },
@@ -340,7 +340,7 @@
'options': 'Company', 'options': 'Company',
'permlevel': 0, 'permlevel': 0,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField

View File

@@ -187,7 +187,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 0, 'reqd': 0,
'search_index': 0, 'search_index': 1,
'trigger': 'Client' 'trigger': 'Client'
}, },
@@ -244,6 +244,7 @@
'options': 'Lead', 'options': 'Lead',
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'search_index': 1,
'trigger': 'Client' 'trigger': 'Client'
}, },
@@ -326,6 +327,7 @@
'oldfieldtype': 'Date', 'oldfieldtype': 'Date',
'permlevel': 0, 'permlevel': 0,
'reqd': 1, 'reqd': 1,
'search_index': 1,
'width': '50px' 'width': '50px'
}, },
@@ -405,7 +407,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1, 'search_index': 0,
'trigger': 'Client' 'trigger': 'Client'
}, },
@@ -426,7 +428,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 0, 'reqd': 0,
'search_index': 1, 'search_index': 0,
'trigger': 'Client' 'trigger': 'Client'
}, },
@@ -492,7 +494,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -509,7 +511,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField

View File

@@ -90,7 +90,8 @@
'oldfieldname': 'item_group', 'oldfieldname': 'item_group',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Item Group', 'options': 'Item Group',
'print_hide': 1 'print_hide': 1,
'search_index': 0
}, },
# DocField # DocField
@@ -104,7 +105,8 @@
'oldfieldname': 'brand', 'oldfieldname': 'brand',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Brand', 'options': 'Brand',
'print_hide': 1 'print_hide': 1,
'search_index': 0
}, },
# DocField # DocField
@@ -140,6 +142,7 @@
'label': 'UOM', 'label': 'UOM',
'oldfieldname': 'uom', 'oldfieldname': 'uom',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'UOM' 'options': 'UOM',
'search_index': 0
} }
] ]

View File

@@ -201,7 +201,7 @@
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
'permlevel': 1, 'permlevel': 1,
'reqd': 0, 'reqd': 0,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -257,7 +257,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -292,7 +292,8 @@
'oldfieldname': 'inst_date', 'oldfieldname': 'inst_date',
'oldfieldtype': 'Date', 'oldfieldtype': 'Date',
'permlevel': 0, 'permlevel': 0,
'reqd': 1 'reqd': 1,
'search_index': 1
}, },
# DocField # DocField
@@ -340,7 +341,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1, 'search_index': 0,
'trigger': 'Client' 'trigger': 'Client'
}, },

View File

@@ -140,7 +140,7 @@
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 1,
'search_index': 1, 'search_index': 0,
'width': '150px' 'width': '150px'
}, },

View File

@@ -188,7 +188,7 @@
'options': "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign\nWebsite", 'options': "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign\nWebsite",
'permlevel': 0, 'permlevel': 0,
'reqd': 1, 'reqd': 1,
'search_index': 1, 'search_index': 0,
'trigger': 'Client' 'trigger': 'Client'
}, },
@@ -239,7 +239,7 @@
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
'permlevel': 0, 'permlevel': 0,
'reqd': 0, 'reqd': 0,
'search_index': 1, 'search_index': 0,
'trigger': 'Client' 'trigger': 'Client'
}, },
@@ -350,7 +350,7 @@
'options': '\nHot\nWarm\nCold', 'options': '\nHot\nWarm\nCold',
'permlevel': 0, 'permlevel': 0,
'reqd': 0, 'reqd': 0,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -616,7 +616,7 @@
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Profile', 'options': 'Profile',
'permlevel': 0, 'permlevel': 0,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -633,7 +633,7 @@
'options': '\nLower Income\nMiddle Income\nUpper Income', 'options': '\nLower Income\nMiddle Income\nUpper Income',
'permlevel': 0, 'permlevel': 0,
'reqd': 0, 'reqd': 0,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField

View File

@@ -414,7 +414,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 0, 'print_hide': 0,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -435,7 +435,7 @@
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -520,7 +520,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1, 'search_index': 0,
'trigger': 'Client' 'trigger': 'Client'
}, },
@@ -539,7 +539,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 0, 'reqd': 0,
'search_index': 1, 'search_index': 0,
'trigger': 'Client' 'trigger': 'Client'
}, },
@@ -584,7 +584,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1, 'search_index': 0,
'trigger': 'Client', 'trigger': 'Client',
'width': '100px' 'width': '100px'
}, },
@@ -1035,7 +1035,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1, 'search_index': 0,
'trigger': 'Client', 'trigger': 'Client',
'width': '150px' 'width': '150px'
}, },
@@ -1055,7 +1055,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField

View File

@@ -73,7 +73,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1, 'search_index': 0,
'width': '150px' 'width': '150px'
}, },
@@ -260,7 +260,7 @@
'options': 'Item Group', 'options': 'Item Group',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -276,7 +276,7 @@
'options': 'Brand', 'options': 'Brand',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 1,
'search_index': 1, 'search_index': 0,
'width': '150px' 'width': '150px'
}, },

View File

@@ -75,7 +75,8 @@
'oldfieldname': 'uom', 'oldfieldname': 'uom',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'UOM', 'options': 'UOM',
'permlevel': 1 'permlevel': 1,
'search_index': 0
}, },
# DocField # DocField

View File

@@ -394,7 +394,7 @@
'options': 'Brand', 'options': 'Brand',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -410,7 +410,7 @@
'options': 'Item Group', 'options': 'Item Group',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField

View File

@@ -79,7 +79,8 @@
'oldfieldname': 'company', 'oldfieldname': 'company',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Company', 'options': 'Company',
'reqd': 0 'reqd': 0,
'search_index': 0
}, },
# DocField # DocField
@@ -157,7 +158,8 @@
'label': 'Applicable To (Employee)', 'label': 'Applicable To (Employee)',
'oldfieldname': 'to_emp', 'oldfieldname': 'to_emp',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Employee' 'options': 'Employee',
'search_index': 0
}, },
# DocField # DocField
@@ -171,7 +173,8 @@
'label': 'Applicable To (Designation)', 'label': 'Applicable To (Designation)',
'oldfieldname': 'to_designation', 'oldfieldname': 'to_designation',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Designation' 'options': 'Designation',
'search_index': 0
}, },
# DocField # DocField

View File

@@ -5,7 +5,7 @@
{ {
'creation': '2010-08-08 17:08:55', 'creation': '2010-08-08 17:08:55',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-07-06 11:42:34', 'modified': '2011-07-01 17:43:29',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },

View File

@@ -66,7 +66,8 @@
'idx': 1, 'idx': 1,
'label': 'Doc Type', 'label': 'Doc Type',
'oldfieldname': 'doc_type', 'oldfieldname': 'doc_type',
'oldfieldtype': 'Data' 'oldfieldtype': 'Data',
'search_index': 1
}, },
# DocField # DocField

View File

@@ -160,7 +160,7 @@
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
'permlevel': 0, 'permlevel': 0,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -186,7 +186,7 @@
'options': 'Company', 'options': 'Company',
'permlevel': 0, 'permlevel': 0,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField

View File

@@ -191,7 +191,7 @@
'oldfieldtype': 'Select', 'oldfieldtype': 'Select',
'options': '\nChannel Partner\nDistributor\nDealer\nAgent\nRetailer\nImplementation Partner\nReseller', 'options': '\nChannel Partner\nDistributor\nDealer\nAgent\nRetailer\nImplementation Partner\nReseller',
'permlevel': 0, 'permlevel': 0,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField

View File

@@ -156,7 +156,7 @@
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
'permlevel': 0, 'permlevel': 0,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -281,7 +281,7 @@
'oldfieldtype': 'Select', 'oldfieldtype': 'Select',
'options': 'link:Country', 'options': 'link:Country',
'permlevel': 0, 'permlevel': 0,
'search_index': 1, 'search_index': 0,
'trigger': 'Client' 'trigger': 'Client'
}, },
@@ -297,7 +297,7 @@
'oldfieldtype': 'Select', 'oldfieldtype': 'Select',
'options': 'link:State', 'options': 'link:State',
'permlevel': 0, 'permlevel': 0,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -324,7 +324,8 @@
'oldfieldname': 'territory', 'oldfieldname': 'territory',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Territory', 'options': 'Territory',
'permlevel': 0 'permlevel': 0,
'search_index': 0
}, },
# DocField # DocField
@@ -397,7 +398,8 @@
'oldfieldname': 'distribution_id', 'oldfieldname': 'distribution_id',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Budget Distribution', 'options': 'Budget Distribution',
'permlevel': 0 'permlevel': 0,
'search_index': 0
}, },
# DocField # DocField

View File

@@ -155,7 +155,7 @@
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
'permlevel': 0, 'permlevel': 0,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField

View File

@@ -160,7 +160,7 @@
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Sales Person', 'options': 'Sales Person',
'permlevel': 0, 'permlevel': 0,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -267,7 +267,8 @@
'oldfieldname': 'distribution_id', 'oldfieldname': 'distribution_id',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Budget Distribution', 'options': 'Budget Distribution',
'permlevel': 0 'permlevel': 0,
'search_index': 0
}, },
# DocField # DocField

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

@@ -106,7 +106,7 @@
'oldfieldtype': 'Select', 'oldfieldtype': 'Select',
'options': '\nActive\nInactive', 'options': '\nActive\nInactive',
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField

View File

@@ -183,6 +183,7 @@ SetupData = function(cnty){
['Country',1,'Country','','Country master'], ['Country',1,'Country','','Country master'],
['State',1,'State','','State master'], ['State',1,'State','','State master'],
['Rename Tool',3,'Rename Tool','','Rename a record'], ['Rename Tool',3,'Rename Tool','','Rename a record'],
['Bulk Rename Tool',3,'Bulk Rename Tool','','Rename multiple records at a time'],
['Activty Type',1,'Activity Type','','Types of activities that you can select in your Timesheet'], ['Activty Type',1,'Activity Type','','Types of activities that you can select in your Timesheet'],
['City',1,'City','','City master']]}; ['City',1,'City','','City master']]};

View File

@@ -162,7 +162,7 @@
'label': 'Reserved Quantity', 'label': 'Reserved Quantity',
'oldfieldname': 'reserved_qty', 'oldfieldname': 'reserved_qty',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -176,7 +176,7 @@
'label': 'Actual Quantity', 'label': 'Actual Quantity',
'oldfieldname': 'actual_qty', 'oldfieldname': 'actual_qty',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -190,7 +190,7 @@
'label': 'Ordered Quantity', 'label': 'Ordered Quantity',
'oldfieldname': 'ordered_qty', 'oldfieldname': 'ordered_qty',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -204,7 +204,7 @@
'label': 'Indented Quantity', 'label': 'Indented Quantity',
'oldfieldname': 'indented_qty', 'oldfieldname': 'indented_qty',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -217,7 +217,7 @@
'label': 'Planned Qty', 'label': 'Planned Qty',
'oldfieldname': 'planned_qty', 'oldfieldname': 'planned_qty',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -258,7 +258,7 @@
'label': 'UOM', 'label': 'UOM',
'oldfieldname': 'stock_uom', 'oldfieldname': 'stock_uom',
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
'search_index': 1 'search_index': 0
}, },
# DocField # DocField

View File

@@ -332,7 +332,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 0, 'print_hide': 0,
'reqd': 1, 'reqd': 1,
'search_index': 1, 'search_index': 0,
'width': '100px' 'width': '100px'
}, },
@@ -352,7 +352,7 @@
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1, 'search_index': 0,
'width': '150px' 'width': '150px'
}, },
@@ -372,7 +372,7 @@
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -391,7 +391,7 @@
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -439,7 +439,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -453,7 +453,7 @@
'options': 'Customer Group', 'options': 'Customer Group',
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -1014,7 +1014,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1, 'search_index': 0,
'width': '150px' 'width': '150px'
}, },
@@ -1032,7 +1032,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1, 'search_index': 0,
'width': '150px' 'width': '150px'
}, },

View File

@@ -285,7 +285,8 @@
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Batch', 'options': 'Batch',
'permlevel': 0, 'permlevel': 0,
'print_hide': 1 'print_hide': 1,
'search_index': 0
}, },
# DocField # DocField
@@ -299,7 +300,8 @@
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Item Group', 'options': 'Item Group',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1 'print_hide': 1,
'search_index': 0
}, },
# DocField # DocField
@@ -314,6 +316,7 @@
'options': 'Brand', 'options': 'Brand',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 1,
'search_index': 0,
'width': '150px' 'width': '150px'
}, },
@@ -423,7 +426,7 @@
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 1,
'search_index': 1, 'search_index': 0,
'width': '150px' 'width': '150px'
}, },
@@ -455,7 +458,7 @@
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 1,
'search_index': 0, 'search_index': 1,
'width': '150px' 'width': '150px'
}, },

View File

@@ -178,7 +178,8 @@
'oldfieldname': 'uom', 'oldfieldname': 'uom',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'UOM', 'options': 'UOM',
'permlevel': 1 'permlevel': 1,
'search_index': 0
}, },
# DocField # DocField

View File

@@ -12,7 +12,7 @@
# These values are common for all DocType # These values are common for all DocType
{ {
'_last_update': '1308741898', '_last_update': '1309508838',
'allow_attach': 1, 'allow_attach': 1,
'allow_trash': 1, 'allow_trash': 1,
'autoname': 'field:item_code', 'autoname': 'field:item_code',
@@ -197,7 +197,7 @@
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
'permlevel': 0, 'permlevel': 0,
'reqd': 1, 'reqd': 1,
'search_index': 1 'search_index': 0
}, },
# DocField # DocField
@@ -241,7 +241,8 @@
'options': 'Brand', 'options': 'Brand',
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 0 'reqd': 0,
'search_index': 0
}, },
# DocField # DocField
@@ -312,7 +313,8 @@
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'UOM', 'options': 'UOM',
'permlevel': 0, 'permlevel': 0,
'reqd': 1 'reqd': 1,
'search_index': 0
}, },
# DocField # DocField
@@ -355,7 +357,8 @@
'oldfieldname': 'default_warehouse', 'oldfieldname': 'default_warehouse',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Warehouse', 'options': 'Warehouse',
'permlevel': 0 'permlevel': 0,
'search_index': 0
}, },
# DocField # DocField
@@ -556,6 +559,7 @@
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Account', 'options': 'Account',
'permlevel': 0, 'permlevel': 0,
'search_index': 0,
'trigger': 'Client' 'trigger': 'Client'
}, },
@@ -571,7 +575,8 @@
'oldfieldname': 'cost_center', 'oldfieldname': 'cost_center',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Cost Center', 'options': 'Cost Center',
'permlevel': 0 'permlevel': 0,
'search_index': 0
}, },
# DocField # DocField
@@ -719,7 +724,8 @@
'idx': 43, 'idx': 43,
'label': 'Default Income Account', 'label': 'Default Income Account',
'options': 'Account', 'options': 'Account',
'permlevel': 0 'permlevel': 0,
'search_index': 0
}, },
# DocField # DocField
@@ -730,7 +736,8 @@
'idx': 44, 'idx': 44,
'label': 'Cost Center', 'label': 'Cost Center',
'options': 'Cost Center', 'options': 'Cost Center',
'permlevel': 0 'permlevel': 0,
'search_index': 0
}, },
# DocField # DocField
@@ -872,7 +879,8 @@
'oldfieldname': 'default_bom', 'oldfieldname': 'default_bom',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Bill Of Materials', 'options': 'Bill Of Materials',
'permlevel': 1 'permlevel': 1,
'search_index': 0
}, },
# DocField # DocField
@@ -909,19 +917,6 @@
'reqd': 1 'reqd': 1
}, },
# DocField
{
'doctype': 'DocField',
'fieldname': 'item_attachments_details',
'fieldtype': 'Table',
'idx': 58,
'label': 'Item Attachments Details',
'oldfieldname': 'item_attachments_details',
'oldfieldtype': 'Table',
'options': 'Item Attachments Detail',
'permlevel': 0
},
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': 'DocField',

View File

@@ -49,7 +49,8 @@
'label': 'Account Head', 'label': 'Account Head',
'oldfieldname': 'account_head', 'oldfieldname': 'account_head',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Account' 'options': 'Account',
'search_index': 1
}, },
# DocField # DocField

Some files were not shown because too many files have changed in this diff Show More