merged from webnotes/erpnext

This commit is contained in:
Rushabh Mehta
2011-08-29 10:47:58 +05:30
145 changed files with 5862 additions and 4363 deletions

View File

@@ -5,7 +5,7 @@
{
'creation': '2010-09-25 10:50:34',
'docstatus': 0,
'modified': '2011-07-27 11:43:40',
'modified': '2011-07-28 12:01:10',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
@@ -358,7 +358,7 @@
# Module Def Item
{
'display_name': 'Lease Agreement List',
'doc_name': 'Lease Agreement List',
'doc_name': 'GL Entry',
'doc_type': 'Reports',
'doctype': 'Module Def Item',
'idx': 33
@@ -367,7 +367,7 @@
# Module Def Item
{
'display_name': 'Lease Monthly Future Installment Inflows',
'doc_name': 'Lease Monthly Future Installment Inflows',
'doc_name': 'GL Entry',
'doc_type': 'Reports',
'doctype': 'Module Def Item',
'idx': 34
@@ -376,7 +376,7 @@
# Module Def Item
{
'display_name': 'Lease Overdue Age Wise',
'doc_name': 'Lease Overdue Age Wise',
'doc_name': 'GL Entry',
'doc_type': 'Reports',
'doctype': 'Module Def Item',
'idx': 35
@@ -385,7 +385,7 @@
# Module Def Item
{
'display_name': 'Lease Overdue List',
'doc_name': 'Lease Overdue List',
'doc_name': 'GL Entry',
'doc_type': 'Reports',
'doctype': 'Module Def Item',
'idx': 36
@@ -394,7 +394,7 @@
# Module Def Item
{
'display_name': 'Lease Receipts Client Wise',
'doc_name': 'Lease Receipts Client Wise',
'doc_name': 'GL Entry',
'doc_type': 'Reports',
'doctype': 'Module Def Item',
'idx': 37
@@ -402,8 +402,8 @@
# Module Def Item
{
'display_name': 'Lease Receipt Summary Year to Date',
'doc_name': 'Lease Receipt Summary Year to Date',
'display_name': 'Lease Receipt Summary Month Wise',
'doc_name': 'GL Entry',
'doc_type': 'Reports',
'doctype': 'Module Def Item',
'idx': 38
@@ -412,7 +412,7 @@
# Module Def Item
{
'display_name': 'Lease Yearly Future Installment Inflows',
'doc_name': 'Lease Yearly Future Installment Inflows',
'doc_name': 'GL Entry',
'doc_type': 'Reports',
'doctype': 'Module Def Item',
'idx': 39

View File

@@ -72,16 +72,6 @@ cur_frm.fields_dict['master_name'].get_query=function(doc){
else alert("Please select master type");
}
/*
// Get customer/supplier address
// -----------------------------------------
cur_frm.cscript.master_name = function(doc,cdt,cdn){
if(doc.master_name){
get_server_fields('get_address','','',doc,cdt,cdn);
}
}
*/
// parent account get query
// -----------------------------------------
cur_frm.fields_dict['parent_account'].get_query = function(doc){

View File

@@ -31,7 +31,7 @@ class DocType:
def get_address(self):
add=sql("Select address from `tab%s` where name='%s'"%(self.doc.master_type,self.doc.master_name))
ret={'address':add[0][0]}
return cstr(ret)
return ret
# check whether master name entered for supplier/customer

View File

@@ -455,7 +455,8 @@
'description': "Don't delete this field at any cost",
'doctype': 'DocField',
'fieldname': 'old_parent',
'fieldtype': 'Data',
'fieldtype': 'Link',
'options': 'Account',
'hidden': 1,
'idx': 24,
'label': 'Old Parent',
@@ -517,4 +518,4 @@
'oldfieldtype': 'Small Text',
'permlevel': 1
}
]
]

View File

@@ -18,32 +18,32 @@ convert_to_lists = webnotes.conn.convert_to_lists
class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d, dl
def __init__(self, d, dl):
self.doc, self.doclist = d, dl
def get_details(self):
if not (self.doc.bank_account and self.doc.from_date and self.doc.to_date):
msgprint("Bank Account, From Date and To Date are Mandatory")
return
dl = sql("select t1.name, t1.cheque_no, t1.cheque_date, t2.debit, t2.credit, t1.posting_date, t2.against_account from `tabJournal Voucher` t1, `tabJournal Voucher Detail` t2 where t2.parent = t1.name and t2.account = %s and (clearance_date is null or clearance_date = '0000-00-00' or clearance_date = '') and (t1.cheque_no is not null or t1.cheque_no != '') and t1.posting_date >= %s and t1.posting_date <= %s and t1.docstatus=1", (self.doc.bank_account, self.doc.from_date, self.doc.to_date))
self.doc.clear_table(self.doclist, 'entries')
self.doc.total_amount = 0.0
def get_details(self):
if not (self.doc.bank_account and self.doc.from_date and self.doc.to_date):
msgprint("Bank Account, From Date and To Date are Mandatory")
return
dl = sql("select t1.name, t1.cheque_no, t1.cheque_date, t2.debit, t2.credit, t1.posting_date, t2.against_account from `tabJournal Voucher` t1, `tabJournal Voucher Detail` t2 where t2.parent = t1.name and t2.account = %s and (clearance_date is null or clearance_date = '0000-00-00' or clearance_date = '') and (t1.cheque_no is not null or t1.cheque_no != '') and t1.posting_date >= %s and t1.posting_date <= %s and t1.docstatus=1", (self.doc.bank_account, self.doc.from_date, self.doc.to_date))
self.doc.clear_table(self.doclist, 'entries')
self.doc.total_amount = 0.0
for d in dl:
nl = addchild(self.doc, 'entries', 'Bank Reconciliation Detail', 1, self.doclist)
nl.posting_date = str(d[5])
nl.voucher_id = str(d[0])
nl.cheque_number = str(d[1])
nl.cheque_date = str(d[2])
nl.debit = flt(d[3])
nl.credit = flt(d[4])
nl.against_account = d[6]
self.doc.total_amount += flt(flt(d[4]) - flt(d[3]))
for d in dl:
nl = addchild(self.doc, 'entries', 'Bank Reconciliation Detail', 1, self.doclist)
nl.posting_date = str(d[5])
nl.voucher_id = str(d[0])
nl.cheque_number = str(d[1])
nl.cheque_date = str(d[2])
nl.debit = flt(d[3])
nl.credit = flt(d[4])
nl.against_account = d[6]
self.doc.total_amount += flt(flt(d[4]) - flt(d[3]))
def update_details(self):
for d in getlist(self.doclist, 'entries'):
if d.clearance_date:
sql("update `tabJournal Voucher` set clearance_date = %s where name=%s", (d.clearance_date, d.voucher_id))
msgprint("Updated")
def update_details(self):
for d in getlist(self.doclist, 'entries'):
if d.clearance_date:
sql("update `tabJournal Voucher` set clearance_date = %s, modified = %s where name=%s", (d.clearance_date, nowdate(), d.voucher_id))
msgprint("Updated")

View File

@@ -31,7 +31,7 @@ class DocType:
ret = {
'company_abbr' : abbr
}
return cstr(ret)
return ret
def validate(self):
# Cost Center name must be unique

View File

@@ -39,7 +39,7 @@ class DocType(TransactionBase):
'company_address': cstr(comp_det[0][0]),
'registration_details': cstr(comp_det[0][1])
}
return cstr(ret)
return ret
# Get party details
#------------------
@@ -56,7 +56,7 @@ class DocType(TransactionBase):
'party_address': cstr(address_display)
}
return cstr(ret)
return ret
# Get TDS Return acknowledgement
#-------------------------------

View File

@@ -1,9 +1,5 @@
cur_frm.cscript.onload = function(doc, cdt, cdn) {
var cp = locals['Control Panel']['Control Panel'];
if(doc.__islocal){
doc.clearance_date ='';
refresh_field('clearance_date');
}
if (!doc.voucher_date) doc.voucher_date = dateutil.obj_to_str(new Date());
@@ -155,4 +151,4 @@ cur_frm.cscript['View Ledger Entry'] = function(doc,cdt,cdn){
report.dt.run();
}
loadreport('GL Entry','General Ledger', callback);
}
}

View File

@@ -38,9 +38,9 @@ class DocType:
args = eval(args)
o_s = sql("select outstanding_amount from `tab%s` where name = '%s'" % (args['doctype'],args['docname']))
if args['doctype'] == 'Payable Voucher':
return cstr({'debit': o_s and flt(o_s[0][0]) or 0})
return {'debit': o_s and flt(o_s[0][0]) or 0}
if args['doctype'] == 'Receivable Voucher':
return cstr({'credit': o_s and flt(o_s[0][0]) or 0})
return {'credit': o_s and flt(o_s[0][0]) or 0}
#--------------------------------------------------------------------------------------------------------
# Create remarks

View File

@@ -0,0 +1,802 @@
# DocType, Journal Voucher
[
# These values are common in all dictionaries
{
'creation': '2010-08-08 17:09:06',
'docstatus': 0,
'modified': '2011-07-28 15:28:12',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all DocType
{
'_last_update': '1311251040',
'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': 309
},
# 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

@@ -1,5 +1,17 @@
$.extend(cur_frm.cscript, {
Generate: function(doc, dt, dn) {
if(doc.installment_amount==''){
msgprint('Set Installment Amount before generating schedule');
return;
}
if(doc.no_of_installments==''){
msgprint('Set Number of Installments before generating schedule');
return;
}
if(doc.start_date==''){
msgprint('Set Start Date before generating schedule');
return;
}
cur_frm.cscript.clear_installments(doc);
tot=0;i=0;
while(tot<flt(doc.invoice_amount)-flt(doc.down_payment)){

View File

@@ -5,7 +5,7 @@
{
'creation': '2011-07-22 17:47:57',
'docstatus': 0,
'modified': '2011-07-27 12:54:48',
'modified': '2011-07-27 15:33:55',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
@@ -19,7 +19,7 @@
'name': '__common__',
'section_style': 'Simple',
'show_in_menu': 0,
'version': 20
'version': 21
},
# These values are common for all DocField
@@ -114,7 +114,7 @@
'fieldname': 'account',
'fieldtype': 'Link',
'idx': 3,
'label': 'Account',
'label': 'Lessee Account',
'options': 'Account',
'permlevel': 0,
'reqd': 1

View File

@@ -36,7 +36,7 @@ class DocType:
# result initiatlization
header = 'Ledger Balances Between ' + getdate(self.doc.from_date).strftime('%d-%m-%Y') + ' and ' + getdate(self.doc.to_date).strftime('%d-%m-%Y')
res = [[header], ['Account', 'Posting Date', 'Voucher Type', 'Voucher No', 'Debit', 'Credit', 'Remarks']]
glc = get_obj('GL Control')
glc = get_obj('GL Control')
for d in getlist(self.doclist, 'ledger_details'):
# Fetch acc details
@@ -59,5 +59,5 @@ class DocType:
res.append(['', '', '', 'Total Debit/Credit', debit, credit])
res.append(['', '', '', 'Opening Balance', opening])
res.append(['', '', '', 'Closing Balance', closing])
return res

View File

@@ -1,54 +0,0 @@
$.extend(cur_frm.cscript, {
Generate: function(doc, dt, dn) {
cur_frm.cscript.clear_installments(doc);
for(var i=0; i< doc.no_of_installments; i++) {
d = LocalDB.add_child(doc, 'Loan Installment', 'installments');
d.amount = doc.loan_amount / doc.no_of_installments;
d.due_date = dateutil.add_months(doc.start_date, i+1);
}
cur_frm.refresh();
},
/* submit:function(doc){
data=doc.get_values();
data['']=
$c_obj(make_doclist(dt,dn),'loan_post',data,function(){});
},*/
refresh: function(doc) {
cur_frm.cscript.hide_show_buttons(doc);
},
hide_show_buttons: function(doc) {
if(doc.docstatus==0) {
hide_field('Installment Reciept'); show_field('Generate');
} else if (doc.docstatus==1) {
show_field('Installment Reciept');hide_field('Generate');
}
},
clear_installments: function(doc) {
$.each(getchildren('Loan Installment', doc.name, 'installments', 'Loan'),
function(i, d) {
LocalDB.delete_doc('Loan Installment', d.name);
}
)
},
'Installment Reciept': function(doc, dt, dn) {
var d = new wn.widgets.Dialog({
width: 500,
title: 'Add a new payment installment',
fields: [
{fieldtype:'Data', label:'Cheque Number', fieldname:'cheque_number', reqd:1},
{fieldtype:'Date', label:'Cheque Date', fieldname:'cheque_date', reqd:1},
{fieldtype:'Link', label:'Bank Account', fieldname:'bank_account', reqd:1, options:'Account'},
{fieldtype:'Button', label:'Update',fieldname:'update'}
]
})
d.show();
d.fields_dict.update.input.onclick = function() {
var data = d.get_values();
if(data) {
$c_obj(make_doclist(dt,dn),'loan_installment_post',data,function(){cur_frm.refresh(); d.hide();});
}
}
}
})

View File

@@ -1,48 +0,0 @@
import webnotes
from webnotes.model.doc import make_autoname, Document, addchild
from webnotes import msgprint
from webnotes.utils import get_defaults
import json
from accounts.utils import post_jv
sql = webnotes.conn.sql
class DocType:
def __init__(self, doc, doclist):
self.doc, self.doclist = doc, doclist
def autoname(self):
"""
Create Loan Id using naming_series pattern
"""
self.doc.name = make_autoname(self.doc.naming_series+ '.#####')
def loan_post(self):
data['voucher_type']='Loan Issue'
data['naming_series']='JV'
data['fiscal_year'] = get_defaults()['fiscal_year'] # To be modified to take care
data['company'] = get_defaults()['company']
data['debit_account'] = self.doc['receivable_account']
data['credit_account'] = self.doc['account']
data['amount'] = self.doc.loan_amount
jv_name=post_jv(data)
def loan_installment_post(self, args):
"""
Posts the loan receipt into Journal Voucher
"""
next_inst = sql("select amount,name from `tabLoan Installment` where parent=%s and ifnull(cheque_number,'')='' order by due_date limit 1",self.doc.name)
data = json.loads(args)
data['voucher_type']='Loan Receipt'
data['naming_series']='JV'
data['amount']=next_inst[0][0]
data['debit_account']=data.get('bank_account')
data['credit_account']=self.doc.account
data['fiscal_year']=get_defaults()['fiscal_year']
data['company']=get_defaults()['company']
jv_name=post_jv(data)
sql("update `tabLoan Installment` set cheque_number=%s, cheque_date=%s, jv_number=%s where name=%s",(data.get('cheque_number'),data.get('cheque_date'),jv_name,next_inst[0][1]))
self.doclist = [Document(d.doctype, d.name) for d in self.doclist]

View File

@@ -1,172 +0,0 @@
# DocType, Loan
[
# These values are common in all dictionaries
{
'creation': '2011-07-15 10:35:26',
'docstatus': 0,
'modified': '2011-07-18 12:12:19',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all DocType
{
'_last_update': '1310963215',
'colour': 'White:FFF',
'doctype': 'DocType',
'module': 'Accounts',
'name': '__common__',
'section_style': 'Simple',
'show_in_menu': 0,
'version': 15
},
# These values are common for all DocField
{
'doctype': 'DocField',
'name': '__common__',
'parent': 'Loan',
'parentfield': 'fields',
'parenttype': 'DocType',
'permlevel': 0
},
# These values are common for all DocPerm
{
'doctype': 'DocPerm',
'name': '__common__',
'parent': 'Loan',
'parentfield': 'permissions',
'parenttype': 'DocType',
'read': 1,
'role': 'Accounts User'
},
# DocType, Loan
{
'doctype': 'DocType',
'name': 'Loan'
},
# DocPerm
{
'cancel': 1,
'create': 1,
'doctype': 'DocPerm',
'idx': 1,
'permlevel': 0,
'submit': 1,
'write': 1
},
# DocPerm
{
'doctype': 'DocPerm',
'idx': 2,
'permlevel': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'naming_series',
'fieldtype': 'Select',
'idx': 1,
'label': 'Naming Series',
'options': '\nLOAN',
'reqd': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'account',
'fieldtype': 'Link',
'idx': 2,
'label': 'Account',
'options': 'Account',
'reqd': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'receivable_account',
'fieldtype': 'Link',
'idx': 3,
'label': 'Receivable Account',
'options': 'Account'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'invoice',
'fieldtype': 'Link',
'idx': 4,
'label': 'Invoice',
'options': 'Receivable Voucher',
'reqd': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'loan_amount',
'fieldtype': 'Currency',
'idx': 5,
'label': 'Loan Amount',
'reqd': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'start_date',
'fieldtype': 'Date',
'idx': 6,
'label': 'Start Date',
'reqd': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'no_of_installments',
'fieldtype': 'Int',
'idx': 7,
'label': 'No of Installments',
'reqd': 1
},
# DocField
{
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldtype': 'Button',
'idx': 8,
'label': 'Generate',
'trigger': 'Client'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'installments',
'fieldtype': 'Table',
'idx': 9,
'label': 'Installments',
'options': 'Loan Installment'
},
# DocField
{
'allow_on_submit': 1,
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldtype': 'Button',
'idx': 10,
'label': 'Installment Reciept'
}
]

View File

@@ -1,17 +0,0 @@
import unittest
import webnotes
from webnotes.model.code import get_obj
class TestScheduleGeneartion(unittest.TestCase):
def setUp(self):
webnotes.conn.begin()
# create a mock loan
self.loan = get_obj('Loan', 'LOAN00001')
def test_generation(self):
"test the genaration of loan installments"
self.loan.generate()
self.assertEqual(self.loan.get_installment_total(), self.loan.doc.loan_amount)
def tearDown(self):
webnotes.conn.rollback()

View File

@@ -1,111 +0,0 @@
# DocType, Loan Installment
[
# These values are common in all dictionaries
{
'creation': '2011-07-15 10:36:42',
'docstatus': 0,
'modified': '2011-07-15 15:48:34',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all DocType
{
'colour': 'White:FFF',
'doctype': 'DocType',
'istable': 1,
'module': 'Accounts',
'name': '__common__',
'section_style': 'Simple',
'show_in_menu': 0,
'version': 4
},
# These values are common for all DocField
{
'doctype': 'DocField',
'name': '__common__',
'parent': 'Loan Installment',
'parentfield': 'fields',
'parenttype': 'DocType'
},
# DocType, Loan Installment
{
'doctype': 'DocType',
'name': 'Loan Installment'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'amount',
'fieldtype': 'Currency',
'idx': 1,
'label': 'Amount',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'due_date',
'fieldtype': 'Date',
'idx': 2,
'label': 'Due Date',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'cheque_number',
'fieldtype': 'Data',
'idx': 3,
'label': 'Cheque Number',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'cheque_date',
'fieldtype': 'Date',
'idx': 4,
'label': 'Cheque Date',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'deposit_date',
'fieldtype': 'Date',
'idx': 5,
'label': 'Deposit Date',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'realized_date',
'fieldtype': 'Date',
'idx': 6,
'label': 'Realized Date',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'jv_number',
'fieldtype': 'Link',
'hidden': 0,
'idx': 7,
'label': 'JV Number',
'options': 'Journal Voucher',
'permlevel': 1
}
]

View File

@@ -48,14 +48,14 @@ class DocType(TransactionBase):
ret['due_date'] = add_days(cstr(self.doc.posting_date), acc_head and cint(acc_head[0][1]) or 0)
elif not acc_head:
msgprint("%s does not have an Account Head in %s. You must first create it from the Supplier Master" % (self.doc.supplier, self.doc.company))
return cstr(ret)
return ret
def get_cust(self):
ret = {}
if self.doc.credit_to:
ret['supplier'] = get_value('Account',self.doc.credit_to,'master_name')
return cstr(ret)
return ret
# Get Default Cost Center and Expense Head from Item Master
@@ -70,7 +70,7 @@ class DocType(TransactionBase):
if not args['cost_center'] or args['cost_center'] == 'undefined':
cost_center = sql("select cost_center from `tabItem` where name = '%s'" % args['item_code'])
ret['cost_center'] = cost_center and cost_center[0][0] or ''
return cstr(ret)
return ret
# Get Items based on PO or PR
@@ -84,7 +84,7 @@ class DocType(TransactionBase):
self.validate_duplicate_docname('purchase_order')
self.doclist = get_obj('DocType Mapper', 'Purchase Order-Payable Voucher').dt_map('Purchase Order', 'Payable Voucher', self.doc.purchase_order_main, self.doc, self.doclist, "[['Purchase Order', 'Payable Voucher'],['PO Detail', 'PV Detail']]")
ret = eval(self.get_credit_to())
ret = self.get_credit_to()
#self.doc.supplier_name = ret['supplier_name']
#self.doc.supplier_address = ret['supplier_address']
@@ -115,7 +115,7 @@ class DocType(TransactionBase):
'cost_center' : item_det and item_det[0]['cost_center'] or '',
'item_tax_rate' : str(t)
}
return cstr(ret)
return ret
# Advance Allocation
# -------------------
@@ -139,7 +139,7 @@ class DocType(TransactionBase):
def get_rate1(self,acc):
rate = sql("select tax_rate from `tabAccount` where name='%s'"%(acc))
ret={'add_tax_rate' :rate and flt(rate[0][0]) or 0 }
return cstr(ret)
return ret
# *************************** Server Utility Functions *****************************
@@ -345,7 +345,7 @@ class DocType(TransactionBase):
# get tds rate
# -------------
def get_tds_rate(self):
return str({'rate' : flt(get_value('Account', self.doc.tax_code, 'tax_rate'))})
return {'rate' : flt(get_value('Account', self.doc.tax_code, 'tax_rate'))}
# set aging date
#-------------------

View File

@@ -129,7 +129,7 @@ class DocType:
# save
le.save(1)
le_obj.on_update(adv_adj = '')
le_obj.on_update(adv_adj = '', cancel = '')
# Reposting Balances

View File

@@ -90,7 +90,7 @@ class DocType(TransactionBase):
def get_debit_to(self):
acc_head = self.get_customer_account()
if acc_head:
return cstr({ 'debit_to' : acc_head })
return { 'debit_to' : acc_head }
# Set Due Date = Posting Date + Credit Days
@@ -128,7 +128,7 @@ class DocType(TransactionBase):
get_obj('DocType Mapper', 'Sales Order-Receivable Voucher').dt_map('Sales Order', 'Receivable Voucher', self.doc.sales_order_main, self.doc, self.doclist, "[['Sales Order', 'Receivable Voucher'],['Sales Order Detail', 'RV Detail'],['RV Tax Detail','RV Tax Detail'], ['Sales Team', 'Sales Team']]")
self.get_income_account('entries')
ret = eval(self.get_debit_to())
ret = self.get_debit_to()
if ret.has_key('debit_to'):
self.doc.debit_to = ret['debit_to']
@@ -162,7 +162,7 @@ class DocType(TransactionBase):
if ret['warehouse']:
actual_qty = sql("select actual_qty from `tabBin` where item_code = '%s' and warehouse = '%s'" % (item_code, ret['warehouse']))
ret['actual_qty']= actual_qty and flt(actual_qty[0][0]) or 0
return str(ret)
return ret
# Get tax rate if account type is tax
@@ -515,7 +515,7 @@ class DocType(TransactionBase):
ret = {
'actual_qty' : actual_qty and flt(actual_qty[0]['actual_qty']) or 0
}
return cstr(ret)
return ret
# Make GL Entries
# -------------------------

View File

@@ -34,7 +34,7 @@ class DocType:
else:
ret = { 'registration_details': cstr(comp_det[0][0])}
return cstr(ret)
return ret
# Get default bank and tds account
#------------------------------------

View File

@@ -1,17 +1,15 @@
report.customize_filters = function() {
//this.hide_all_filters();
this.mytabs.items['Select Columns'].hide();
this.mytabs.items['More Filters'].hide();
this.add_filter({fieldname:'period', label:'Period', fieldtype:'Select', options:'Monthly'+NEWLINE+'Quarterly'+NEWLINE+'Half Yearly'+NEWLINE+'Annual',report_default:'Quarterly',ignore : 1, parent:'Budget Detail'});
this.add_filter({fieldname:'company', label:'Company', fieldtype:'Link', options:'Company', report_default:sys_defaults.company, ignore : 1, parent:'Budget Detail', in_first_page:1});
this.filter_fields_dict['Budget Detail'+FILTER_SEP +'Fiscal Year'].df.in_first_page = 1;
this.filter_fields_dict['Budget Detail'+FILTER_SEP +'Period'].df.in_first_page = 1;
this.filter_fields_dict['Budget Detail'+FILTER_SEP +'Fiscal Year'].df['report_default'] = sys_defaults.fiscal_year;
}
report.aftertableprint = function(t) {
$yt(t,'*',1,{whiteSpace:'pre'});
}
this.mytabs.items['More Filters'].hide();
this.mytabs.items['Select Columns'].hide();

View File

@@ -51,7 +51,6 @@ for r in res:
q1 = "select sum(t1.budget_allocated) from `tabBudget Detail` t1, `tab%s` t2, `tabAccount` t3 where "
cond2 = " t3.is_pl_account = 'Yes' and t3.debit_or_credit = 'Debit' and t3.name = t1.account and t1.docstatus != 2 and "
if ch:
qur = q1+cond2+cond1+" and t2.name = '%s'"
ret_amt = sql(qur%(based_on,fiscal_year,based_on,r[0].strip()))
@@ -132,11 +131,6 @@ def append_colnames(name, colnames, coltypes, colwidths, coloptions, col_idx):
col_idx[str(c) + n ] = len(colnames) - 1
# make default columns
#coltypes[col_idx[based_on]] = 'Link'
#coloptions[col_idx[based_on]]= based_on
# get start date
start_date = get_value('Fiscal Year', fiscal_year, 'year_start_date')
if not start_date:
@@ -163,11 +157,11 @@ for r in res:
ch = make_child_lst(based_on,r[0].strip())
actual = sql("select sum(ifnull(t1.debit,0))-sum(ifnull(t1.credit,0)) from `tabGL Entry` t1, `tabAccount` t2 where t2.is_pl_account = 'Yes' and t1.is_cancelled = 'No' and t1.cost_center in %s and t2.debit_or_credit = 'Debit' and t1.posting_date between '%s' and '%s' and t1.account = t2.name"%(ch, mon_list[count][data['start_date']], mon_list[count][data['end_date']]))
actual = sql("select sum(ifnull(t1.debit,0))-sum(ifnull(t1.credit,0)) from `tabGL Entry` t1, `tabAccount` t2 where ifnull(t2.is_pl_account, 'No') = 'Yes' and ifnull(t1.is_cancelled, 'No') = 'No' and t1.cost_center in %s and t2.debit_or_credit = 'Debit' and t1.posting_date between '%s' and '%s' and t1.account = t2.name"%(ch, mon_list[count][data['start_date']], mon_list[count][data['end_date']]))
#----------------------------------------------------------
actual = flt(actual[0][0])
r.append(actual)
# ================ Variance ===================================================
r.append(r[idx] - r[idx + 1])
count = count +1
count = count +1

View File

@@ -1 +1,10 @@
SELECT CONCAT(REPEAT(' ', COUNT(parent.name) - 1), node.name) AS name FROM `tabCost Center` AS node,`tabCost Center` AS parent WHERE node.lft BETWEEN parent.lft AND parent.rgt AND node.docstatus !=2 GROUP BY node.name ORDER BY node.lft
SELECT
CONCAT(REPEAT(' ', COUNT(parent.name) - 1), node.name) AS name
FROM
`tabCost Center` AS node,`tabCost Center` AS parent
WHERE
node.lft BETWEEN parent.lft AND parent.rgt
AND node.docstatus !=2
AND node.company_name like '%(company)s%%'
GROUP BY node.name
ORDER BY node.lft

View File

@@ -0,0 +1,11 @@
report.customize_filters = function() {
this.hide_all_filters();
this.add_filter({fieldname:'date', label:'Date', fieldtype:'Date', options:'',ignore : 1, parent:'GL Entry', 'in_first_page':1});
this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Date'].df['report_default']=sys_defaults.year_start_date;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df['report_default']=dateutil.obj_to_str(new Date());
}
$dh(this.mytabs.tabs['More Filters']);
$dh(this.mytabs.tabs['Select Columns']);

View File

@@ -0,0 +1,13 @@
data =[
['Agreement No.','Data','100px',''],
['Lessee Name','Data','300px',''],
['Amount','Currency','120px','']
]
for d in data:
colnames.append(d[0])
coltypes.append(d[1])
colwidths.append(d[2])
coloptions.append(d[3])
col_idx[d[0]] = len(colnames)-1

View File

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

View File

@@ -27,4 +27,4 @@
'doctype': 'Search Criteria',
'name': 'lease_agreement_list'
}
]
]

View File

@@ -0,0 +1,14 @@
report.customize_filters = function() {
this.hide_all_filters();
this.add_filter({fieldname:'date', label:'Date', fieldtype:'Date', options:'',ignore : 1, parent:'GL Entry', 'in_first_page':1});
this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Date'].df['report_default']=dateutil.obj_to_str(new Date());
// this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df['report_default']=dateutil.obj_to_str(new Date());
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df.filter_hide=1;
}
$dh(this.mytabs.tabs['More Filters']);
$dh(this.mytabs.tabs['Select Columns']);

View File

@@ -0,0 +1,13 @@
data =[
['Month','Data','100px',''],
['Year','Data','100px',''],
['Amount','Currency','120px','']
]
for d in data:
colnames.append(d[0])
coltypes.append(d[1])
colwidths.append(d[2])
coloptions.append(d[3])
col_idx[d[0]] = len(colnames)-1

View File

@@ -0,0 +1,9 @@
select date_format(due_date,'%M') as mnt,year(due_date),sum(amount)
from `tabLease Agreement` la,`tabLease Installment` lai
where la.name=lai.parent and (lai.cheque_date is null or lai.cheque_date > '%(date)s')
group by date_format(due_date,'%M-%Y')
order by year(due_date),month(due_date)

View File

@@ -0,0 +1,14 @@
report.customize_filters = function() {
this.hide_all_filters();
this.add_filter({fieldname:'date', label:'Date', fieldtype:'Date', options:'',ignore : 1, parent:'GL Entry', 'in_first_page':1});
this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Date'].df['report_default']=dateutil.obj_to_str(new Date());
// this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df['report_default']=dateutil.obj_to_str(new Date());
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df.filter_hide=1;
}
$dh(this.mytabs.tabs['More Filters']);
$dh(this.mytabs.tabs['Select Columns']);

View File

@@ -0,0 +1,14 @@
data =[
['Agreement No.','Data','100px',''],
['Lessee Name','Data','300px',''],
['Amount','Currency','120px',''],
['Age','Data','100px','']
]
for d in data:
colnames.append(d[0])
coltypes.append(d[1])
colwidths.append(d[2])
coloptions.append(d[3])
col_idx[d[0]] = len(colnames)-1

View File

@@ -0,0 +1,7 @@
select la.name,la.account,lai.amount,cast('%(date)s' as date)-due_date as age
from `tabLease Agreement` la,`tabLease Installment` lai
where la.name=lai.parent and lai.due_date<cast('%(date)s' as date) and (lai.cheque_date is null or lai.cheque_date > cast('%(date)s' as date))
order by cast('%(date)s' as date)-due_date desc

View File

@@ -0,0 +1,14 @@
report.customize_filters = function() {
this.hide_all_filters();
this.add_filter({fieldname:'date', label:'Date', fieldtype:'Date', options:'',ignore : 1, parent:'GL Entry', 'in_first_page':1});
this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Date'].df['report_default']=dateutil.obj_to_str(new Date());
// this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df['report_default']=dateutil.obj_to_str(new Date());
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df.filter_hide=1;
}
$dh(this.mytabs.tabs['More Filters']);
$dh(this.mytabs.tabs['Select Columns']);

View File

@@ -0,0 +1,16 @@
data =[
['Lessee Name','Data','300px',''],
['Below 30 Days','Currency','120px',''],
['Below 90 Days','Currency','120px',''],
['Below 180 Days','Currency','120px',''],
['Below 360 Days','Currency','120px',''],
['Above 360 Days','Currency','120px',''],
]
for d in data:
colnames.append(d[0])
coltypes.append(d[1])
colwidths.append(d[2])
coloptions.append(d[3])
col_idx[d[0]] = len(colnames)-1

View File

@@ -0,0 +1,9 @@
select account,sum(od_30)as od_30,sum(od_90)as od_90,sum(od_180)as od_180,sum(od_360)as od_360,sum(od_1yr)as od_1yr from
(
select account,case when age<=30 then amount end as od_30,case when age between 31 and 90 then amount end as od_90,case when age between 91 and 180 then amount end as od_180,case when age between 181 and 360 then amount end as od_360,case when age>360 then amount end as od_1yr from
(
select la.account,lai.amount,cast('%(date)s' as date)-due_date as age
from `tabLease Agreement` la,`tabLease Installment` lai
where la.name=lai.parent and lai.due_date<'%(date)s' and (lai.cheque_date is null or lai.cheque_date > '%(date)s')
)a
)b group by account order by account

View File

@@ -0,0 +1,11 @@
report.customize_filters = function() {
this.hide_all_filters();
this.add_filter({fieldname:'date', label:'Date', fieldtype:'Date', options:'',ignore : 1, parent:'GL Entry', 'in_first_page':1});
this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Date'].df['report_default']=sys_defaults.year_start_date;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df['report_default']=dateutil.obj_to_str(new Date());
}
$dh(this.mytabs.tabs['More Filters']);
$dh(this.mytabs.tabs['Select Columns']);

View File

@@ -0,0 +1,13 @@
data =[
['Month','Data','100px',''],
['Year','Data','100px',''],
['Amount','Currency','120px','']
]
for d in data:
colnames.append(d[0])
coltypes.append(d[1])
colwidths.append(d[2])
coloptions.append(d[3])
col_idx[d[0]] = len(colnames)-1

View File

@@ -0,0 +1,5 @@
SELECT date_format(gl.posting_date,'%M'),year(gl.posting_date),sum(gl.credit) as amount
FROM `tabGL Entry` gl, `tabAccount` a
WHERE gl.account=a.name and a.master_type='Customer' and gl.credit>0 and gl.posting_date between '%(date)s' and '%(date1)s'
GROUP BY month(gl.posting_date),year(gl.posting_date)
ORDER BY year(gl.posting_date),month(gl.posting_date)

View File

@@ -1,4 +1,4 @@
# Search Criteria, lease_receipt_summary_year_to_date
# Search Criteria, lease_receipt_summary_month_wise
[
# These values are common in all dictionaries
@@ -13,21 +13,18 @@
# These values are common for all Search Criteria
{
'columns': 'GL Entry\x01ID,GL Entry\x01Owner,GL Entry\x01Posting Date,GL Entry\x01Aging Date,GL Entry\x01Account,GL Entry\x01Cost Center,GL Entry\x01Against,GL Entry\x01Against Voucher,GL Entry\x01Voucher Type,GL Entry\x01Voucher No,GL Entry\x01Remarks,GL Entry\x01Is Cancelled,GL Entry\x01Is Opening,GL Entry\x01Fiscal Year,GL Entry\x01Company',
'criteria_name': 'Lease Receipt Summary (Year to date)',
'criteria_name': 'Lease Receipt Summary Month Wise',
'doc_type': 'GL Entry',
'doctype': 'Search Criteria',
'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}",
'module': 'Accounts',
'name': '__common__',
'page_len': 50,
'sort_by': '`tabGL Entry`.`company`',
'sort_order': 'DESC',
'standard': 'Yes'
},
# Search Criteria, lease_receipt_summary_year_to_date
# Search Criteria, lease_receipt_summary_month_wise
{
'doctype': 'Search Criteria',
'name': 'lease_receipt_summary_year_to_date'
'name': 'lease_receipt_summary_month_wise'
}
]
]

View File

@@ -0,0 +1,11 @@
report.customize_filters = function() {
this.hide_all_filters();
this.add_filter({fieldname:'date', label:'Date', fieldtype:'Date', options:'',ignore : 1, parent:'GL Entry', 'in_first_page':1});
this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Date'].df['report_default']=sys_defaults.year_start_date;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df['report_default']=dateutil.obj_to_str(new Date());
}
$dh(this.mytabs.tabs['More Filters']);
$dh(this.mytabs.tabs['Select Columns']);

View File

@@ -0,0 +1,12 @@
data =[
['Lessee Name','Data','300px',''],
['Amount','Currency','120px','']
]
for d in data:
colnames.append(d[0])
coltypes.append(d[1])
colwidths.append(d[2])
coloptions.append(d[3])
col_idx[d[0]] = len(colnames)-1

View File

@@ -0,0 +1,5 @@
SELECT gl.account,sum(gl.credit) as amount
FROM `tabGL Entry` gl, `tabAccount` a
WHERE gl.account=a.name and a.master_type='Customer' and gl.posting_date between '%(date)s' and '%(date1)s'
GROUP BY gl.account
ORDER BY posting_date

View File

@@ -13,12 +13,13 @@
# These values are common for all Search Criteria
{
'columns': 'GL Entry\x01ID,GL Entry\x01Owner,GL Entry\x01Posting Date,GL Entry\x01Aging Date,GL Entry\x01Account,GL Entry\x01Cost Center,GL Entry\x01Against,GL Entry\x01Against Voucher,GL Entry\x01Voucher Type,GL Entry\x01Voucher No,GL Entry\x01Remarks,GL Entry\x01Is Cancelled,GL Entry\x01Is Opening,GL Entry\x01Fiscal Year,GL Entry\x01Company',
'criteria_name': 'Lease Receipts Client wise',
'criteria_name': 'Lease Receipts Client Wise',
'doc_type': 'GL Entry',
'doctype': 'Search Criteria',
'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}",
'module': 'Accounts',
'name': '__common__',
'page_len': 50,
'standard': 'Yes'
},
@@ -27,4 +28,4 @@
'doctype': 'Search Criteria',
'name': 'lease_receipts_client_wise'
}
]
]

View File

@@ -0,0 +1,14 @@
report.customize_filters = function() {
this.hide_all_filters();
this.add_filter({fieldname:'date', label:'Date', fieldtype:'Date', options:'',ignore : 1, parent:'GL Entry', 'in_first_page':1});
this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Date'].df['report_default']=dateutil.obj_to_str(new Date());
// this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df['report_default']=dateutil.obj_to_str(new Date());
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df.filter_hide=1;
}
$dh(this.mytabs.tabs['More Filters']);
$dh(this.mytabs.tabs['Select Columns']);

View File

@@ -0,0 +1,12 @@
data =[
['Year','Data','100px',''],
['Amount','Currency','120px','']
]
for d in data:
colnames.append(d[0])
coltypes.append(d[1])
colwidths.append(d[2])
coloptions.append(d[3])
col_idx[d[0]] = len(colnames)-1

View File

@@ -0,0 +1,9 @@
select year(date_sub(due_date,interval 6 MONTH)) as yr,sum(amount)
from `tabLease Agreement` la,`tabLease Installment` lai
where la.name=lai.parent and (lai.cheque_date is null or lai.cheque_date > '%(date)s')
group by year(date_sub(due_date,interval 6 MONTH))
order by yr