Editing plans creates incorrect billing records
|Reported by:||mglb1||Owned by:||ckb6|
|Estimated Hours Work:|
When changing plans incorrect billing records are generated. In particular the python code is calculating the amount of the discount and then inserting that into billing_record with a quantity of 1 and a non-negative value. It should insert the amount as the full price of the plan (with a negative value to note it as a credit), and then put in a decimal quantity so that when multiplied together the appropriate price is entered.
Eg. a plan that costs $57.78/month and the user is being credited for 7 days (out of 31), should have an entry like: amount=-57.78, quantity=0.23. Currently the entry created is amount=13.05, quantity=1