def create_quotation(self):
		quotation = frappe.new_doc("Quotation")

		values = {
			"doctype": "Quotation",
			"quotation_to": "Customer",
			"order_type": "Shopping Cart",
			"customer": get_customer(frappe.session.user).name,
			"docstatus": 0,
			"contact_email": frappe.session.user,
			"selling_price_list": "_Test Price List Rest of the World",
			"currency": "USD",
			"taxes_and_charges" : "_Test Tax 1",
			"items": [{
				"item_code": "_Test Item",
				"qty": 1
			}],
			"taxes": frappe.get_doc("Sales Taxes and Charges Template", "_Test Tax 1").taxes,
			"company": "_Test Company"
		}

		quotation.update(values)

		quotation.insert(ignore_permissions=True)

		return quotation
예제 #2
0
def get_context(context):
	party = get_customer()
	mobile_no, phone = frappe.db.get_value("Contact", {"email_id": frappe.session.user,
		"customer": party.name}, ["mobile_no", "phone"])

	return {
		"company_name": cstr(party.customer_name if party.doctype == "Customer" else party.company_name),
		"mobile_no": cstr(mobile_no),
		"phone": cstr(phone)
	}
예제 #3
0
def get_context(context):
    party = get_customer()
    mobile_no, phone = frappe.db.get_value("Contact", {
        "email_id": frappe.session.user,
        "customer": party.name
    }, ["mobile_no", "phone"])

    return {
        "company_name":
        cstr(party.customer_name if party.doctype ==
             "Customer" else party.company_name),
        "mobile_no":
        cstr(mobile_no),
        "phone":
        cstr(phone)
    }
예제 #4
0
    def create_quotation(self):
        quotation = frappe.new_doc("Quotation")

        values = {
            "doctype":
            "Quotation",
            "quotation_to":
            "Customer",
            "order_type":
            "Shopping Cart",
            "customer":
            get_customer(frappe.session.user).name,
            "docstatus":
            0,
            "contact_email":
            frappe.session.user,
            "selling_price_list":
            "_Test Price List Rest of the World",
            "currency":
            "USD",
            "taxes_and_charges":
            "_Test Tax 1",
            "items": [{
                "item_code": "_Test Item",
                "qty": 1
            }],
            "taxes":
            frappe.get_doc("Sales Taxes and Charges Template",
                           "_Test Tax 1").taxes,
            "company":
            "_Test Company"
        }

        quotation.update(values)

        quotation.insert(ignore_permissions=True)

        return quotation