Merge pull request #3999 from nabinhait/planned_qty

Planned Qty logic fixed and reposted for existing