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

This commit is contained in:
Nabin Hait
2011-07-10 13:50:00 +05:30
5 changed files with 142 additions and 116 deletions

View File

@@ -44,11 +44,18 @@ class DocType(TransactionBase):
# Get party details
#------------------
def get_party_det(self):
party_det=sql("Select pan_number, address from `tabAccount` where name = '%s'" % self.doc.party_name)
party_det=sql("select master_type, master_name from `tabAccount` where name='%s'" % self.doc.party_name)
if party_det and party_det[0][0]=='Supplier':
try:
rec = sql("select name, address_line1, address_line2, city, country, pincode, state from `tabAddress` where supplier = '%s' and docstatus != 2 order by is_primary_address desc limit 1" %(party_det[0][1]), as_dict = 1)
address_display = cstr((rec[0]['address_line1'] and rec[0]['address_line1'] or '')) + cstr((rec[0]['address_line2'] and '\n' + rec[0]['address_line2'] or '')) + cstr((rec[0]['city'] and '\n'+rec[0]['city'] or '')) + cstr((rec[0]['pincode'] and '\n' + rec[0]['pincode'] or '')) + cstr((rec[0]['state'] and '\n'+rec[0]['state'] or '')) + cstr((rec[0]['country'] and '\n'+rec[0]['country'] or ''))
except:
address_display = ''
ret = {
'pan_number': cstr(party_det[0][0]) ,
'party_address': cstr(party_det[0][1])
'party_address': cstr(address_display)
}
return cstr(ret)
# Get TDS Return acknowledgement

View File

@@ -3,16 +3,16 @@
# These values are common in all dictionaries
{
'creation': '2011-02-10 14:10:08',
'creation': '2011-02-17 13:25:56',
'docstatus': 0,
'modified': '2011-02-17 13:44:37',
'modified': '2011-07-08 13:28:15',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all DocType
{
'_last_update': '1305714022',
'_last_update': '1310019491',
'autoname': 'LAP/.#####',
'colour': 'White:FFF',
'doctype': 'DocType',
@@ -24,7 +24,7 @@
'show_in_menu': 0,
'subject': 'From %(employee_name)s, %(designation)s',
'tag_fields': 'leave_type',
'version': 18
'version': 17
},
# These values are common for all DocField
@@ -54,37 +54,24 @@
# DocPerm
{
'amend': 1,
'cancel': 1,
'amend': 0,
'cancel': 0,
'create': 1,
'doctype': 'DocPerm',
'idx': 1,
'match': 'owner',
'permlevel': 0,
'submit': 1,
'role': 'Employee',
'submit': 0,
'write': 1
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': 'DocPerm',
'idx': 2,
'match': 'owner',
'permlevel': 0,
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 1,
'cancel': 1,
'create': 1,
'doctype': 'DocPerm',
'idx': 3,
'idx': 2,
'permlevel': 0,
'role': 'HR User',
'submit': 1,
@@ -97,7 +84,7 @@
'cancel': 1,
'create': 1,
'doctype': 'DocPerm',
'idx': 4,
'idx': 3,
'permlevel': 0,
'role': 'HR Manager',
'submit': 1,
@@ -106,24 +93,33 @@
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': 'DocPerm',
'idx': 5,
'idx': 4,
'permlevel': 1,
'role': 'HR User'
'role': 'HR User',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': 'DocPerm',
'idx': 6,
'idx': 5,
'permlevel': 1,
'role': 'HR Manager'
'role': 'HR Manager',
'submit': 0,
'write': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'column_break1',
'fieldtype': 'Column Break',
'idx': 1,
'permlevel': 0,
@@ -211,7 +207,6 @@
# DocField
{
'doctype': 'DocField',
'fieldname': 'column_break8',
'fieldtype': 'Column Break',
'idx': 8,
'permlevel': 0,
@@ -275,12 +270,23 @@
'width': '300px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'letter_head',
'fieldtype': 'Link',
'idx': 14,
'label': 'Letter Head',
'options': 'Letter Head',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'amended_from',
'fieldtype': 'Data',
'idx': 14,
'idx': 15,
'label': 'Amended From',
'permlevel': 1
},
@@ -290,7 +296,7 @@
'doctype': 'DocField',
'fieldname': 'amendment_date',
'fieldtype': 'Date',
'idx': 15,
'idx': 16,
'label': 'Amendment Date',
'permlevel': 1
}

View File

@@ -1,7 +1,7 @@
# REMEMBER to update this
# ========================
last_patch = 320
last_patch = 322
#-------------------------------------------
@@ -1281,3 +1281,7 @@ def execute(patch_no):
sql("delete from tabFeed where doc_name like 'New %'")
elif patch_no == 320:
reload_doc('setup', 'doctype', 'series_detail')
elif patch_no == 321:
reload_doc('hr','doctype','leave_application')
elif patch_no == 322:
sql("delete from `tabDocField` where parent = 'Leave Application' and fieldname = 'latter_head'")

View File

@@ -58,7 +58,8 @@ class DocType:
# Company
master_dict = {'Company':{'company_name':company_name,
'abbr':comp_abbr
'abbr':comp_abbr,
'default_currency':currency
}}
self.create_records(master_dict)
@@ -74,7 +75,9 @@ class DocType:
'pr_required':'No',
'emp_created_by':'Naming Series',
'cust_master_name':'Customer Name',
'supp_master_name':'Supplier Name'}
'supp_master_name':'Supplier Name',
'default_currency_format': (currency=='INR') and 'Lacs' or 'Millions'
}
# Set
self.set_defaults(def_args)

View File

@@ -35,7 +35,7 @@ class SupportMailbox(POP3Mailbox):
st = get_obj('Support Ticket', thread_id)
st.make_response_record(content, mail.mail['From'], content_type)
webnotes.conn.set(st.doc, 'status', 'To Reply')
webnotes.conn.set(st.doc, 'status', 'Open')
update_feed(st.doc)
return
@@ -62,3 +62,9 @@ def get_support_mails():
Gets new emails from support inbox and updates / creates Support Ticket records
"""
SupportMailbox().get_messages()
def auto_close_tickets():
"""
Auto Closes Waiting for Customer Support Ticket after 15 days
"""
webnotes.conn.sql("update `tabSupport Ticket` set status = 'Closed' where status = 'Waiting for Customer' and date_sub(curdate(),interval 15 Day) > modified")