Fixed planned qty bug and patch to recalculate planned qty