This patch changes how the web staff client retrieves the list
of billing types available for use by the Bill Patron modal. PCRUD
permissions on config.billing_type don't quite match how the
the set of billing types available to a staff user used to work
in the XUL staff client, so this patch uses the
open-ils.circ.billing_type.ranged.retrieve.all method instead.
To test
-------
[1] Log in as a Circulators staff user (assuming stock data
and permissions).
[2] Try the Bill Patron dialog in the web staff client; note that
no billing types are accessible.
[3] Apply the patch and repeat step #2. This time, it should
include the miscellaneous billing type.
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
return $q.when(egCore.env.cbt.list);
}
- return egCore.pcrud.search('cbt',
- { // first 100 are reserved for system-generated bills
- id : {'>' : 100},
- owner : egCore.org.ancestors(
- egCore.auth.user().ws_ou(), true)
- },
- {}, {atomic : true}
+ return egCore.net.request(
+ 'open-ils.circ',
+ 'open-ils.circ.billing_type.ranged.retrieve.all',
+ egCore.auth.token(),
+ egCore.auth.user().ws_ou()
).then(function(list) {
+ list = list.filter(function(item) {
+ // first 100 are reserved for system-generated bills
+ return item.id() > 100;
+ });
egCore.env.absorbList(list, 'cbt');
return list;
});