SELECT MIPRowBatches.ID FROM PartialInvProtocolRows PIPRows JOIN MainInvProtocolBatches MIPRowBatches ON MIPRowBatches.Parent_ID = PIPRows.MIPRow_ID LEFT JOIN PartialInvProtocolBatches PIPRowBatches ON PIPRowBatches.Parent_ID = PIPRows.ID AND PIPRowBatches.MIPBatch_ID = MIPRowBatches.ID LEFT JOIN StoreBatches SB ON MIPRowBatches.StoreBatch_ID = SB.ID WHERE PIPRows.ID = :OBJID AND MIPRowBatches.DocumentedQuantity <> 0 AND PIPRowBatches.ID IS NULL ORDER BY SB.Name, MIPRowBatches.QUnit
Generated by ABRA Software a.s. 27.10.2021 16:34:10