if ($mode eq 'receive') {
$item->date_received('now');
$item->status('Received');
- } else {
- $item->status('Bindery');
}
# check for types to trigger summary updates
foreach my $unit_id (keys %found_unit_ids) {
# get all the needed issuances for unit
+ # TODO remove 'Bindery' from this search (leaving it in for now for backwards compatibility with any current test environment data)
my $issuances = $editor->search_serial_issuance([ {"+sitem" => {"unit" => $unit_id, "status" => ["Received", "Bindery"]}}, {"join" => {"sitem" => {}}, "order_by" => {"siss" => "date_published"}} ]);
#TODO: evt on search failure
$sort_key =~ s/(\d+)/sprintf '%06d', $1/eg; # this may need improvement
$sunit->sort_key($sort_key);
- if ($mode eq 'bind') {
- $sunit->status(2); # set to 'Bindery' status
- }
-
my $evt = _update_sunit($editor, undef, $sunit);
return $evt if $evt;
}
if ($('serial_manage_items_show_all').checked) {
obj.lists.main.sitem_retrieve_params = {};
} else {
- obj.lists.main.sitem_retrieve_params = {'date_received' : {'!=' : null}, 'status' : {'!=' : 'Bindery'} };
+ obj.lists.main.sitem_retrieve_params = {'date_received' : {'!=' : null}}; // unit set dynamically in 'retrieve'
}
obj.lists.main.sitem_extra_params ={'order_by' : {'sitem' : 'date_expected ASC, stream ASC'}};
- obj.lists.workarea.sitem_retrieve_params = {'status' : 'Bindery'}; // unit set dynamically in 'retrieve'
+ obj.lists.workarea.sitem_retrieve_params = {}; // unit set dynamically in 'retrieve'
obj.lists.workarea.sitem_extra_params ={'order_by' : {'sitem' : 'date_received DESC'}};
// default to **NEW UNIT**
- obj.set_sunit(-2, 'New Unit', '', '');
+ // For now, keep the unit static. TODO: Eventually, keep track of and store the last used unit value for both receive and bind separately
+ // obj.set_sunit(-2, 'New Unit', '', '');
}
},
var robj;
rparams['+sstr'] = { "distribution" : obj.sdist_ids };
- if (obj.mode == 'bind' && list_name == 'workarea') {
- rparams['unit'] = obj.current_sunit_id;
+ if (obj.mode == 'bind') {
+ if (list_name == 'workarea') {
+ rparams['unit'] = obj.current_sunit_id;
+ } else if (!$('serial_manage_items_show_all').checked){
+ rparams['unit'] = {"<>" : obj.current_sunit_id};
+ }
}
var other_params = list.sitem_extra_params;