Esempio n. 1
0
def _send_gstin_reminder(party_type, party, default_email_id=None, sent_to=None):
	'''Send GST Reminder email'''
	email_id = frappe.db.get_value('Contact', get_default_contact(party_type, party), 'email_id')
	if not email_id:
		# get email from address
		email_id = default_email_id

	if not email_id:
		frappe.throw('Email not found in default contact', exc=EmailMissing)

	if sent_to and email_id in sent_to:
		return

	frappe.sendmail(
		subject='Please update your GSTIN',
		recipients=email_id,
		message='''
		<p>Hello,</p>
		<p>Please help us send you GST Ready Invoices.</p>
		<p>
			<a href="{0}?party={1}">
			Click here to update your GSTIN Number in our system
			</a>
		</p>
		<p style="color: #aaa; font-size: 11px; margin-top: 30px;">
			Get your GST Ready ERP system at <a href="https://erpnext.com">https://erpnext.com</a>
			<br>
			ERPNext is a free and open source ERP system.
		</p>
		'''.format(os.path.join(get_url(), '/regional/india/update-gstin'), party)
	)

	return email_id
Esempio n. 2
0
def set_contact_details(out, party, party_type):
	out.contact_person = get_default_contact(party_type, party.name)

	if not out.contact_person:
		out.update({
			"contact_person": None,
			"contact_display": None,
			"contact_email": None,
			"contact_mobile": None,
			"contact_phone": None,
			"contact_designation": None,
			"contact_department": None
		})
	else:
		out.update(get_contact_details(out.contact_person))
Esempio n. 3
0
def make_contact(supplier):
	contact_name = get_default_contact('Supplier', supplier.supplier_name)
	# make contact if not already exists
	if not contact_name:
		contact = frappe.get_doc({
			'doctype': 'Contact',
			'first_name': supplier.supplier_name,
			'email_id': supplier.supplier_email,
			'is_primary_contact': 1,
			'links': [
				{'link_doctype': 'Supplier', 'link_name': supplier.supplier_name}
			]
		}).insert()
	else:
		contact = frappe.get_doc('Contact', contact_name)

	return contact
Esempio n. 4
0
def _send_gstin_reminder(party_type,
                         party,
                         default_email_id=None,
                         sent_to=None):
    """Send GST Reminder email"""
    email_id = frappe.db.get_value("Contact",
                                   get_default_contact(party_type, party),
                                   "email_id")
    if not email_id:
        # get email from address
        email_id = default_email_id

    if not email_id:
        frappe.throw(_("Email not found in default contact"), exc=EmailMissing)

    if sent_to and email_id in sent_to:
        return

    frappe.sendmail(
        subject="Please update your GSTIN",
        recipients=email_id,
        message="""
		<p>Hello,</p>
		<p>Please help us send you GST Ready Invoices.</p>
		<p>
			<a href="{0}?party={1}">
			Click here to update your GSTIN Number in our system
			</a>
		</p>
		<p style="color: #aaa; font-size: 11px; margin-top: 30px;">
			Get your GST Ready ERP system at <a href="https://erpnext.com">https://erpnext.com</a>
			<br>
			ERPNext is a free and open source ERP system.
		</p>
		""".format(os.path.join(get_url(), "/regional/india/update-gstin"), party),
    )

    return email_id
Esempio n. 5
0
def _send_gstin_reminder(party_type,
                         party,
                         default_email_id=None,
                         sent_to=None):
    '''Send GST Reminder email'''
    email_id = frappe.db.get_value('Contact',
                                   get_default_contact(party_type, party),
                                   'email_id')
    if not email_id:
        # get email from address
        email_id = default_email_id

    if not email_id:
        frappe.throw(_('Email not found in default contact'), exc=EmailMissing)

    if sent_to and email_id in sent_to:
        return

    frappe.sendmail(subject='Please update your GSTIN',
                    recipients=email_id,
                    message='''
		<p>Hello,</p>
		<p>Please help us send you GST Ready Invoices.</p>
		<p>
			<a href="{0}?party={1}">
			Click here to update your GSTIN Number in our system
			</a>
		</p>
		<p style="color: #aaa; font-size: 11px; margin-top: 30px;">
			Get your GST Ready ERP system at <a href="https://ektai.io">https://ektai.io</a>
			<br>
			dokos is a free and open source ERP system.
		</p>
		'''.format(os.path.join(get_url(), '/regional/india/update-gstin'), party))

    return email_id
Esempio n. 6
0
def get_contact_name(ref_doctype, docname):
    # Return address name
    return get_default_contact(ref_doctype, docname)