def METHOD_NAME(**data):
    data = frappe._dict(data)
    transaction = frappe.get_doc(data)
    if not transaction.company:
        transaction.company = "_Test Indian Registered Company"
    # Update mandatory transaction dates
    if transaction.doctype in ["Purchase Order", "Quotation", "Sales Order"]:
        if not transaction.transaction_date:
            transaction.transaction_date = getdate()
        if transaction.doctype == "Sales Order":
            transaction.delivery_date = getdate()
        if transaction.doctype == "Purchase Order":
            transaction.schedule_date = getdate()
    elif not transaction.posting_date:
        transaction.posting_date = getdate()
    if transaction.doctype in SALES_DOCTYPES:
        if not transaction.get("customer") and transaction.doctype != "Quotation":
            transaction.customer = "_Test Registered Customer"
    else:
        if not transaction.supplier:
            transaction.supplier = "_Test Registered Supplier"
        if (
            transaction.doctype == "Purchase Invoice"
            and not transaction.eligibility_for_itc
        ):
            transaction.eligibility_for_itc = "All Other ITC"
    if transaction.doctype == "POS Invoice":
        transaction.append(
            "payments",
            {
                "mode_of_payment": "Cash",
            },
        )
    company_abbr = frappe.get_cached_value("Company", data.company, "abbr") or "_TIRC"
    append_item(transaction, data, company_abbr)
    # Append taxes
    if data.is_in_state or data.is_in_state_rcm:
        _append_taxes(transaction, ["CGST", "SGST"], company_abbr, rate=9)
    if data.is_out_state or data.is_out_state_rcm:
        _append_taxes(transaction, "IGST", company_abbr, rate=18)
    if data.is_in_state_rcm:
        _append_taxes(transaction, ["CGST RCM", "SGST RCM"], company_abbr, rate=9)
    if data.is_out_state_rcm:
        _append_taxes(transaction, "IGST RCM", company_abbr, rate=18)
    if not data.do_not_save:
        transaction.insert()
        if not data.do_not_submit:
            transaction.submit()
    return transaction