add in un-distribute function to scale

Issue No: SC-226
Created 6/21/2016 9:53:44 AM
Type Feature
Priority Major
Status Closed
Resolution Fixed
Fixed Version 17.1
Description Goal: To put the ticket back into the same state before it was distributed.   1. Add Undistribute button on ticket entry toolbar.   When undistribute is clicked, the program will:   a) Unpost the Voucher or Invoice and delete it if it has not been paid.   b) Unpost and delete all I/Rs or I/Ss (or invoice/voucher for direct tickets, or transfer for transfer)   c) Contract balance should be returned if the IR/IS has been deleted.   d) Scheduled qty is reduced if the ticket has been deleted or void.   e) Load scheduled (logistics) is returned back to as an available load if the ticket is Void, deleted, load is removed from the ticket or another load is selected.   f) if storage associated, must check if storage balance equal original and if so then remove storage, else give message saying that the ticket is unable to distribute because storage ticket quantity has been changed. When storage cannot be removed (settlements against it or units differ from original).   g) tickets that are split will Undistribute each part of the split with the same validations of a ticket that is not split. If any part of the split ticket can not be Undistributed then a message will need to say for which Customer/Vendor can not be undistributed.     NOTE: a or b failing stops undistribute with a message. Example: Voucher has been paid unable to Unpost.   Ties to GRN-428