fix: resolved pos return setting to default mode of payment instead of user selection (#45377)

* fix: resolved pos return setting to default mode of payment instead of user selection

* refactor: removed console log statement

* refactor: moved get_payment_data to sales_and_purchase_return.py
This commit is contained in:
Diptanil Saha
2025-01-24 12:41:01 +05:30
committed by GitHub
parent 78c7c1c631
commit 54d234e05d
2 changed files with 46 additions and 1 deletions

View File

@@ -1150,3 +1150,9 @@ def get_available_serial_nos(serial_nos, warehouse):
return frappe.get_all(
"Serial No", filters={"warehouse": warehouse, "name": ("in", serial_nos)}, pluck="name"
)
@frappe.whitelist()
def get_payment_data(invoice):
payment = frappe.db.get_all("Sales Invoice Payment", {"parent": invoice}, ["mode_of_payment", "amount"])
return payment