<div class="row" ng-repeat="circ in circ_list">
<div class="flex-row">
<div class="flex-cell well">
- <a href="./circ/patron/{{circ.usr().id()}}/checkout" target="_self">
+ <a ng-if="circ.usr()" target="_self"
+ href="./circ/patron/{{circ.usr().id()}}/checkout">
[% l('[_1], [_2] [_3] : [_4]',
'{{circ.usr().family_name()}}'
'{{circ.usr().first_given_name()}}'
'{{circ.usr().second_given_name()}}'
'{{circ.usr().card().barcode()}}') %]
</a>
+ <span ng-if="!circ.usr()">[% l('<Aged Circulation>') | html %]</span>
<span class="pad-horiz">[% l('Circulation ID: [_1]', '{{circ.id()}}') %]</span>
</div>
<div>
- <button class="btn btn-default" ng-click="addBilling(circ)">
+ <button class="btn btn-default" ng-click="addBilling(circ)"
+ ng-disabled="!circ.usr()">
[% l('Add Billing') %]
</button>
</div>
<div class="flex-cell">[% l('Patron') %]</div>
<div class="flex-cell well">
<a href="./circ/patron/{{prev_circ_usr.id()}}/checkout"
- ng-if="prev_circ_summary" target="_self">
+ ng-if="prev_circ_usr" target="_self">
[% l('[_1], [_2] [_3] : [_4]',
- '{{prev_circ_usr.family_name()}}'
- '{{prev_circ_usr.first_given_name()}}'
- '{{prev_circ_usr.second_given_name()}}'
- '{{prev_circ_usr.card().barcode()}}') %]
+ '{{prev_circ_usr.family_name()}}'
+ '{{prev_circ_usr.first_given_name()}}'
+ '{{prev_circ_usr.second_given_name()}}'
+ '{{prev_circ_usr.card().barcode()}}') %]
</a>
+ <span ng-show="!prev_circ_usr">
+ [% l('<Aged Circulation>') | html %]
+ </span>
</div>
</div>
delete $scope.circ;
delete $scope.circ_summary;
delete $scope.prev_circ_summary;
+ delete $scope.prev_circ_usr;
if (!copyId) return;
egCore.pcrud.search('circ',
).then(null, null, function(summary) {
$scope.prev_circ_summary = summary.summary;
- egCore.pcrud.retrieve('au', summary.usr,
- {flesh : 1, flesh_fields : {au : ['card']}})
+ if (summary.usr) { // aged circs have no 'usr'.
+ egCore.pcrud.retrieve('au', summary.usr,
+ {flesh : 1, flesh_fields : {au : ['card']}})
- .then(function(user) {
- $scope.prev_circ_usr = user;
- });
+ .then(function(user) { $scope.prev_circ_usr = user });
+ }
});
});
}
$scope.retrieveAllPatrons = function() {
var users = new Set();
angular.forEach($scope.circ_list.map(function(circ) { return circ.usr(); }),function(usr) {
- users.add(usr);
+ // aged circs have no 'usr'.
+ if (usr) users.add(usr);
});
users.forEach(function(usr) {
$timeout(function() {
}).then(function(count) {
- egCore.pcrud.search('circ',
+ egCore.pcrud.search('combcirc',
{target_copy : copyId},
{ flesh : 2,
flesh_fields : {
- circ : [
+ combcirc : [
'usr',
'workstation',
'checkin_workstation',
],
au : ['card']
},
- order_by : {circ : 'xact_start desc'},
+ order_by : {combcirc : 'xact_start desc'},
limit : count
}