mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-20 02:34:41 +00:00
@@ -7,7 +7,6 @@ from erpnext.stock.doctype.purchase_receipt.purchase_receipt import adjust_incom
|
|||||||
|
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
fiscal_year_dates = get_fiscal_year(frappe.utils.datetime.date.today())
|
|
||||||
table = frappe.qb.DocType("Purchase Receipt Item")
|
table = frappe.qb.DocType("Purchase Receipt Item")
|
||||||
parent = frappe.qb.DocType("Purchase Receipt")
|
parent = frappe.qb.DocType("Purchase Receipt")
|
||||||
query = (
|
query = (
|
||||||
@@ -24,12 +23,10 @@ def execute():
|
|||||||
table.qty,
|
table.qty,
|
||||||
parent.conversion_rate,
|
parent.conversion_rate,
|
||||||
)
|
)
|
||||||
.where(
|
.where((table.amount_difference_with_purchase_invoice != 0) & (table.docstatus == 1))
|
||||||
(table.amount_difference_with_purchase_invoice != 0)
|
|
||||||
& (table.docstatus == 1)
|
|
||||||
& (parent.posting_date.between(fiscal_year_dates[1], fiscal_year_dates[2]))
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
if fiscal_year_dates := get_fiscal_year(frappe.utils.datetime.date.today(), raise_on_missing=False):
|
||||||
|
query.where(parent.posting_date.between(fiscal_year_dates[1], fiscal_year_dates[2]))
|
||||||
result = query.run(as_dict=True)
|
result = query.run(as_dict=True)
|
||||||
|
|
||||||
item_wise_billed_qty = get_billed_qty_against_purchase_receipt([item.name for item in result])
|
item_wise_billed_qty = get_billed_qty_against_purchase_receipt([item.name for item in result])
|
||||||
|
|||||||
@@ -13,5 +13,6 @@ def execute():
|
|||||||
"Purchase Receipt Item",
|
"Purchase Receipt Item",
|
||||||
"rate_difference_with_purchase_invoice",
|
"rate_difference_with_purchase_invoice",
|
||||||
"amount_difference_with_purchase_invoice",
|
"amount_difference_with_purchase_invoice",
|
||||||
|
validate=False,
|
||||||
)
|
)
|
||||||
frappe.clear_cache(doctype="Purchase Receipt Item")
|
frappe.clear_cache(doctype="Purchase Receipt Item")
|
||||||
|
|||||||
Reference in New Issue
Block a user