When user selects a discount rate and then decides to enter a flat amount the discount rate is still there. If user come back to modify order items then they may think that the discount amount applied but really the discount rate will be used instead.
Fix is to have discount_amount textbox trigger 'skip_discount_rate' to true. When discount rate is selected then this will be set to true. apply_discount method always check for this to be false before applying.
When user selects a discount rate and then decides to enter a flat amount the discount rate is still there. If user come back to modify order items then they may think that the discount amount applied but really the discount rate will be used instead.