fix: reposting issue with same posting date and posting time (#24570)

* fix: reposting issue with same posting date and posting time

* Update erpnext/stock/stock_ledger.py

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py
index 46919c8..95f8c43 100644
--- a/erpnext/stock/stock_ledger.py
+++ b/erpnext/stock/stock_ledger.py
@@ -202,8 +202,7 @@
 			where
 				item_code = %(item_code)s
 				and warehouse = %(warehouse)s
-				and voucher_type = %(voucher_type)s
-				and voucher_no = %(voucher_no)s
+				and timestamp(posting_date, time_format(posting_time, '%H:%i:%s')) = timestamp(%(posting_date)s, time_format(%(posting_time)s, '%H:%i:%s'))
 			order by
 				creation ASC
 			for update
@@ -794,4 +793,4 @@
 			and qty_after_transaction + {0} < 0
 		order by timestamp(posting_date, posting_time) asc
 		limit 1
-	""".format(args.actual_qty), args, as_dict=1)
\ No newline at end of file
+	""".format(args.actual_qty), args, as_dict=1)