how stock changes when billdetails changed

it is forbidden in the real business, but it is interesting.