service.fetchBillSettings = function() {
if (service.settings) return $q.when(service.settings);
return egCore.org.settings(
- ['ui.circ.billing.uncheck_bills_and_unfocus_payment_box','ui.circ.billing.amount_warn','ui.circ.billing.amount_limit']
+ ['ui.circ.billing.uncheck_bills_and_unfocus_payment_box','ui.circ.billing.amount_warn','ui.circ.billing.amount_limit','circ.staff_client.do_not_auto_attempt_print']
).then(function(s) {return service.settings = s});
}
$scope.warn_amount = 1000;
$scope.max_amount = 100000;
$scope.amount_verified = false;
+ $scope.disable_auto_print = false;
// pre-define list-returning funcs in case we access them
// before the grid instantiates
$scope.payment_type, make_payments, note, $scope.check_number)
.then(function(payment_ids) {
- if ($scope.receipt_on_pay) {
+ if (!$scope.disable_auto_print && $scope.receipt_on_pay) {
printReceipt(
$scope.payment_type, payment_ids, make_payments, note);
}
if (s['ui.circ.billing.amount_limit']) {
$scope.max_amount = Number(s['ui.circ.billing.amount_limit']);
}
+ if (s['circ.staff_client.do_not_auto_attempt_print'] && angular.isArray(s['circ.staff_client.do_not_auto_attempt_print'])) {
+ $scope.disable_auto_print = Boolean(
+ s['circ.staff_client.do_not_auto_attempt_print'].indexOf('Bill Pay') > -1
+ );
+ }
});
$scope.gridControls.allItemsRetrieved = function() {
var service = {
// auto-override these events after the first override
auto_override_checkout_events : {},
- require_initials : false
+ require_initials : false,
+ never_auto_print : {
+ hold_shelf_slip : false,
+ hold_transit_slip : false,
+ transit_slip : false
+ }
};
egCore.startup.go().finally(function() {
egCore.org.settings([
'ui.staff.require_initials.patron_standing_penalty',
'ui.admin.work_log.max_entries',
- 'ui.admin.patron_log.max_entries'
+ 'ui.admin.patron_log.max_entries',
+ 'circ.staff_client.do_not_auto_attempt_print'
]).then(function(set) {
service.require_initials = Boolean(set['ui.staff.require_initials.patron_standing_penalty']);
+ if (angular.isArray(set['circ.staff_client.do_not_auto_attempt_print'])) {
+ if (set['circ.staff_client.do_not_auto_attempt_print'].indexOf('Hold Slip') > 1)
+ service.never_auto_print['hold_shelf_slip'] = true;
+ if (set['circ.staff_client.do_not_auto_attempt_print'].indexOf('Hold/Transit Slip') > 1)
+ service.never_auto_print['hold_transit_slip'] = true;
+ if (set['circ.staff_client.do_not_auto_attempt_print'].indexOf('Transit Slip') > 1)
+ service.never_auto_print['transit_slip'] = true;
+ }
});
});
return service.collect_route_data(tmpl, evt, params, options)
.then(function(data) {
-
+
+ var template = data.transit ?
+ (data.patron ? 'hold_transit_slip' : 'transit_slip') :
+ 'hold_shelf_slip';
+ if (service.never_auto_print[template]) {
+ // do not show the dialog or print if the
+ // disabled automatic print attempt type list includes
+ // the specified template
+ return;
+ }
+
// All actions flow from the print data
var print_context = {
if (evt.payload.hold) sound += '.hold';
egCore.audio.play(sound);
- function print_transit() {
- var template = data.transit ?
- (data.patron ? 'hold_transit_slip' : 'transit_slip') :
- 'hold_shelf_slip';
-
+ function print_transit(template) {
return egCore.print.print({
context : 'default',
template : template,
// when auto-print is on, skip the dialog and go straight
// to printing.
if (options.auto_print_holds_transits)
- return print_transit();
+ return print_transit(template);
return $uibModal.open({
templateUrl: tmpl,
$scope.print = function() {
$uibModalInstance.close();
- print_transit();
+ print_transit(template);
}
}]