The Stock Count Matched. Why Did the Ledger Go Negative Earlier?
The physical count and the stock report both say three units. That agrees at 5 p.m. The movement ledger can still show a negative balance earlier in the day, especially when a stock issue is entered late with an earlier posting time.
Start with the ledger for the item and warehouse
An ERPNext user reported a backdating and transaction-order problem and asked for a warning. The request was closed as not planned. In ERPNext, open the Stock Ledger Report for the item, warehouse and date, and use the voucher links to inspect the documents behind the movements. For a workbook check, keep effective time and entry time in separate columns. If two movements share an effective timestamp, obtain the order from the ledger or audit trail. Verify your system’s conventions before applying a tie-break rule.
Rebuild an October 31 stock day in Excel
This synthetic example uses quantities only. The opening snapshot is midnight and the physical count is at 5 p.m. Paste the blocks into sheets named Opening_Stock and Stock_Movements starting in A1. Split at the commas if needed and import timestamps as Excel date-time values. The ledger uses one opening row per SKU and warehouse and a unique sequence within each effective timestamp for that pair.
Opening_Stock
SKU,Warehouse,Opening timestamp,Opening units
FLT-05,East,2026-10-31 00:00,6
FLT-05,West,2026-10-31 00:00,20
SEAL-02,East,2026-10-31 00:00,5
Stock_Movements
Movement,SKU,Warehouse,Effective timestamp,Ledger sequence,Entered timestamp,Units change,Status
MV-110,FLT-05,East,2026-10-31 09:00,10,2026-10-31 09:02,-4,Posted
MV-130,FLT-05,East,2026-10-31 10:00,30,2026-10-31 10:05,6,Posted
MV-140,FLT-05,East,2026-10-31 11:00,40,2026-10-31 11:05,-2,Posted
MV-120,FLT-05,East,2026-10-31 10:00,20,2026-10-31 16:30,-3,Posted
MV-150,FLT-05,West,2026-10-31 10:00,50,2026-10-31 10:03,3,Posted
MV-160,SEAL-02,East,2026-10-31 10:00,60,2026-10-31 10:06,-2,Posted
MV-170,FLT-05,East,2026-10-31 09:45,70,2026-10-31 09:45,10,Draft
MV-180,FLT-05,East,2026-11-01 08:00,80,2026-11-01 08:01,7,Posted
In Stock_Movements, enter =DATE(2026,10,31)+TIME(17,0,0) in K1 and =DATE(2026,10,31) in K2. Put the following in I2, then fill down to I9. It starts from opening stock, adds earlier eligible movements, then adds eligible movements at the same time through the current sequence. It leaves drafts and rows beyond the cutoff blank.
=IF(AND(H2="Posted",D2>$K$2,D2<=$K$1,F2<=$K$1),SUMIFS(Opening_Stock!$D$2:$D$4,Opening_Stock!$A$2:$A$4,B2,Opening_Stock!$B$2:$B$4,C2)+SUMIFS($G$2:$G$9,$B$2:$B$9,B2,$C$2:$C$9,C2,$F$2:$F$9,"<="&$K$1,$H$2:$H$9,"Posted",$D$2:$D$9,">"&$K$2,$D$2:$D$9,"<"&D2)+SUMIFS($G$2:$G$9,$B$2:$B$9,B2,$C$2:$C$9,C2,$F$2:$F$9,"<="&$K$1,$H$2:$H$9,"Posted",$D$2:$D$9,D2,$E$2:$E$9,"<="&E2),"")
To read the result, sort the full rows by SKU, warehouse, effective timestamp and ledger sequence. Keep both timestamp columns. In this example, changing K1 moves both the time inspected and the limit on what had been entered.
Find the first dip and the movement that reversed it
FLT-05 East starts at 6. The 9 a.m. issue leaves 2. At 10 a.m., MV-120 has sequence 20 and takes the balance to −1. MV-130, sequence 30, adds 6 at the same time and brings it to 5. The 11 a.m. issue leaves 3, matching the closing count. FLT-05 West closes at 23 and SEAL-02 East at 3, with no negative balances for either pair.
MV-120 was entered at 4:30 p.m. but effective at 10 a.m. Change K1 to =DATE(2026,10,31)+TIME(16,29,59) to see what the workbook would have shown one second earlier. FLT-05 East goes 6 → 2 → 8 → 6 with no negative balance. This check identifies which voucher to investigate. It takes a review of the record to decide whether the entry time, effective time or another detail needs correcting.
Trace the dip back to the workbook rows
Open the workbook in Jolene.pro and ask for the first negative balance by SKU and warehouse, the movement that restored it, and the cells behind both. Give it the count cutoff and the rule for same-time movements. Ask for a second view as of just before the late entry was recorded, then compare both paths with the ledger export.