Compare commits

..

2 Commits

Author SHA1 Message Date
Anuja Pawar
3918951cb1 fix: fix to fetch customers and billing email in PSOA (#27363)
(cherry picked from commit a58e309297)

# Conflicts:
#	erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.json
#	erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py
2025-02-25 00:12:24 +00:00
mergify[bot]
f5160dc83d fix: use Stock Qty while getting POS Reserved Qty (backport #38962) (#38983)
fix: use `Stock Qty` while getting `POS Reserved Qty`

(cherry picked from commit 7223106417)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-12-28 12:00:04 +05:30
4 changed files with 28 additions and 3 deletions

View File

@@ -4,7 +4,7 @@ import frappe
from erpnext.hooks import regional_overrides
__version__ = "13.55.2"
__version__ = "13.54.4"
def get_default_company(user=None):

View File

@@ -704,7 +704,7 @@ def get_pos_reserved_qty(item_code, warehouse):
reserved_qty = (
frappe.qb.from_(p_inv)
.from_(p_item)
.select(Sum(p_item.qty).as_("qty"))
.select(Sum(p_item.stock_qty).as_("stock_qty"))
.where(
(p_inv.name == p_item.parent)
& (IfNull(p_inv.consolidated_invoice, "") == "")
@@ -715,7 +715,7 @@ def get_pos_reserved_qty(item_code, warehouse):
)
).run(as_dict=True)
return reserved_qty[0].qty or 0 if reserved_qty else 0
return flt(reserved_qty[0].stock_qty) if reserved_qty else 0
@frappe.whitelist()

View File

@@ -294,10 +294,15 @@
}
],
"links": [],
<<<<<<< HEAD
"modified": "2022-10-17 17:47:08.662475",
=======
"modified": "2021-09-06 21:00:45.732505",
>>>>>>> a58e309297 (fix: fix to fetch customers and billing email in PSOA (#27363))
"modified_by": "Administrator",
"module": "Accounts",
"name": "Process Statement Of Accounts",
"naming_rule": "Set by user",
"owner": "Administrator",
"permissions": [
{

View File

@@ -241,8 +241,15 @@ def fetch_customers(customer_collection, collection_name, primary_mandatory):
billing_email = get_customer_emails(customer.name, 1, billing_and_primary=False)
if int(primary_mandatory):
<<<<<<< HEAD
if primary_email == "":
continue
=======
if (primary_email == ''):
continue
elif (billing_email == '') and (primary_email == ''):
continue
>>>>>>> a58e309297 (fix: fix to fetch customers and billing email in PSOA (#27363))
customer_list.append(
{
@@ -257,12 +264,20 @@ def fetch_customers(customer_collection, collection_name, primary_mandatory):
@frappe.whitelist()
def get_customer_emails(customer_name, primary_mandatory, billing_and_primary=True):
<<<<<<< HEAD
"""Returns first email from Contact Email table as a Billing email
when Is Billing Contact checked
and Primary email- email with Is Primary checked"""
billing_email = frappe.db.sql(
"""
=======
""" Returns first email from Contact Email table as a Billing email
when Is Billing Contact checked
and Primary email- email with Is Primary checked """
billing_email = frappe.db.sql("""
>>>>>>> a58e309297 (fix: fix to fetch customers and billing email in PSOA (#27363))
SELECT
email.email_id
FROM
@@ -279,6 +294,7 @@ def get_customer_emails(customer_name, primary_mandatory, billing_and_primary=Tr
link.link_doctype='Customer'
and link.link_name=%s
and contact.is_billing_contact=1
<<<<<<< HEAD
{mcond}
ORDER BY
contact.creation desc
@@ -287,6 +303,10 @@ def get_customer_emails(customer_name, primary_mandatory, billing_and_primary=Tr
),
customer_name,
)
=======
ORDER BY
contact.creation desc""", customer_name)
>>>>>>> a58e309297 (fix: fix to fetch customers and billing email in PSOA (#27363))
if len(billing_email) == 0 or (billing_email[0][0] is None):
if billing_and_primary: