mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-03 12:18:46 +02:00
committed by
Mergify
parent
afa7d2b595
commit
76cfa28a42
@@ -896,7 +896,11 @@ class update_entries_after:
|
|||||||
if sle.is_adjustment_entry and flt(sle.qty_after_transaction, self.flt_precision) == 0:
|
if sle.is_adjustment_entry and flt(sle.qty_after_transaction, self.flt_precision) == 0:
|
||||||
sle.stock_value_difference = (
|
sle.stock_value_difference = (
|
||||||
get_stock_value_difference(
|
get_stock_value_difference(
|
||||||
sle.item_code, sle.warehouse, sle.posting_date, sle.posting_time, sle.voucher_no
|
sle.item_code,
|
||||||
|
sle.warehouse,
|
||||||
|
sle.posting_date,
|
||||||
|
sle.posting_time,
|
||||||
|
voucher_detail_no=sle.voucher_detail_no,
|
||||||
)
|
)
|
||||||
* -1
|
* -1
|
||||||
)
|
)
|
||||||
@@ -2353,7 +2357,9 @@ def is_internal_transfer(sle):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def get_stock_value_difference(item_code, warehouse, posting_date, posting_time, voucher_no=None):
|
def get_stock_value_difference(
|
||||||
|
item_code, warehouse, posting_date, posting_time, voucher_no=None, voucher_detail_no=None
|
||||||
|
):
|
||||||
table = frappe.qb.DocType("Stock Ledger Entry")
|
table = frappe.qb.DocType("Stock Ledger Entry")
|
||||||
posting_datetime = get_combine_datetime(posting_date, posting_time)
|
posting_datetime = get_combine_datetime(posting_date, posting_time)
|
||||||
|
|
||||||
@@ -2368,7 +2374,10 @@ def get_stock_value_difference(item_code, warehouse, posting_date, posting_time,
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if voucher_no:
|
if voucher_detail_no:
|
||||||
|
query = query.where(table.voucher_detail_no != voucher_detail_no)
|
||||||
|
|
||||||
|
elif voucher_no:
|
||||||
query = query.where(table.voucher_no != voucher_no)
|
query = query.where(table.voucher_no != voucher_no)
|
||||||
|
|
||||||
difference_amount = query.run()
|
difference_amount = query.run()
|
||||||
|
|||||||
Reference in New Issue
Block a user