mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-25 07:38:53 +00:00
committed by
Mergify
parent
a2345d467e
commit
b4b8459f2c
@@ -16,7 +16,7 @@ from erpnext.stock.doctype.serial_and_batch_bundle.serial_and_batch_bundle impor
|
|||||||
get_available_serial_nos,
|
get_available_serial_nos,
|
||||||
)
|
)
|
||||||
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos
|
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos
|
||||||
from erpnext.stock.utils import get_incoming_rate, get_stock_balance
|
from erpnext.stock.utils import get_combine_datetime, get_incoming_rate, get_stock_balance
|
||||||
|
|
||||||
|
|
||||||
class OpeningEntryAccountError(frappe.ValidationError):
|
class OpeningEntryAccountError(frappe.ValidationError):
|
||||||
@@ -1061,6 +1061,7 @@ class StockReconciliation(StockController):
|
|||||||
self.posting_date,
|
self.posting_date,
|
||||||
self.posting_time,
|
self.posting_time,
|
||||||
self.name,
|
self.name,
|
||||||
|
sle_creation,
|
||||||
)
|
)
|
||||||
|
|
||||||
precesion = row.precision("current_qty")
|
precesion = row.precision("current_qty")
|
||||||
@@ -1222,8 +1223,11 @@ class StockReconciliation(StockController):
|
|||||||
return current_qty
|
return current_qty
|
||||||
|
|
||||||
|
|
||||||
def get_batch_qty_for_stock_reco(item_code, warehouse, batch_no, posting_date, posting_time, voucher_no):
|
def get_batch_qty_for_stock_reco(
|
||||||
|
item_code, warehouse, batch_no, posting_date, posting_time, voucher_no, sle_creation
|
||||||
|
):
|
||||||
ledger = frappe.qb.DocType("Stock Ledger Entry")
|
ledger = frappe.qb.DocType("Stock Ledger Entry")
|
||||||
|
posting_datetime = get_combine_datetime(posting_date, posting_time)
|
||||||
|
|
||||||
query = (
|
query = (
|
||||||
frappe.qb.from_(ledger)
|
frappe.qb.from_(ledger)
|
||||||
@@ -1236,12 +1240,11 @@ def get_batch_qty_for_stock_reco(item_code, warehouse, batch_no, posting_date, p
|
|||||||
& (ledger.docstatus == 1)
|
& (ledger.docstatus == 1)
|
||||||
& (ledger.is_cancelled == 0)
|
& (ledger.is_cancelled == 0)
|
||||||
& (ledger.batch_no == batch_no)
|
& (ledger.batch_no == batch_no)
|
||||||
& (ledger.posting_date <= posting_date)
|
|
||||||
& (
|
|
||||||
CombineDatetime(ledger.posting_date, ledger.posting_time)
|
|
||||||
<= CombineDatetime(posting_date, posting_time)
|
|
||||||
)
|
|
||||||
& (ledger.voucher_no != voucher_no)
|
& (ledger.voucher_no != voucher_no)
|
||||||
|
& (
|
||||||
|
(ledger.posting_datetime < posting_datetime)
|
||||||
|
| ((ledger.posting_datetime == posting_datetime) & (ledger.creation < sle_creation))
|
||||||
|
)
|
||||||
)
|
)
|
||||||
.groupby(ledger.batch_no)
|
.groupby(ledger.batch_no)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user