| 301 | def getAllBillingCodes(self, billingcode=None) : |
| 302 | """Extracts all billing codes or only the billing codes matching the optional parameter.""" |
| 303 | billingcodes = [] |
| 304 | ldapfilter = "objectClass=pykotaBilling" |
| 305 | if billingcode : |
| 306 | ldapfilter = "(&(%s)(pykotaBillingCode=%s))" % (ldapfilter, self.userCharsetToDatabase(billingcode)) |
| 307 | result = self.doSearch(ldapfilter, ["pykotaBillingCode"], base=self.info["billingcodebase"]) |
| 308 | if result : |
| 309 | billingcodes = [self.databaseToUserCharset(bc) for bc in self.filterNames(result, "pykotaBillingCode")] |
| 310 | return billingcodes |
| 311 | |