(WIP) Ex-60 As an EdX finance employee, I can “invalidate” unpaid purchases.

1) @cdodge Here i am just sharing the change set related to instructor dashboard where a fincance admin can invalidate or re-validate the sales. Currently I am only updating the "is_valid" field in the "invoice" model that will be helpful in identification of valid and invalid registration codes + some UI changes. 

2) The second part of this story as mentioned below is in pending state as waiting from the UX organization for the message pattern and any mockups. 

---- [ First-order implementation: when a student with an invalidated enrollment tries to access the courseware, they cannot access the courseware, and are instead presented with the message: "Payment for your place in this course is overdue. Please contact the person responsible for payment." Student messaging will be determined by UX (https://openedx.atlassian.net/browse/UX-835) ] 

3) @cdodge with reference to your email, you were saying that  we should also set the is_active flag to False on the courseware registration table. Are you pointing to [student_courseenrollment] model ? if YES then i was observing that when we set that flag to false then it redirects the user to course about page.

I will wait for your suggestions in order to complete this story. @Lyla-Fischer 

Thanks.

Press any numeric keys = event.keyCode is 0 while have data in event.which. 
Press the keys belongs to list [BACKSPACE, DELETE, LEFT_ARROW, RIGHT_ARROW] = event.keyCode have SomeValue while donot have data in event.which. 

so on that's why i used the event.keyCode in case of specific keys.
we cannot just rely on event.keyCode in the entire function as it can returns 0  and not just on event.which that can also retrun 0  e.g. when u select the all data in textfield and press DELETE, in this case we have somevalue in event.keyCode while event.which is 0 . 

However if u suggest i can simplify the function like that.

function validateNumber(event) {
    var key = window.event ? event.keyCode : event.which;
    var BACKSPACE = 8, DELETE = 46, LEFT_ARROW = 37, RIGHT_ARROW = 39;
    if ( (event.which > 48 && event.which < 57) || ($.inArray(event.which, [BACKSPACE, DELETE, LEFT_ARROW, RIGHT_ARROW]) > -1 )) {
        return true;
    }
    else return false;
};