def METHOD_NAME(doctype, company, start_date):
	document_type = doctype.get("doctype")
	warehouse = get_warehouse(company)
	if document_type == "Purchase Order":
		posting_date = get_random_date(start_date, 1, 30)
	else:
		posting_date = get_random_date(start_date, 31, 364)
	doctype.update(
		{
			"company": company,
			"set_posting_time": 1,
			"transaction_date": posting_date,
			"schedule_date": posting_date,
			"delivery_date": posting_date,
			"set_warehouse": warehouse,
		}
	)
	doc = frappe.get_doc(doctype)
	doc.save(ignore_permissions=True)
	doc.submit()