5 angular.module('egItemReplaceBarcode',
6 ['ngRoute', 'ui.bootstrap', 'egCoreMod','egUiMod'])
8 .controller('ReplaceItemBarcodeCtrl',
10 function($scope , egCore) {
13 $scope.focusBarcode = true;
15 $scope.updateBarcode = function() {
16 $scope.copyNotFound = false;
17 $scope.updateOK = false;
19 egCore.pcrud.search('acp',
20 {deleted : 'f', barcode : $scope.barcode1})
21 .then(function(copy) {
24 $scope.focusBarcode = true;
25 $scope.copyNotFound = true;
29 $scope.copyId = copy.id();
30 copy.barcode($scope.barcode2);
32 egCore.pcrud.update(copy).then(function(stat) {
33 $scope.updateOK = stat;
34 $scope.focusBarcode = true;