Beispiel #1
0
def make_pos_invoice():
	make_sales_order()

	for data in frappe.get_all('Sales Order', fields=["name"],
		filters = [["per_billed", "<", "100"]]):
		si = frappe.get_doc(make_sales_invoice(data.name))
		si.is_pos =1
		si.posting_date = frappe.flags.current_date
		for d in si.get("items"):
			if not d.income_account:
				d.income_account = "Sales - {}".format(frappe.db.get_value('Company', si.company, 'abbr'))
		si.set_missing_values()
		make_payment_entries_for_pos_invoice(si)
		si.insert()
		si.submit()
Beispiel #2
0
def make_pos_invoice():
    make_sales_order()

    for data in frappe.get_all('Sales Order', fields=["name"],
                               filters=[["per_billed", "<", "100"]]):
        si = frappe.get_doc(make_sales_invoice(data.name))
        si.is_pos = 1
        si.posting_date = frappe.flags.current_date
        for d in si.get("items"):
            if not d.income_account:
                d.income_account = "Sales - {}".format(
                    frappe.get_cached_value('Company',  si.company,  'abbr'))
        si.set_missing_values()
        make_payment_entries_for_pos_invoice(si)
        si.insert()
        si.submit()