Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
commit
9912d0e5e6
@ -3,11 +3,11 @@
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2012-07-03 13:30:49',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-07-12 14:08:27',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'wasim@webnotestech.com'
|
||||
u'creation': '2012-09-18 11:20:24',
|
||||
u'docstatus': 0,
|
||||
u'modified': '2012-09-28 12:27:43',
|
||||
u'modified_by': u'Administrator',
|
||||
u'owner': u'wasim@webnotestech.com'
|
||||
},
|
||||
|
||||
# These values are common for all DocType
|
||||
@ -16,11 +16,11 @@
|
||||
'autoname': u'PVTD.######',
|
||||
'colour': u'White:FFF',
|
||||
'default_print_format': u'Standard',
|
||||
'doctype': 'DocType',
|
||||
u'doctype': u'DocType',
|
||||
'hide_heading': 1,
|
||||
'istable': 1,
|
||||
'module': u'Accounts',
|
||||
'name': '__common__',
|
||||
u'name': u'__common__',
|
||||
'section_style': u'Tray',
|
||||
'server_code_error': u' ',
|
||||
'show_in_menu': 0,
|
||||
@ -29,8 +29,8 @@
|
||||
|
||||
# These values are common for all DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
u'doctype': u'DocField',
|
||||
u'name': u'__common__',
|
||||
'parent': u'Purchase Taxes and Charges',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType'
|
||||
@ -38,13 +38,13 @@
|
||||
|
||||
# DocType, Purchase Taxes and Charges
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'Purchase Taxes and Charges'
|
||||
u'doctype': u'DocType',
|
||||
u'name': u'Purchase Taxes and Charges'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'charge_type',
|
||||
'fieldtype': u'Select',
|
||||
'label': u'Type',
|
||||
@ -58,7 +58,7 @@
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'account_head',
|
||||
'fieldtype': u'Link',
|
||||
'label': u'Account Head',
|
||||
@ -72,7 +72,7 @@
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'cost_center',
|
||||
'fieldtype': u'Link',
|
||||
'label': u'Cost Center',
|
||||
@ -85,7 +85,7 @@
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'description',
|
||||
'fieldtype': u'Small Text',
|
||||
'label': u'Description',
|
||||
@ -98,7 +98,7 @@
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'rate',
|
||||
'fieldtype': u'Currency',
|
||||
'label': u'Rate',
|
||||
@ -111,7 +111,7 @@
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'tax_amount',
|
||||
'fieldtype': u'Currency',
|
||||
'label': u'Amount',
|
||||
@ -124,7 +124,7 @@
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'total',
|
||||
'fieldtype': u'Currency',
|
||||
'label': u'Total',
|
||||
@ -135,7 +135,7 @@
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'row_id',
|
||||
'fieldtype': u'Data',
|
||||
'hidden': 0,
|
||||
@ -149,8 +149,8 @@
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'description': u'For Both',
|
||||
'doctype': u'DocField',
|
||||
'default': u'Valuation and Total',
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'category',
|
||||
'fieldtype': u'Select',
|
||||
'label': u'Consider Tax or Charge for',
|
||||
@ -165,7 +165,7 @@
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'default': u'Add',
|
||||
'doctype': u'DocField',
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'add_deduct_tax',
|
||||
'fieldtype': u'Select',
|
||||
'label': u'Add or Deduct',
|
||||
@ -180,7 +180,7 @@
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'doctype': u'DocField',
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'item_wise_tax_detail',
|
||||
'fieldtype': u'Small Text',
|
||||
'hidden': 1,
|
||||
@ -193,7 +193,7 @@
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'parenttype',
|
||||
'fieldtype': u'Data',
|
||||
'hidden': 1,
|
||||
@ -209,7 +209,7 @@
|
||||
# DocField
|
||||
{
|
||||
'description': u'Cheating Field\nPlease do not delete ',
|
||||
'doctype': u'DocField',
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'total_tax_amount',
|
||||
'fieldtype': u'Currency',
|
||||
'hidden': 1,
|
||||
@ -225,7 +225,7 @@
|
||||
# DocField
|
||||
{
|
||||
'description': u'Cheating Field\nPlease do not delete ',
|
||||
'doctype': u'DocField',
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'total_amount',
|
||||
'fieldtype': u'Currency',
|
||||
'hidden': 1,
|
||||
|
@ -30,10 +30,7 @@ def execute():
|
||||
fy_obj = get_obj('Fiscal Year', f[0])
|
||||
fy_obj.doc.past_year = prev_fy
|
||||
fy_obj.doc.company = c[0]
|
||||
fy_obj.doc.save()
|
||||
|
||||
fy_obj = get_obj('Fiscal Year', f[0])
|
||||
fy_obj.repost()
|
||||
prev_fy = f[0]
|
||||
sql("commit")
|
||||
sql("start transaction")
|
||||
webnotes.conn.commit()
|
||||
webnotes.conn.begin()
|
@ -83,7 +83,7 @@ class DocType:
|
||||
|
||||
|
||||
def on_update(self):
|
||||
if self.doc.contact_by:
|
||||
if self.doc.contact_date:
|
||||
self.add_calendar_event()
|
||||
|
||||
if not self.doc.naming_series:
|
||||
@ -104,44 +104,19 @@ class DocType:
|
||||
# delete any earlier event by this lead
|
||||
sql("delete from tabEvent where ref_type='Lead' and ref_name=%s", self.doc.name)
|
||||
|
||||
in_calendar_of = self.doc.lead_owner
|
||||
|
||||
# get profile (id) if exists for contact_by
|
||||
email_id = webnotes.conn.get_value('Sales Person', self.doc.contact_by, 'email_id')
|
||||
if webnotes.conn.exists('Profile', email_id):
|
||||
in_calendar_of = email_id
|
||||
|
||||
# create new event
|
||||
ev = Document('Event')
|
||||
ev.owner = in_calendar_of
|
||||
ev.description = 'Contact ' + cstr(self.doc.lead_name) + '.By : ' + cstr(self.doc.contact_by) + '.To Discuss : ' + cstr(self.doc.remark)
|
||||
ev.owner = self.doc.lead_owner
|
||||
ev.description = ('Contact ' + cstr(self.doc.lead_name)) + \
|
||||
(self.doc.contact_by and ('. By : ' + cstr(self.doc.contact_by)) or '') + \
|
||||
(self.doc.remark and ('.To Discuss : ' + cstr(self.doc.remark)) or '')
|
||||
ev.event_date = self.doc.contact_date
|
||||
ev.event_hour = '10:00'
|
||||
ev.event_type = 'Private'
|
||||
ev.ref_type = 'Lead'
|
||||
ev.ref_name = self.doc.name
|
||||
ev.save(1)
|
||||
|
||||
def add_in_follow_up(self,message,type):
|
||||
import datetime
|
||||
child = addchild( self.doc, 'follow_up', 'Communication Log', 1, self.doclist)
|
||||
child.date = datetime.datetime.now().date().strftime('%Y-%m-%d')
|
||||
child.notes = message
|
||||
child.follow_up_type = type
|
||||
child.save()
|
||||
|
||||
#-------------------SMS----------------------------------------------
|
||||
def send_sms(self):
|
||||
if not self.doc.sms_message or not self.doc.mobile_no:
|
||||
msgprint("Please enter mobile number in Basic Info Section and message in SMS Section ")
|
||||
raise Exception
|
||||
else:
|
||||
receiver_list = []
|
||||
if self.doc.mobile_no:
|
||||
receiver_list.append(self.doc.mobile_no)
|
||||
for d in getlist(self.doclist,'lead_sms_detail'):
|
||||
if d.other_mobile_no:
|
||||
receiver_list.append(d.other_mobile_no)
|
||||
|
||||
if receiver_list:
|
||||
msgprint(get_obj('SMS Control', 'SMS Control').send_sms(receiver_list, self.doc.sms_message))
|
||||
# self.add_in_follow_up(self.doc.sms_message,'SMS')
|
||||
event_user = addchild(ev, 'event_individuals', 'Event User')
|
||||
event_user.person = self.doc.contact_by
|
||||
event_user.save()
|
@ -42,14 +42,7 @@ keydict = {
|
||||
|
||||
class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
|
||||
def get_bal(self,arg):
|
||||
"""get account balance (??)"""
|
||||
from webnotes.utils import fmt_money, flt
|
||||
bal = webnotes.conn.sql("select `tabAccount Balance`.balance,`tabAccount`.debit_or_credit from `tabAccount`,`tabAccount Balance` where `tabAccount Balance`.account=%s and `tabAccount Balance`.period=%s and `tabAccount Balance`.account=`tabAccount`.name ",(arg,self.doc.current_fiscal_year))
|
||||
if bal:
|
||||
return fmt_money(flt(bal[0][0])) + ' ' + bal[0][1]
|
||||
self.doc, self.doclist = d, dl
|
||||
|
||||
def on_update(self):
|
||||
"""update defaults"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user