Fixed the  discount value bug

@chrisndodge I have added the functionality of [Ex-40]. Kindly review the changes.

Thanks
@chrisndodge Thanks for pointing out this. I have handled this in jQuery. Also added the error handling in the backend. Kindly review the changes. 

Thanks