Opened 6 years ago
Closed 6 years ago
#129 closed defect (fixed)
Editing plans creates incorrect billing records
| Reported by: | mglb1 | Owned by: | ckb6 |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | ccsd | Version: | HEAD |
| Keywords: | Cc: | ||
| Estimated Hours Work: |
Description
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
Attachments (0)
Change History (2)
comment:1 Changed 6 years ago by cookeac
comment:2 Changed 6 years ago by anonymous
- Resolution set to fixed
- Status changed from new to closed
r1534 fixes this.

Or perhaps the amount should be positive and the quantity negative.
Anyway, the amount should be the standard rate, and the quantity should reflect what is being credited.
Similarly, the new plan also shows an adjusted amount and quantity of 1. It should also show the standard amount and relevant quantity.