1428 | | # def setBillingCodeValues(self, code, newbalance, newpagecounter) : |
1429 | | # def consumeBillingCode(self, code, balance, pagecounter) : |
| 1428 | def setBillingCodeValues(self, code, newbalance, newpagecounter) : |
| 1429 | """Sets the new page counter and balance for a billing code.""" |
| 1430 | fields = { |
| 1431 | "pykotaPageCounter" : str(newpagecounter), |
| 1432 | "pykotaBalance" : str(newbalance), |
| 1433 | } |
| 1434 | return self.doModify(code.ident, fields) |
| 1435 | |
| 1436 | def consumeBillingCode(self, code, balance, pagecounter) : |
| 1437 | """Consumes from a billing code.""" |
| 1438 | fields = { |
| 1439 | "pykotaBalance" : { "operator" : "-", "value" : balance, "convert" : float }, |
| 1440 | "pykotaPageCounter" : { "operator" : "+", "value" : pagecounter, "convert" : int }, |
| 1441 | } |
| 1442 | return self.doModify(code.ident, fields) |