webstaff: prevent barcoding during serials receive if receive template not set
authorGalen Charlton <gmc@equinoxinitiative.org>
Thu, 6 Jul 2017 22:17:02 +0000 (18:17 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Thu, 6 Jul 2017 22:17:02 +0000 (18:17 -0400)
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/templates/staff/serials/t_batch_receive.tt2
Open-ILS/web/js/ui/default/staff/serials/services/core.js

index 176585d..4fd8c39 100644 (file)
       </select>
     </div>
     <div class="col-md-2">
-      <input ng-disabled="!item._receive || bind_or_none($index)" class="form-control" focus-me="$first"
+      <input ng-disabled="!item._receive || bind_or_none($index) || (barcode_items && !item.stream().distribution().receive_unit_template())" class="form-control" focus-me="$first"
              ng-model="item._barcode" type="text" id="item_barcode_{{$index}}"
              ng-required="item._receive && !bind_or_none($index)" eg-enter="focus_next_barcode($index)"/>
+      <div class="alert alert-warning" ng-show="barcode_items && !item.stream().distribution().receive_unit_template()">
+        [% l('Receiving template not set; needed to barcode while receiving') %]
+      </div>
     </div>
     <div class="col-md-1">
       <input type="checkbox" ng-model="item._receive"/>
index 5f2c2a9..6c99ddf 100644 (file)
@@ -951,6 +951,7 @@ function(egCore , orderByFilter , $q , $filter , $uibModal , ngToast , egConfirm
                         if (!n) bc = '';
 
                         angular.forEach($scope.items, function (i) {
+                            if (!i.stream().distribution().receive_unit_template()) return;
                             var _barcode = i._barcode;
                             i._barcode = bc || i._old_barcode;
                             i._old_barcode = _barcode;