Yous sell it for what the software is worth to the business. In most cases it would be done by contract, in which case they can cancel you half way during development and owe you nothing(however...