Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix : resolved issue Error while creating Payment order #1025

Merged
merged 11 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 51 additions & 38 deletions erpnext/accounts/doctype/payment_entry/test_payment_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2200,7 +2200,11 @@ def create_supplier(**args):
args = frappe._dict(args)

if frappe.db.exists("Supplier", args.supplier_name):
return frappe.get_doc("Supplier", args.supplier_name)
doc = frappe.get_doc("Supplier", args.supplier_name)
if doc.name == "_Test Supplier USD" and not frappe.db.exists("Party Account", {"parent": doc.name, "account": "_Test Payable USD - _TC"}):
doc.append("accounts", {"company": args.company, "account": "_Test Payable USD - _TC"})
frappe.db.commit()
return doc
doc = frappe.get_doc(
{
"doctype": "Supplier",
Expand All @@ -2215,12 +2219,11 @@ def create_supplier(**args):
'company': args.company,
'account': '_Test Payable USD - _TC' if args.default_currency == 'USD' else '_Test TDS Payable - _TC',
})

if not args.without_supplier_group:
doc.supplier_group = args.supplier_group or "Services"


doc.insert()
doc.save()
doc.insert(ignore_mandatory=True)
frappe.db.commit()
return doc

Expand Down Expand Up @@ -2260,7 +2263,7 @@ def create_account():

if account["parent"]:
doc.parent_account = account["parent"]

doc.insert(ignore_mandatory=True)
frappe.db.commit()

Expand Down Expand Up @@ -2295,40 +2298,50 @@ def create_records(supplier):


def make_test_item(item_name=None):
from erpnext.stock.doctype.item.test_item import make_item
from erpnext.stock.doctype.item.test_item import make_item
app_name = "india_compliance"
if not frappe.db.exists("Item", item_name or "Test Item with Tax"):
if app_name in frappe.get_installed_apps():
if not frappe.db.exists("GST HSN Code", '888890'):
frappe.get_doc({
"doctype": 'GST HSN Code',
"hsn_code": '888890',
"description": 'test'
}).insert()
frappe.db.commit()

item= make_item(
item_name or "Test Item with Tax",
{
"is_stock_item": 1,
"gst_hsn_code": "888890",
},
)

return item

if not frappe.db.exists("Item", item_name or "Test Item with Tax"):
app_name = "india_compliance"

if app_name in frappe.get_installed_apps():
if not frappe.db.exists("GST HSN Code", '888890'):
frappe.get_doc({
"doctype": 'GST HSN Code',
"hsn_code": '888890',
"description": 'test'
}).insert()
frappe.db.commit()

item= make_item(
item_name or "Test Item with Tax",
{
"is_stock_item": 1,
"gst_hsn_code": "888890",
},
)

return item

else:
item= make_item(
"Test TDS Item",
{
"is_stock_item": 1,
},
)
return item
else:
return frappe.get_doc("Item", item_name or "Test Item with Tax")
else:
item= make_item(
"Test TDS Item",
{
"is_stock_item": 1,
},
)
return item
else:
if app_name in frappe.get_installed_apps():
if not frappe.db.exists("GST HSN Code", '888890'):
frappe.get_doc({
"doctype": 'GST HSN Code',
"hsn_code": '888890',
"description": 'test'
}).insert()
item=frappe.get_doc("Item", item_name or "Test Item with Tax")
if not item.gst_hsn_code:
item.gst_hsn_code="888890"
item.save()
frappe.db.commit()
return item

def create_purchase_invoice(**args):
# return sales invoice doc object
Expand Down
4 changes: 4 additions & 0 deletions erpnext/accounts/doctype/payment_request/payment_request.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,7 @@ frappe.ui.form.on("Payment Request", "is_a_subscription", function (frm) {
});
}
});

frappe.ui.form.on("Payment Request", "is_payment_order_required", function (frm) {
frm.toggle_reqd("bank_account", frm.doc.is_payment_order_required);
})
Loading
Loading