Here\'s my scenario:
Table A Table B IDa = 1 IDb = 1 | IDa = 1 | QtyIn = 2 | QtyOut = 0 IDa = 2 IDb = 2 | IDa = 1 | QTyIn = 0 | QtyOut = 1