angular.module('ui.calendar',[]).constant('uiCalendarConfig',{calendars:{}}).controller('uiCalendarCtrl',['$scope','$locale',function($scope,$locale){var sources=$scope.eventSources;var extraEventSignature=$scope.calendarWatchEvent?$scope.calendarWatchEvent:angular.noop;var wrapFunctionWithScopeApply=function(functionToWrap){return function(){if($scope.$root.$$phase){return functionToWrap.apply(this,arguments);} var args=arguments;var that=this;return $scope.$root.$apply(function(){return functionToWrap.apply(that,args);});};};var eventSerialId=1;this.eventFingerprint=function(e){if(!e._id){e._id=eventSerialId++;} var extraSignature=extraEventSignature({event:e})||'';var start=moment.isMoment(e.start)?e.start.unix():(e.start?moment(e.start).unix():'');var end=moment.isMoment(e.end)?e.end.unix():(e.end?moment(e.end).unix():'');return[e._id,e.id||'',e.title||'',e.url||'',start,end,e.allDay||'',e.className||'',extraSignature].join('');};var sourceSerialId=1;var sourceEventsSerialId=1;this.sourceFingerprint=function(source){var fp=''+(source.__id||(source.__id=sourceSerialId++));var events=angular.isObject(source)&&source.events;if(events){fp=fp+'-'+(events.__id||(events.__id=sourceEventsSerialId++));} return fp;};this.allEvents=function(){return Array.prototype.concat.apply([],(sources||[]).reduce(function(previous,source){if(angular.isArray(source)){previous.push(source);}else if(angular.isObject(source)&&angular.isArray(source.events)){var extEvent=Object.keys(source).filter(function(key){return(key!=='_id'&&key!=='events');});source.events.forEach(function(event){angular.extend(event,extEvent);});previous.push(source.events);} return previous;},[]));};this.changeWatcher=function(arraySource,tokenFn){var self;var getTokens=function(){return((angular.isFunction(arraySource)?arraySource():arraySource)||[]).reduce(function(rslt,el){var token=tokenFn(el);map[token]=el;rslt.push(token);return rslt;},[]);};var subtractAsSets=function(a,b){var obj=(b||[]).reduce(function(rslt,val){rslt[val]=true;return rslt;},Object.create(null));return(a||[]).filter(function(val){return!obj[val];});};var map={};var applyChanges=function(newTokens,oldTokens){var i;var token;var replacedTokens={};var removedTokens=subtractAsSets(oldTokens,newTokens);for(i=0;i");}};}]);dndLists.directive('dndNodrag',function(){return function(scope,element,attr){element.attr("draggable","true");element.on('dragstart',function(event){event=event.originalEvent||event;if(!event._dndHandle){if(!(event.dataTransfer.types&&event.dataTransfer.types.length)){event.preventDefault();} event.stopPropagation();}});element.on('dragend',function(event){event=event.originalEvent||event;if(!event._dndHandle){event.stopPropagation();}});};});dndLists.directive('dndHandle',function(){return function(scope,element,attr){element.attr("draggable","true");element.on('dragstart dragend',function(event){event=event.originalEvent||event;event._dndHandle=true;});};});function filterEffects(effects,effectAllowed){if(effectAllowed=='all')return effects;return effects.filter(function(effect){return effectAllowed.toLowerCase().indexOf(effect)!=-1;});} var dndState={};})(angular.module('dndLists',[]));'use strict';var module=angular.module('angularModalService',[]);module.factory('ModalService',['$animate','$document','$compile','$controller','$http','$rootScope','$q','$templateRequest','$timeout',function($animate,$document,$compile,$controller,$http,$rootScope,$q,$templateRequest,$timeout){function ModalService(){var self=this;self.openModals=[];var getTemplate=function(template,templateUrl){var deferred=$q.defer();if(template){deferred.resolve(template);}else if(templateUrl){$templateRequest(templateUrl,true).then(function(template){deferred.resolve(template);},function(error){deferred.reject(error);});}else{deferred.reject("No template or templateUrl has been specified.");} return deferred.promise;};var appendChild=function(parent,child){var children=parent.children();if(children.length>0){return $animate.enter(child,parent,children[children.length-1]);} return $animate.enter(child,parent);};self.closeModals=function(result,delay){while(self.openModals.length){self.openModals[0].close(result,delay);self.openModals.splice(0,1);}};self.showModal=function(options){var body=angular.element($document[0].body);var deferred=$q.defer();var controllerName=options.controller;if(!controllerName){deferred.reject("No controller has been specified.");return deferred.promise;} getTemplate(options.template,options.templateUrl).then(function(template){var modal={};var modalScope=(options.scope||$rootScope).$new(),rootScopeOnClose=null,locationChangeSuccess=options.locationChangeSuccess;if(locationChangeSuccess===false){rootScopeOnClose=angular.noop;} else if(angular.isNumber(locationChangeSuccess)&&locationChangeSuccess>=0){$timeout(function(){rootScopeOnClose=$rootScope.$on('$locationChangeSuccess',cleanUpClose);},locationChangeSuccess);} else{rootScopeOnClose=$rootScope.$on('$locationChangeSuccess',cleanUpClose);} var closeDeferred=$q.defer();var closedDeferred=$q.defer();var inputs={$scope:modalScope,close:function(result,delay){if(typeof options.preClose==='function')options.preClose(modal,result,delay);if(delay===undefined||delay===null)delay=0;$timeout(function(){cleanUpClose(result);},delay);}};if(options.inputs)angular.extend(inputs,options.inputs);var linkFn=$compile(template);var modalElement=linkFn(modalScope);inputs.$element=modalElement;var controllerObjBefore=modalScope[options.controllerAs];var modalController=$controller(options.controller,inputs,false,options.controllerAs);if(options.controllerAs&&controllerObjBefore){angular.extend(modalController,controllerObjBefore);} if(options.appendElement){appendChild(options.appendElement,modalElement);}else{appendChild(body,modalElement);} if(options.bodyClass){body[0].classList.add(options.bodyClass);} modal.controller=modalController;modal.scope=modalScope;modal.element=modalElement;modal.close=closeDeferred.promise;modal.closed=closedDeferred.promise;deferred.resolve(modal);document.activeElement.blur();self.openModals.push({modal:modal,close:inputs.close});function cleanUpClose(result){closeDeferred.resolve(result);if(options.bodyClass){body[0].classList.remove(options.bodyClass);} $animate.leave(modalElement).then(function(){closedDeferred.resolve(result);modalScope.$destroy();for(var i=0;i\
\
\ \

\
\
\ ';if(!validacontenido(attr.popoverWitdh)){template='
\
\
\ \

\
\
\
';} if(angular.isDefined(scope.myPopover)&&angular.isObject(scope.myPopover)){options=$popover(scope.myPopover).options;element.popoverClosable(options);} else{if(validacontenido(attr.popoverContentElement)){options={title:attr.popoverTitle||"",content:attr.popoverContent||"",template:template,trigger:attr.popoverTrigger||"click",placement:attr.popoverPlacement||"right",html:attr.popoverHtml||false,container:'body'};element.popoverClosable($popover(options).options);}else{options={title:attr.popoverTitle||"",content:function(){return $('#'+attr.popoverContentElement).html();},template:template,trigger:attr.popoverTrigger||"click",placement:attr.popoverPlacement||"right",html:attr.popoverHtml||false,container:'body'};element.popoverClosable($popover(options).options);}} $compile(element.contents())(scope);}};}]);(function(){var moduleName='angularUtils.directives.dirPagination';var DEFAULT_ID='__default';var module;try{module=angular.module(moduleName);}catch(err){module=angular.module(moduleName,[]);} module.directive('dirPaginate',['$compile','$parse','paginationService',dirPaginateDirective]).directive('dirPaginateNoCompile',noCompileDirective).directive('dirPaginationControls',['paginationService','paginationTemplate',dirPaginationControlsDirective]).filter('itemsPerPage',['paginationService',itemsPerPageFilter]).service('paginationService',paginationService).provider('paginationTemplate',paginationTemplateProvider);function dirPaginateDirective($compile,$parse,paginationService){return{terminal:true,multiElement:true,compile:dirPaginationCompileFn};function dirPaginationCompileFn(tElement,tAttrs){var expression=tAttrs.dirPaginate;var match=expression.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);var filterPattern=/\|\s*itemsPerPage\s*:[^|]*/;if(match[2].match(filterPattern)===null){throw'pagination directive: the \'itemsPerPage\' filter must be set.';} var itemsPerPageFilterRemoved=match[2].replace(filterPattern,'');var collectionGetter=$parse(itemsPerPageFilterRemoved);addNoCompileAttributes(tElement);var rawId=tAttrs.paginationId||DEFAULT_ID;paginationService.registerInstance(rawId);return function dirPaginationLinkFn(scope,element,attrs){var paginationId=$parse(attrs.paginationId)(scope)||attrs.paginationId||DEFAULT_ID;paginationService.registerInstance(paginationId);var repeatExpression=getRepeatExpression(expression,paginationId);addNgRepeatToElement(element,attrs,repeatExpression);removeTemporaryAttributes(element);var compiled=$compile(element);var currentPageGetter=makeCurrentPageGetterFn(scope,attrs,paginationId);paginationService.setCurrentPageParser(paginationId,currentPageGetter,scope);if(typeof attrs.totalItems!=='undefined'){paginationService.setAsyncModeTrue(paginationId);scope.$watch(function(){return $parse(attrs.totalItems)(scope);},function(result){if(0<=result){paginationService.setCollectionLength(paginationId,result);}});}else{scope.$watchCollection(function(){return collectionGetter(scope);},function(collection){if(collection){paginationService.setCollectionLength(paginationId,collection.length);}});} compiled(scope);};} function getRepeatExpression(expression,paginationId){var repeatExpression,idDefinedInFilter=!!expression.match(/(\|\s*itemsPerPage\s*:[^|]*:[^|]*)/);if(paginationId!==DEFAULT_ID&&!idDefinedInFilter){repeatExpression=expression.replace(/(\|\s*itemsPerPage\s*:[^|]*)/,"$1 : '"+paginationId+"'");}else{repeatExpression=expression;} return repeatExpression;} function addNgRepeatToElement(element,attrs,repeatExpression){if(element[0].hasAttribute('dir-paginate-start')||element[0].hasAttribute('data-dir-paginate-start')){attrs.$set('ngRepeatStart',repeatExpression);element.eq(element.length-1).attr('ng-repeat-end',true);}else{attrs.$set('ngRepeat',repeatExpression);}} function addNoCompileAttributes(tElement){angular.forEach(tElement,function(el){if(el.nodeType===Node.ELEMENT_NODE){angular.element(el).attr('dir-paginate-no-compile',true);}});} function removeTemporaryAttributes(element){angular.forEach(element,function(el){if(el.nodeType===Node.ELEMENT_NODE){angular.element(el).removeAttr('dir-paginate-no-compile');}});element.eq(0).removeAttr('dir-paginate-start').removeAttr('dir-paginate').removeAttr('data-dir-paginate-start').removeAttr('data-dir-paginate');element.eq(element.length-1).removeAttr('dir-paginate-end').removeAttr('data-dir-paginate-end');} function makeCurrentPageGetterFn(scope,attrs,paginationId){var currentPageGetter;if(attrs.currentPage){currentPageGetter=$parse(attrs.currentPage);}else{var defaultCurrentPage=paginationId+'__currentPage';scope[defaultCurrentPage]=1;currentPageGetter=$parse(defaultCurrentPage);} return currentPageGetter;}} function noCompileDirective(){return{priority:5000,terminal:true};} function dirPaginationControlsDirective(paginationService,paginationTemplate){var numberRegex=/^\d+$/;return{restrict:'AE',templateUrl:function(elem,attrs){return attrs.templateUrl||paginationTemplate.getPath();},scope:{maxSize:'=?',onPageChange:'&?',paginationId:'=?'},link:dirPaginationControlsLinkFn};function dirPaginationControlsLinkFn(scope,element,attrs){var rawId=attrs.paginationId||DEFAULT_ID;var paginationId=scope.paginationId||attrs.paginationId||DEFAULT_ID;if(!paginationService.isRegistered(paginationId)&&!paginationService.isRegistered(rawId)){var idMessage=(paginationId!==DEFAULT_ID)?' (id: '+paginationId+') ':' ';throw'pagination directive: the pagination controls'+idMessage+'cannot be used without the corresponding pagination directive.';} if(!scope.maxSize){scope.maxSize=9;} scope.directionLinks=angular.isDefined(attrs.directionLinks)?scope.$parent.$eval(attrs.directionLinks):true;scope.boundaryLinks=angular.isDefined(attrs.boundaryLinks)?scope.$parent.$eval(attrs.boundaryLinks):false;var paginationRange=Math.max(scope.maxSize,5);scope.pages=[];scope.pagination={last:1,current:1};scope.range={lower:1,upper:1,total:1};scope.$watch(function(){return(paginationService.getCollectionLength(paginationId)+1)*paginationService.getItemsPerPage(paginationId);},function(length){if(0'].join('\n')};}]);angular.module('ivh.treeview').directive('ivhTreeviewCheckbox',[function(){'use strict';return{restrict:'AE',require:'^ivhTreeview',template:''};}]);angular.module('ivh.treeview').directive('ivhTreeviewChildren',function(){'use strict';return{restrict:'AE',require:'^ivhTreeviewNode',template:['
    ','
  • ','
  • ','
'].join('\n')};});angular.module('ivh.treeview').directive('ivhTreeviewNode',['ivhTreeviewCompiler',function(ivhTreeviewCompiler){'use strict';return{restrict:'A',scope:{node:'=ivhTreeviewNode',depth:'=ivhTreeviewDepth'},require:'^ivhTreeview',compile:function(tElement){return ivhTreeviewCompiler.compile(tElement,function(scope,element,attrs,trvw){var node=scope.node;var getChildren=scope.getChildren=function(){return trvw.children(node);};scope.trvw=trvw;scope.childDepth=scope.depth+1;if(!trvw.isExpanded(node)){trvw.expand(node,trvw.isInitiallyExpanded(scope.depth));} scope.$watch(function(){return getChildren().length>0;},function(newVal){if(newVal){element.removeClass('ivh-treeview-node-leaf');}else{element.addClass('ivh-treeview-node-leaf');}});});}};}]);angular.module('ivh.treeview').directive('ivhTreeviewToggle',[function(){'use strict';return{restrict:'A',require:'^ivhTreeview',link:function(scope,element,attrs,trvw){var node=scope.node;element.addClass('ivh-treeview-toggle');element.bind('click',function(){if(!trvw.isLeaf(node)){scope.$apply(function(){trvw.toggleExpanded(node);trvw.onToggle(node);});}});}};}]);angular.module('ivh.treeview').directive('ivhTreeviewTwistie',['$compile','ivhTreeviewOptions',function($compile,ivhTreeviewOptions){'use strict';var globalOpts=ivhTreeviewOptions();return{restrict:'A',require:'^ivhTreeview',template:['','',globalOpts.twistieCollapsedTpl,'','',globalOpts.twistieExpandedTpl,'','',globalOpts.twistieLeafTpl,'',''].join('\n'),link:function(scope,element,attrs,trvw){if(!trvw.hasLocalTwistieTpls){return;} var opts=trvw.opts(),$twistieContainers=element.children().eq(0).children();angular.forEach(['twistieCollapsedTpl','twistieExpandedTpl','twistieLeafTpl'],function(tplKey,ix){var tpl=opts[tplKey],tplGlobal=globalOpts[tplKey];if(!tpl||tpl===tplGlobal){return;} if(tpl.substr(0,1)!=='<'||tpl.substr(-1,1)!=='>'){tpl=''+tpl+'';} var $el=$compile(tpl)(scope),$container=$twistieContainers.eq(ix);$container.html('').append($el);});}};}]);angular.module('ivh.treeview').directive('ivhTreeview',['ivhTreeviewMgr',function(ivhTreeviewMgr){'use strict';return{restrict:'A',transclude:true,scope:{root:'=ivhTreeview',childrenAttribute:'=ivhTreeviewChildrenAttribute',defaultSelectedState:'=ivhTreeviewDefaultSelectedState',disableCheckboxSelectionPropagation:'=ivhTreeviewDisableCheckboxSelectionPropagation',expandToDepth:'=ivhTreeviewExpandToDepth',idAttribute:'=ivhTreeviewIdAttribute',indeterminateAttribute:'=ivhTreeviewIndeterminateAttribute',expandedAttribute:'=ivhTreeviewExpandedAttribute',labelAttribute:'=ivhTreeviewLabelAttribute',nodeTpl:'=ivhTreeviewNodeTpl',selectedAttribute:'=ivhTreeviewSelectedAttribute',onCbChange:'&ivhTreeviewOnCbChange',onToggle:'&ivhTreeviewOnToggle',twistieCollapsedTpl:'=ivhTreeviewTwistieCollapsedTpl',twistieExpandedTpl:'=ivhTreeviewTwistieExpandedTpl',twistieLeafTpl:'=ivhTreeviewTwistieLeafTpl',useCheckboxes:'=ivhTreeviewUseCheckboxes',validate:'=ivhTreeviewValidate',visibleAttribute:'=ivhTreeviewVisibleAttribute',userOptions:'=ivhTreeviewOptions',filter:'=ivhTreeviewFilter'},controllerAs:'trvw',controller:['$scope','$element','$attrs','$transclude','ivhTreeviewOptions','filterFilter',function($scope,$element,$attrs,$transclude,ivhTreeviewOptions,filterFilter){var ng=angular,trvw=this;var localOpts=ng.extend({},ivhTreeviewOptions(),$scope.userOptions);ng.forEach(['childrenAttribute','defaultSelectedState','disableCheckboxSelectionPropagation','expandToDepth','idAttribute','indeterminateAttribute','expandedAttribute','labelAttribute','nodeTpl','selectedAttribute','twistieCollapsedTpl','twistieExpandedTpl','twistieLeafTpl','useCheckboxes','validate','visibleAttribute'],function(attr){if(ng.isDefined($scope[attr])){localOpts[attr]=$scope[attr];}});var normedAttr=function(attrKey){return'ivhTreeview'+ attrKey.charAt(0).toUpperCase()+ attrKey.slice(1);};ng.forEach(['onCbChange','onToggle'],function(attr){if($attrs[normedAttr(attr)]){localOpts[attr]=$scope[attr];}});var transcludedScope;$transclude(function(clone,scope){var transcludedNodeTpl='';angular.forEach(clone,function(c){transcludedNodeTpl+=(c.innerHTML||'').trim();});if(transcludedNodeTpl.length){transcludedScope=scope;localOpts.nodeTpl=transcludedNodeTpl;}});trvw.opts=function(){return localOpts;};var userOpts=$scope.userOptions||{};trvw.hasLocalTwistieTpls=!!(userOpts.twistieCollapsedTpl||userOpts.twistieExpandedTpl||userOpts.twistieLeafTpl||$scope.twistieCollapsedTpl||$scope.twistieExpandedTpl||$scope.twistieLeafTpl);trvw.children=function(node){var children=node[localOpts.childrenAttribute];return ng.isArray(children)?children:[];};trvw.label=function(node){return node[localOpts.labelAttribute];};trvw.hasFilter=function(){return ng.isDefined($scope.filter);};trvw.getFilter=function(){return $scope.filter||'';};trvw.isVisible=function(node){var filter=trvw.getFilter();if(!filter||filterFilter([node],filter).length){return true;} if(typeof filter==='object'||typeof filter==='function'){var children=trvw.children(node);for(var ix=children.length;ix--;){if(trvw.isVisible(children[ix])){return true;}}} return false;};trvw.useCheckboxes=function(){return localOpts.useCheckboxes;};trvw.select=function(node,isSelected){ivhTreeviewMgr.select($scope.root,node,localOpts,isSelected);trvw.onCbChange(node,isSelected);};trvw.isSelected=function(node){return node[localOpts.selectedAttribute];};trvw.toggleSelected=function(node){var isSelected=!node[localOpts.selectedAttribute];trvw.select(node,isSelected);};trvw.expand=function(node,isExpanded){ivhTreeviewMgr.expand($scope.root,node,localOpts,isExpanded);};trvw.isExpanded=function(node){return node[localOpts.expandedAttribute];};trvw.toggleExpanded=function(node){trvw.expand(node,!trvw.isExpanded(node));};trvw.isInitiallyExpanded=function(depth){var expandTo=localOpts.expandToDepth===-1?Infinity:localOpts.expandToDepth;return depth','
  • ','
  • ',''].join('\n')};}]);angular.module('ivh.treeview').filter('ivhTreeviewAsArray',function(){'use strict';return function(arr){if(!angular.isArray(arr)&&angular.isObject(arr)){return[arr];} return arr;};});angular.module('ivh.treeview').factory('ivhTreeviewBfs',['ivhTreeviewOptions',function(ivhTreeviewOptions){'use strict';var ng=angular;return function(tree,opts,cb){if(arguments.length===2&&ng.isFunction(opts)){cb=opts;opts={};} opts=angular.extend({},ivhTreeviewOptions(),opts);cb=cb||ng.noop;var queue=[],childAttr=opts.childrenAttribute,next,node,parents,ix,numChildren;if(ng.isArray(tree)){ng.forEach(tree,function(n){queue.push([n,[]]);});next=queue.shift();}else{next=[tree,[]];} while(next){node=next[0];parents=next[1];if(cb(node,parents)!==false){if(node[childAttr]&&ng.isArray(node[childAttr])){numChildren=node[childAttr].length;for(ix=0;ix2){if(typeof opts==='boolean'){isSelected=opts;opts={};}} opts=ng.extend({},options,opts);isSelected=ng.isDefined(isSelected)?isSelected:true;var useId=isId(node),proceed=true,idAttr=opts.idAttribute;ivhTreeviewBfs(tree,opts,function(n,p){var isNode=proceed&&(useId?node===n[idAttr]:node===n);if(isNode){proceed=false;var cb=isSelected?makeSelected.bind(opts):makeDeselected.bind(opts);if(opts.disableCheckboxSelectionPropagation){cb(n);}else{ivhTreeviewBfs(n,opts,cb);ng.forEach(p,validateParent.bind(opts));}} return proceed;});return exports;};exports.selectAll=function(tree,opts,isSelected){if(arguments.length>1){if(typeof opts==='boolean'){isSelected=opts;opts={};}} opts=ng.extend({},options,opts);isSelected=ng.isDefined(isSelected)?isSelected:true;var selectedAttr=opts.selectedAttribute,indeterminateAttr=opts.indeterminateAttribute;ivhTreeviewBfs(tree,opts,function(node){node[selectedAttr]=isSelected;node[indeterminateAttr]=false;});return exports;};exports.selectEach=function(tree,nodes,opts,isSelected){ng.forEach(nodes,function(node){exports.select(tree,node,opts,isSelected);});return exports;};exports.deselect=function(tree,node,opts){return exports.select(tree,node,opts,false);};exports.deselectAll=function(tree,opts){return exports.selectAll(tree,opts,false);};exports.deselectEach=function(tree,nodes,opts){return exports.selectEach(tree,nodes,opts,false);};exports.validate=function(tree,opts,bias){if(!tree){return exports;} if(arguments.length>1){if(typeof opts==='boolean'){bias=opts;opts={};}} opts=ng.extend({},options,opts);bias=ng.isDefined(bias)?bias:opts.defaultSelectedState;var selectedAttr=opts.selectedAttribute,indeterminateAttr=opts.indeterminateAttribute;ivhTreeviewBfs(tree,opts,function(node,parents){if(ng.isDefined(node[selectedAttr])&&node[selectedAttr]!==bias){exports.select(tree,node,opts,!bias);return false;}else{node[selectedAttr]=bias;node[indeterminateAttr]=false;}});return exports;};exports.expand=function(tree,node,opts,isExpanded){if(arguments.length>2){if(typeof opts==='boolean'){isExpanded=opts;opts={};}} opts=ng.extend({},options,opts);isExpanded=ng.isDefined(isExpanded)?isExpanded:true;var useId=isId(node),expandedAttr=opts.expandedAttribute;if(!useId){node[expandedAttr]=isExpanded;return exports;} return findNode(tree,node,opts,function(n,p){n[expandedAttr]=isExpanded;return exports;});};exports.expandRecursive=function(tree,node,opts,isExpanded){if(arguments.length>2){if(typeof opts==='boolean'){isExpanded=opts;opts={};}} node=ng.isDefined(node)?node:tree;opts=ng.extend({},options,opts);isExpanded=ng.isDefined(isExpanded)?isExpanded:true;var useId=isId(node),expandedAttr=opts.expandedAttribute,branch;if(useId){findNode(tree,node,opts,function(n,p){branch=n;});}else{branch=node;} if(branch){ivhTreeviewBfs(branch,opts,function(n,p){n[expandedAttr]=isExpanded;});} return exports;};exports.collapse=function(tree,node,opts){return exports.expand(tree,node,opts,false);};exports.collapseRecursive=function(tree,node,opts,isExpanded){return exports.expandRecursive(tree,node,opts,false);};exports.expandTo=function(tree,node,opts,isExpanded){if(arguments.length>2){if(typeof opts==='boolean'){isExpanded=opts;opts={};}} opts=ng.extend({},options,opts);isExpanded=ng.isDefined(isExpanded)?isExpanded:true;var expandedAttr=opts.expandedAttribute;var expandCollapseNode=function(n){n[expandedAttr]=isExpanded;};return findNode(tree,node,opts,function(n,p){ng.forEach(p,expandCollapseNode);return exports;});};exports.collapseParents=function(tree,node,opts){return exports.expandTo(tree,node,opts,false);};return exports;}]);angular.module('ivh.treeview').provider('ivhTreeviewOptions',['ivhTreeviewInterpolateStartSymbol','ivhTreeviewInterpolateEndSymbol',function(ivhTreeviewInterpolateStartSymbol,ivhTreeviewInterpolateEndSymbol){'use strict';var symbolStart=ivhTreeviewInterpolateStartSymbol,symbolEnd=ivhTreeviewInterpolateEndSymbol;var options={idAttribute:'id',labelAttribute:'label',childrenAttribute:'children',selectedAttribute:'selected',expandToDepth:0,useCheckboxes:true,disableCheckboxSelectionPropagation:false,validate:true,indeterminateAttribute:'__ivhTreeviewIndeterminate',expandedAttribute:'__ivhTreeviewExpanded',defaultSelectedState:true,twistieExpandedTpl:'(-)',twistieCollapsedTpl:'(+)',twistieLeafTpl:'o',nodeTpl:['
    ','','','','','','','{{trvw.label(node)}}','','
    ','
    '].join('\n').replace(new RegExp('{{','g'),symbolStart).replace(new RegExp('}}','g'),symbolEnd)};this.set=function(opts){angular.extend(options,opts);};this.$get=function(){return function(){return angular.copy(options);};};}]); var basePath='app_partials/';var baseURL='../'+(validacontenido(NOMBREWEB)?'':NOMBREWEB+'/');(function(){'use strict';angular.module('appPrincipal',['ngRoute','ngSanitize','valida.rut','angularUtils.directives.dirPagination','angularModalService','angularjs-dropdown-multiselect','ivh.treeview','dndLists','my.popover','ui.calendar','angularFileUpload']).run(run).filter('trustedhtml',filter).controller('accesoError',accesoError);run.$inject=['$rootScope','$sce','seguridad','$location','Manager','$locale','userService','seguridadEncript'];function run($rootScope,$sce,seguridad,$location,Manager,$locale,userService,seguridadEncript){$rootScope.URL_PPAL=URL_PPAL;$rootScope.se=seguridadEncript;$rootScope.setImagePDF=function(){return(URL_PPAL+'repositorio/Images/pdf.png');};$rootScope.setURLVerPDF=function(m,v){return(URL_PPAL+'pdf/getPDF.php?modo='+m+'&vc='+seguridadEncript.encrypt(v));};var CHECKLOGIN=function(){var currentUser=userService.GetCurrentUser();if(currentUser===null||currentUser===undefined){$rootScope.$emit("VERIFICACIONESOF");$rootScope.USERCONECTADO=null;$location.path('/login');}};$rootScope.$on('$routeChangeStart',function(event,next,current){if($location.url()!=="/recuperar"&&$location.url()!=="/change"&&$location.url()!=="/home"){CHECKLOGIN();$rootScope.SITIO_URL=$location.url();try{$rootScope.NAV_INDEX=next['data']['nav_index'];}catch(e){} try{$rootScope.NAV_FILTER1=next['data']['nav_filter1'];}catch(e){} if(next&&next['data']&&next['data']!==undefined){if(typeof(next.data.code)==='object'){var acceder=false;angular.forEach(next.data.code,function(item){if(acceder===false){acceder=$rootScope.vON("M",item)||$rootScope.vON("S",item);}});if(acceder===false){$location.path('/erroracceso');}}else{$rootScope.PROCESS=next.data.code;if(!$rootScope.vON("M",next.data.code)&&!$rootScope.vON("S",next.data.code)){$location.path('/erroracceso');}}}}});$rootScope.vON=function(t,op){var currentUser=userService.GetCurrentUserData();if(currentUser!==undefined&¤tUser.data.OPACC!==undefined){var OPACC=currentUser.data.OPACC;if(t==='M'){return Object.keys(_.filter(OPACC,function(item){return item.agrupador===op;})).length>0;} else if(t==='S'){return Object.keys(_.filter(OPACC,function(item){return item.codigo_m===op;})).length>0;} else{return false;}}else{return false;}};$rootScope.SelectedMenu=function(iguala){if($rootScope.SITIO_URL!==undefined){if($rootScope.SITIO_URL.indexOf(iguala)!==-1){return"active open";} else{return"";}}};$rootScope.traslate={checkAll:'Seleccionar Todos',uncheckAll:'Deseleccionar Todos',searchPlaceholder:'Buscar',buttonDefaultText:'Seleccione',selectionCount:'Seleccionados',dynamicButtonTextSuffix:'Seleccionados'};$locale.NUMBER_FORMATS.GROUP_SEP=".";$locale.NUMBER_FORMATS.DECIMAL_SEP=",";$rootScope.seguridad=seguridad;$rootScope.htmlRenderValido=function(value){return $sce.trustAsHtml(value);};$rootScope.OPTION_MODO_DOMICILIO_1=[{v:'grua',t:'Grua'},{v:'conductor',t:'Conductor'}];$rootScope.OPTION_STATUS_1=[{v:'P',t:'Publicado'},{v:'N',t:'No Publicado'}];$rootScope.OPTION_VITRINA_1=[{v:'N',t:'NO'},{v:'S',t:'SI'}];$rootScope.OPTION_SINO_NUMBER=[{v:0,t:'NO'},{v:1,t:'SI'}];$rootScope.MESES=[{v:1,t:'Enero'},{v:2,t:'Febrero'},{v:3,t:'Marzo'},{v:4,t:'Abril'},{v:5,t:'Mayo'},{v:6,t:'Junio'},{v:7,t:'Julio'},{v:8,t:'Agosto'},{v:9,t:'Septiembre'},{v:10,t:'Octubre'},{v:11,t:'Noviembre'},{v:12,t:'Diciembre'}];$rootScope.NUMDECIMAL=/^\d{0,9}([\,]{1}\d{0,4})?$/;$rootScope.NUMDECIMAL2=/^\d{0,9}([\,.]{1}\d{0,4})?$/;$rootScope.NUMDECIMAL_AND_NEG=/^\-?\d{0,9}([\,]{1}\d{0,4})?$/;$rootScope.NUMBERS=/^\d{0,9}?$/;$rootScope.NUMBERS_AND_NEG=/^\-?\d{0,9}?$/;$rootScope.NUMBERS_GREATEN_ONE=/^([1-9][0-9]+|[1-9])$/;$rootScope.TIME=/^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/;$rootScope.DATE=/^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((19|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((19|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((19|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$/;$rootScope.EMAIL_VALIDA=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;} filter.$inject=['$sce'];function filter($sce){return $sce.trustAsHtml;} accesoError.$inject=['$scope'];function accesoError($scope){$scope.$emit("UNLOAD");LOG("ERROR UNLOAD");}})(); (function(){'use strict';angular.module('appPrincipalVISOR',['ngRoute','ngSanitize','valida.rut','angularUtils.directives.dirPagination','angularModalService','angularjs-dropdown-multiselect','ivh.treeview','dndLists','my.popover','ui.calendar','angularFileUpload']).run(['$rootScope',function run($rootScope){$rootScope.URL_PPAL=URL_PPAL;}]).filter('trustedhtml',['$sce',function filter($sce){return $sce.trustAsHtml;}]).controller('accesoError',['$scope',function accesoError($scope){$scope.$emit("UNLOAD");LOG("ERROR UNLOAD");}]).config(['$routeProvider',function($routeProvider){$routeProvider.otherwise({redirectTo:'/visor/preentregaf2'});$routeProvider.when('/erroracceso',{templateUrl:basePath+'error_locate.html',controller:'accesoError'}) $routeProvider.when('/visor/preentregaf2',{templateUrl:basePath+'visorpreentrega/homef2.html',controller:'HvisorpreentregaF2'});}]).controller('principalCtrlVISOR',['$scope','$rootScope',function($scope,$rootScope){$scope.closeModalLoading=function(){$scope.$emit("UNLOAD");};$rootScope.$on('LOAD',function(){$scope.loading=true;$('.loader').addClass('is-active');});$rootScope.$on('UNLOAD',function(){$scope.loading=false;$('.loader').removeClass('is-active');});$scope.$on('SETTITLE',function(evt,data){if(!validacontenido(data)){$scope.TituloPrincipal=data.TituloPrincipal;$scope.TituloSecundario=data.TituloSecundario;}else{$scope.TituloPrincipal="Dashboard";$scope.TituloSecundario="Panel - Administrar";}});$scope.$emit("SETTITLE");$rootScope.changedate=function(op,modo){if(modo===0){return $filter('date')(op,"dd/MM/yyyy");}else if(modo===10){return $filter('date')(op,"HH:mm");} else if(modo===21){return $filter('date')(op,"yyyy-MM-dd");} return $filter('date')(op,"dd/MM/yyyy HH:mm");};$rootScope.changedate2=function(op,modo){if(modo===0){return moment(op).format("DD-MM-YYYY");}else if(modo===10){return moment(op).format("HH:mm");}else if(modo===21){return moment(op).format("YYYY-MM-DD");} return moment(op).format("DD-MM-YYYY HH:mm");};}]);})();(function(){'use strict';angular.module('appPrincipal').controller('principalCtrl',['$scope','$rootScope','accountService','Manager','$filter','Excel','$timeout','ServiceURL','userService','ModalService','$sce',function($scope,$rootScope,accountService,Manager,$filter,Excel,$timeout,ServiceURL,userService,ModalService,$sce){$scope.showtest=function(_showtest){console.info(_showtest)} $rootScope.CD_VIEW_CNT=[];$rootScope.vtime=(new Date()).valueOf();$rootScope.filtroVB1={nnegocio:null,usuario:null,sucursal:null,vn:null,rut:null,nombre:null,cdo:null,vin:null,marca:null,version:null,all:0,reservaini:null,reservafin:null};$rootScope.show2={tn:false,nnegocio:true,nv:true,rut:false,cliente:false,cdo:true,vin:false,marca:false,version:false,tienecdo:false,scoremayorigual:false,scoremenorigual:false,ingresomayorigual:false,ingresomenorigual:false,f5:false,porasignar:true,vpp:false};$rootScope.filtroNegocio2={tn:null,nnegocio:null,usuario:null,sucursal:null,vn:null,rut:null,nombre:null,cdo:null,vin:null,marca:null,version:null,versionesSelect:[],all:0,tienecdo:null,scoremayorigual:null,scoremenorigual:null,ingresomayorigual:null,ingresomenorigual:null,f5:'VIGENTE',porasignar:null,mes_facturacion:null,ano_facturacion:null,vpp:null,etapascd:null,etapascdSelect:[],ordenscore:'DESC',ordenporcentaje:'DESC',ordenreserva:'DESC',ordenapor:'1',ordenmodo:'DESC',reservaini:null,reservafin:null,};$rootScope.show={tn:false,nnegocio:false,nv:true,rut:false,cliente:false,cdo:true,vin:false,marca:false,version:false,f5:true,tienecdo:false,porasignar:true,vpp:false};$rootScope.filtroNegocio={tn:null,nnegocio:null,usuario:null,sucursal:null,vn:null,rut:null,nombre:null,cdo:null,vin:null,marca:null,version:null,versionesSelect:[],all:0,tienecdo:null,scoremayorigual:null,scoremenorigual:null,ingresomayorigual:null,ingresomenorigual:null,f5:'VIGENTE',porasignar:null,vpp:null,etapascd:null,etapascdSelect:[],ordenscore:'DESC',ordenporcentaje:'DESC',ordenreserva:'DESC',ordenapor:'1',ordenmodo:'DESC',reservaini:null,reservafin:null,};$scope.LOGO_2=LOGO_2;$scope.NEGOCIO_NAME=NEGOCIO_NAME;$scope.SITE_NAME_VERSION=SITE_NAME_VERSION;$scope.ORIGEN_WEB_O=ORIGEN_WEB_O;$rootScope.size_v_p=size_v_p;$rootScope.size_v_a=size_v_a;$rootScope.size_i=size_i;$rootScope.video_ext=video_ext;$rootScope.image_ext=image_ext;$scope.splitComma=function(string){if(validacontenido(string)) return'';return string.split(',');};$scope.closeModalLoading=function(){$scope.$emit("UNLOAD");};$rootScope.$on('LOAD',function(){$scope.loading=true;$('.loader').addClass('is-active');});$rootScope.$on('UNLOAD',function(){$scope.loading=false;$('.loader').removeClass('is-active');});$scope.$on('SETTITLE',function(evt,data){if(!validacontenido(data)){$scope.TituloPrincipal=data.TituloPrincipal;$scope.TituloSecundario=data.TituloSecundario;}else{$scope.TituloPrincipal="Dashboard";$scope.TituloSecundario="Panel - Administrar";}});$scope.$emit("SETTITLE");$rootScope.UBICACION='Mesas';$rootScope.detallePedidosMesas={};var MODAL_PREV=null;var MODAL_NEXT=null;$scope.closeModal=function(modal){$(modal).modal('hide');LOG("principalCtrl HIDE");};$scope.openModal=function(modal){$(modal).modal('show');LOG("principalCtrl SHOW");};$scope.apirest=ServiceURL;$scope.exportToExcel=function(tableId){console.log(tableId);$scope.exportHref=Excel.tableToExcel(tableId,'DATA');$timeout(function(){location.href=$scope.exportHref;},100);};$scope.$on('LOAD2',function(){$('#div_carga_proceso').modal('show');});$scope.$on('UNLOAD2',function(){$('#div_carga_proceso').modal('hide');$('body').removeClass().removeAttr('style');$('.modal-backdrop').remove();});$scope.MODOUSER='ROOT';$scope.SelectedMenu=function(iguala){if($scope.SITIO_URL!==undefined){if($scope.SITIO_URL.indexOf(iguala)!==-1){return"active";} else{return"";}}};$scope.salirApp=function(){$rootScope.$emit("VERIFICACIONESOF");delete $rootScope.USERCONECTADO;$rootScope.estadoLog=0;accountService.logout();};$rootScope.changedate=function(op,modo){if(modo===0){return $filter('date')(op,"dd/MM/yyyy");}else if(modo===10){return $filter('date')(op,"HH:mm");} else if(modo===21){return $filter('date')(op,"yyyy-MM-dd");} return $filter('date')(op,"dd/MM/yyyy HH:mm");};$rootScope.changedate2=function(op,modo){if(modo===0){return moment(op).format("DD-MM-YYYY");}else if(modo===10){return moment(op).format("HH:mm");}else if(modo===21){return moment(op).format("YYYY-MM-DD");} return moment(op).format("DD-MM-YYYY HH:mm");};$scope.txt="Pagina de inicio";$scope.CONSOLE=function(val1,val2){if(val2!==undefined) console.warn(val1,val2);else console.warn(val1);};$rootScope.USERCONECTADO=userService.GetCurrentUserData();$scope.cambiarClave=function(){ModalService.showModal({templateUrl:'app_partials/cambiarPassword.html',controller:'ChangeController',preClose:(modal)=>{modal.element.modal('hide');}}).then(function(modal){modal.element.modal();modal.close.then(function(result){});});};$rootScope.checkRespuestaCss=function(valor){if(valor==="SI"){return" btn-success";}else if(valor==="NO"){return" btn-danger";}else if(valor==="No Aplica"){return" btn-grey";}else{return" btn-white";}};}]).directive("formatDate",function(){return{require:'ngModel',link:function(scope,elem,attr,modelCtrl){modelCtrl.$formatters.push(function(modelValue){if(modelValue!==null&&modelValue!==undefined) return new Date(modelValue);else return null;});}};}).directive('refreshable',[function(){return{restrict:'A',scope:{refresh:"=refreshable"},link:function(scope,element,attr){var refreshMe=function(){element.attr('src',element.attr('src'));};scope.$watch('refresh',function(newVal,oldVal){if(scope.refresh){scope.refresh=false;refreshMe();}});}};}]).filter('cut',function(){return function(value,wordwise,max,tail){if(!value)return'';max=parseInt(max,10);if(!max)return value;if(value.length<=max)return value;value=value.substr(0,max);if(wordwise){var lastspace=value.lastIndexOf(' ');if(lastspace!==-1){if(value.charAt(lastspace-1)==='.'||value.charAt(lastspace-1)===','){lastspace=lastspace-1;} value=value.substr(0,lastspace);}} return value+(tail||' …');};}).filter('passwordCount',[function(){return function(value,peak){value=angular.isString(value)?value:'';peak=isFinite(peak)?peak:5;return value&&(value.length>peak?peak+'+':value.length);};}]).factory('zxcvbn',[function(){return{score:function(){var compute=zxcvbn.apply(null,arguments);return compute&&compute.score;}};}]).directive('okPassword',['zxcvbn',function(zxcvbn){return{restrict:'AC',require:'ngModel',link:function($scope,$element,$attrs,ngModelCtrl){$element.on('blur change keydown',function(evt){$scope.$evalAsync(function($scope){var pwd=$scope.password=$element.val();$scope.passwordStrength=pwd?(pwd.length>5&&zxcvbn.score(pwd)||0):null;ngModelCtrl.$setValidity('okPassword',$scope.passwordStrength>=2);});});}};}]);})();(function(){'use strict';angular.module('appPrincipal').controller('loginController',['$scope','$rootScope','accountService','userService','$location','Manager',function($scope,$rootScope,accountService,userService,$location,Manager){$scope.account={rut:'',password:''};$rootScope.$emit("VERIFICACIONESOF");$scope.message="";$scope.login=function(){accountService.login($scope.account).then(function(data){$scope.data=data;Manager.getall('validate_token.php').then(function(d){$rootScope.USERCONECTADO=d;userService.SetCurrentUserData(d);if(d.data.recuperar*1===1){$location.path('/change');}else{$location.path('/home');}},function(errResponse){});},function(error){$scope.message=error;});};}]).controller('RecuperarController',['$scope','$rootScope','accountService','$location','Manager',function($scope,$rootScope,accountService,$location,Manager){$scope.sendRecuperar=function(){$scope.$emit("LOAD");var modelo={dataForm:null,id:$scope.account.useraccess,id2:$scope.account.mail};Manager.post('recuperar.php',modelo).then(function(d){alert(d.message);$location.path('index.php');$scope.$emit("UNLOAD");},function(errResponse){alert(errResponse.message);$scope.$emit("UNLOAD");});};}]).controller('ChangeController',['$scope','$rootScope','accountService','close','Manager',function($scope,$rootScope,accountService,close,Manager){$scope.close=function(){close(true,200);};$scope.accountChange={password:null,password2:null};$scope.sendCambiarClave=function(){if(validacontenido($scope.accountChange.password)){bootbox.alert("Debe ingresar su nueva contraseña");return;} bootbox.confirm({message:"Actualizará su contraseña, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$rootScope.$emit("LOAD");var accountChange=angular.copy($scope.accountChange);accountChange.password=$.md5(accountChange.password);Manager.postR('usuarios','updaterecuperarchange',{},accountChange.password).then(function(d){alert("Se ha realizado el cambio solicitado. debera ingresar nuevamente.");delete $rootScope.USERCONECTADO;$rootScope.estadoLog=0;accountService.logout();$rootScope.$emit("UNLOAD");close(true,200);},function(errResponse){bootbok.alert("No fue posible realizar el cambio.");$rootScope.$emit("UNLOAD");});}}});};}]);})(); (function(){'use strict';angular.module('appPrincipal').config(['ivhTreeviewOptionsProvider','$httpProvider','$popoverProvider','$compileProvider',function(ivhTreeviewOptionsProvider,$httpProvider,$popoverProvider,$compileProvider){$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|chrome-extension):/);ivhTreeviewOptionsProvider.set({defaultSelectedState:false,validate:true});angular.extend($popoverProvider.defaults,{html:true,animation:true});var interceptor=function(userService,$q,$location){return{request:function(config){config.url=getTimeVersionedUrl(config.url);config.headers['melhuish']=ORIGEN_WEB_O;var currentUser=userService.GetCurrentUser();if(currentUser!==null&¤tUser!==undefined){config.headers['jwt']=currentUser.jwt;} return config;},responseError:function(rejection){if(rejection.status===401){userService.CurrentUser=null;userService.CurrentUserData=null;userService.SetCurrentUser(userService.CurrentUser);userService.SetCurrentUserData(userService.CurrentUserData);self.location.href="index.php";} if(rejection.status===403){$location.path('/accesoError');return $q.reject(rejection);} return $q.reject(rejection);}};};var params=['userService','$q','$location'];interceptor.$inject=params;$httpProvider.interceptors.push(interceptor);}]);})(); (function(){'use strict';angular.module('appPrincipal').config(['$routeProvider',function($routeProvider){$routeProvider.otherwise({redirectTo:'/home'});$routeProvider.when('/erroracceso',{templateUrl:basePath+'error_locate.html',controller:'accesoError'});$routeProvider.when('/home',{templateUrl:basePath+'home.html',controller:'DashboardIni'});$routeProvider.when('/login',{templateUrl:basePath+'login.html',controller:'loginController'});$routeProvider.when('/recuperar',{templateUrl:basePath+'recuperar.html',controller:'RecuperarController'});$routeProvider.when('/change',{templateUrl:basePath+'cambiarPassword.html',controller:'ChangeController'});$routeProvider.when('/gestion/proyectos',{templateUrl:basePath+'proyectos/home.html',controller:'g001_lista',data:{code:'G001'}});$routeProvider.when('/gestion/proyectos/add',{templateUrl:basePath+'proyectos/add.html',controller:'g001_add',data:{code:'G001'}});$routeProvider.when('/gestion/proyectos/edit/:id',{templateUrl:basePath+'proyectos/edit.html',controller:'g001_edit',data:{code:'G001'}});$routeProvider.when('/gestion/proyectos/view/:id',{templateUrl:basePath+'proyectos/view.html',controller:'g001_view',data:{code:'G001'}});$routeProvider.when('/gestion/clientes',{templateUrl:basePath+'clientes/home.html',controller:'g002_lista',data:{code:'G002'}});$routeProvider.when('/gestion/clientes/add',{templateUrl:basePath+'clientes/add.html',controller:'g002_add',data:{code:'G002'}});$routeProvider.when('/gestion/clientes/edit/:id',{templateUrl:basePath+'clientes/add.html',controller:'g002_edit',data:{code:'G002'}});$routeProvider.when('/gestion/clientes/view/:id',{templateUrl:basePath+'clientes/viw.html',controller:'g002_view',data:{code:'G002'}});$routeProvider.when('/plataforma/usuarios',{templateUrl:basePath+'operador/home.html',controller:'Hoperador',data:{code:'P001'}});$routeProvider.when('/plataforma/permisos',{templateUrl:basePath+'operador/permisos.html',controller:'Hpermision',data:{code:'P002'}});$routeProvider.when('/plataforma/parametros',{templateUrl:basePath+'paramvalor/home.html',controller:'Hparametrovalor',data:{code:'P003'}});$routeProvider.when('/plataforma/comunas',{templateUrl:basePath+'mantenedores/comunas/home.html',controller:'Hcomunas',data:{code:'P005'}});$routeProvider.when('/plataforma/valores/tipo',{templateUrl:basePath+'mantenedores/valorestipo/home.html',controller:'Hvalorestipo',data:{code:'P004'}});$routeProvider.when('/plataforma/valores/tipo/:codigotipo',{templateUrl:basePath+'mantenedores/valorestipodetalle/home.html',controller:'Hvalorestipodetalle',data:{code:'P004'}});$routeProvider.when('/gestion/verpagos',{templateUrl:basePath+'informes/verpagos.html',controller:'Hverpagos',data:{code:'G003'}});$routeProvider.when('/gestion/mispagos',{templateUrl:basePath+'informes/mispagos.html',controller:'Hmispagos',data:{code:'G004'}});$routeProvider.when('/gestion/mispagosver',{templateUrl:basePath+'informes/mispagossimple.html',controller:'Hmispagossimple',data:{code:'G005'}});}]);})();(function(){'use strict';angular.module('appPrincipal').factory('userService',userService);function userService(){var fac={};fac.CurrentUser=null;fac.CurrentUserData=null;fac.SetCurrentUser=function(user){fac.CurrentUser=user;sessionStorage.user=angular.toJson(user);};fac.SetCurrentUserData=function(user){fac.CurrentUserData=user;sessionStorage.userData=angular.toJson(user);};fac.GetCurrentUser=function(){fac.CurrentUser=angular.fromJson(sessionStorage.user);return fac.CurrentUser;};fac.GetCurrentUserData=function(){fac.CurrentUserData=angular.fromJson(sessionStorage.userData);return fac.CurrentUserData;};return fac;};})(); (function(){'use strict';angular.module('appPrincipal').factory('accountService',accountService);accountService.$inject=['$http','$q','ServiceURL','userService','$location'];function accountService($http,$q,ServiceURL,userService,$location){var fac={};fac.login=function(user){var obj={dataForm:{'useraccess':user.useraccess,'password':$.md5(user.password)}};var defer=$q.defer();$http.post(ServiceURL+"access-control.php",obj).then(function(response){var data_conectado=response.data;userService.SetCurrentUser(data_conectado);defer.resolve(response.data);},function(error){bootbox.alert("Revise los datos, no pudo ingresar");fac.logout();defer.reject(error.data);});return defer.promise;};fac.logout=function(){$http.post(ServiceURL+"logout.php",{}).then(function(response){userService.CurrentUser=null;userService.CurrentUserData=null;userService.SetCurrentUser(userService.CurrentUser);userService.SetCurrentUserData(userService.CurrentUserData);self.location.href='index.php';},function(error){userService.CurrentUser=null;userService.CurrentUserData=null;userService.SetCurrentUser(userService.CurrentUser);userService.SetCurrentUserData(userService.CurrentUserData);self.location.href='index.php';});};return fac;}})(); (function(){'use strict';angular.module('appPrincipal').factory('seguridad',function(){return{passchange:'GDDM2016',keychange:'mono,kior;',_e:function(valor){if(valor==null||valor==undefined) return'';return this.Encrypt(valor,this.passchange,this.keychange);},_d:function(valor){if(valor==null||valor==undefined) return'';return this.Decrypt(valor,this.passchange,this.keychange);},Encrypt:function(Strg,passchange,keychange){Strg=keychange+Strg;var i;var P='',N='',Password=passchange;for(var i=0;i<=Password.length-1;i++){N=Password.substring(i,i+1);P=P+N.charCodeAt(0);};var j=0;var A1,N2,A2,A3,b;var S='';for(var i=0;i<=Strg.length-1;i++){N=P.substring(j,j+1);A1=N.charCodeAt(0);j++;if(j>P.length){j=1;} N2=Strg.substring(i,i+1);A2=N2.charCodeAt(0);A3=A1^A2;b=this.decToHex(A3);if(b.length<2){b="0"+b} S=S+b;};return S;},Decrypt:function(Strg,passchange,keychange){var i;var P='',N='',Password=passchange;for(var i=0;i<=Password.length-1;i++){N=Password.substring(i,i+1);P=P+N.charCodeAt(0);};var j=0;var A1,N2,A2,A3,b;var S='';for(var i=0;i<=Strg.length-1;i+=2){N2=P.substring(j,j+1);A1=N2.charCodeAt(0);j++;if(j>P.length){j=1;} b=Strg.substring(i,i+2);A3=parseInt(b,16);A2=A1^A3;S=S+String.fromCharCode(A2);};return S.replace(keychange,'');},decToHex:function(dec){var hexStr="0123456789ABCDEF";var low=dec%16;var high=(dec-low)/16;var hex=""+hexStr.charAt(high)+hexStr.charAt(low);return hex;}};});})(); (function(){'use strict';angular.module('appPrincipalVISOR').factory('seguridad',function(){return{passchange:'GDDM2016',keychange:'mono,kior;',_e:function(valor){if(valor==null||valor==undefined) return'';return this.Encrypt(valor,this.passchange,this.keychange);},_d:function(valor){if(valor==null||valor==undefined) return'';return this.Decrypt(valor,this.passchange,this.keychange);},Encrypt:function(Strg,passchange,keychange){Strg=keychange+Strg;var i;var P='',N='',Password=passchange;for(var i=0;i<=Password.length-1;i++){N=Password.substring(i,i+1);P=P+N.charCodeAt(0);};var j=0;var A1,N2,A2,A3,b;var S='';for(var i=0;i<=Strg.length-1;i++){N=P.substring(j,j+1);A1=N.charCodeAt(0);j++;if(j>P.length){j=1;} N2=Strg.substring(i,i+1);A2=N2.charCodeAt(0);A3=A1^A2;b=this.decToHex(A3);if(b.length<2){b="0"+b} S=S+b;};return S;},Decrypt:function(Strg,passchange,keychange){var i;var P='',N='',Password=passchange;for(var i=0;i<=Password.length-1;i++){N=Password.substring(i,i+1);P=P+N.charCodeAt(0);};var j=0;var A1,N2,A2,A3,b;var S='';for(var i=0;i<=Strg.length-1;i+=2){N2=P.substring(j,j+1);A1=N2.charCodeAt(0);j++;if(j>P.length){j=1;} b=Strg.substring(i,i+2);A3=parseInt(b,16);A2=A1^A3;S=S+String.fromCharCode(A2);};return S.replace(keychange,'');},decToHex:function(dec){var hexStr="0123456789ABCDEF";var low=dec%16;var high=(dec-low)/16;var hex=""+hexStr.charAt(high)+hexStr.charAt(low);return hex;}};});})();(function(){'use strict';angular.module('appPrincipal').factory('Excel',['$window',function($window){var uri='data:application/vnd.ms-excel;base64,',template='{table}
    ',base64=function(s){return $window.btoa(unescape(encodeURIComponent(s)));},format=function(s,c){return s.replace(/{(\w+)}/g,function(m,p){return c[p];})};return{tableToExcel:function(tableId,worksheetName){var table=$(tableId),ctx={worksheet:worksheetName,table:table.html()},href=uri+base64(format(template,ctx));return href;}};}]);})();(function(){'use strict';angular.module('appPrincipal').directive('datepicker',function(){return{restrict:'A',require:'ngModel',link:function(scope,element,attrs,ctrl){$(element).datepicker({showButtonPanel:true,changeMonth:true,changeYear:true,language:'es',todayHighlight:true,dateFormat:'dd/MM/yy',useCurrent:false,yearRange:"-100:+10",forceParse:false,beforeShow:function(){setTimeout(function(){$('.ui-datepicker').css('z-index',99999999999999);},0);}}).on('changeDate',function(selected){scope.$apply(function(){ctrl.$setViewValue(selected.date);});});try{if(!validacontenido(ctrl.$viewValue)) $(element).datepicker('update',ctrl.$viewValue);}catch(e){LOG("ERROR","ASIGNA FECHA PICKER"+e)}}};}).directive('timepicker',function(){return{restrict:'A',require:'ngModel',link:function(scope,element,attrs,ctrl){$(element).timepicker();}};}).directive('datepickermonth',function(){return{restrict:'A',require:'ngModel',link:function(scope,element,attrs,ctrl){$(element).datepicker({autoclose:true,minViewMode:1,format:'mm/yyyy',language:'es',}).on('changeDate',function(selected){scope.$apply(function(){ctrl.$setViewValue('01/'+moment(selected.date).format('MM/YYYY'));});});}};}).directive('datepickeryear',function(){return{restrict:'A',require:'ngModel',link:function(scope,element,attrs,ctrl){$(element).datepicker({autoclose:true,minViewMode:1,format:'yyyy',language:'es',}).on('changeDate',function(selected){scope.$apply(function(){ctrl.$setViewValue(selected.date);});});}};})})();(function(){'use strict';angular.module('appPrincipal').directive('tooltip',function(){return{restrict:'A',link:function(scope,element,attrs){$(element).hover(function(){$(element).tooltip('show');},function(){$(element).tooltip('hide');});}};}).directive('revalidate',function(){return{require:'ngModel',link:function(scope,element,attrs,ngModel){if(attrs.watch){scope.$watch(attrs.watch,function(){if(scope[attrs.form]){scope[attrs.form].$commitViewValue(true);}});}}};}).directive('back',['$window',function($window){return{restrict:'A',link:function(scope,elem,attrs){elem.bind('click',function(){$window.history.back();});}};}]).directive('sidebarProgramacion',function(){return{restrict:'A',link:function(scope,element,attrs){$(element).click(function(){if($('.sidebar-offcanvas').css('background-color')==='rgb(255, 255, 255)'){$('.list-group-item').attr('tabindex','-1');}else{$('.list-group-item').attr('tabindex','');} $('.row-offcanvas').toggleClass('active');});}};}).directive('uppercaseOnly',[function(){return{restrict:'A',require:'ngModel',link:function(scope,element,attrs,ctrl){function parser(value){if(ctrl.$isEmpty(value)){return value;} var formatedValue=value.toUpperCase();if(ctrl.$viewValue!==formatedValue){ctrl.$setViewValue(formatedValue);ctrl.$render();} return formatedValue;} function formatter(value){if(ctrl.$isEmpty(value)){return value;} return value.toUpperCase();} ctrl.$formatters.push(formatter);ctrl.$parsers.push(parser);}};}]).directive('numberFormat',['$filter','$parse',function($filter,$parse){return{require:'ngModel',link:function(scope,element,attrs,ngModelController){var decimals=$parse(attrs.decimals)(scope);ngModelController.$parsers.push(function(data){if(data!==undefined&&data!==null){var parsed=parseFloat(data.replace(/\./g,''));return!isNaN(parsed)?parsed:undefined;} else{var parsed=parseFloat(data);return!isNaN(parsed)?parsed:undefined;}});ngModelController.$formatters.push(function(data){return $filter('number')(data,decimals);});element.bind('focus',function(){element.val(ngModelController.$modelValue);});element.bind('blur',function(){var formatted=$filter('number')(ngModelController.$modelValue,decimals);element.val(formatted);});}}}]);})();(function(){'use strict';angular.module('appPrincipal').directive('toNum',function(){return{require:'ngModel',link:function(scope,element,attrs,ngModel){ngModel.$parsers.push(function(val){return parseInt(val,10);});ngModel.$formatters.push(function(val){return''+val;});}};});})();(function(){'use strict';angular.module('appPrincipal').directive('toStrNum',function(){return{require:'ngModel',link:function(scope,element,attrs,ngModel){ngModel.$parsers.push(function(val){return val!==undefined?val.toString().replace(/\./gi,','):val;});ngModel.$formatters.push(function(val){return val!==undefined?val.toString().replace(/\./gi,','):val;});}};});})();(function(){'use strict';angular.module('appPrincipal').directive('dragprogramacion',function(){return{restrict:'A',link:function(scope,element,attrs,ctrl){var MODELO=scope.$parent.r;$(element).data('event',{id_usuario:MODELO.id_usuario,title:MODELO.nombre+' '+MODELO.apellid_p,stick:true});$(element).draggable({zIndex:999,revert:true,revertDuration:0,snap:true});}};})})();(function(){'use strict';angular.module('appPrincipal').directive('price',['$filter',function($filter){return{restrict:'A',require:'ngModel',link:function(scope,element,attrs,ngModelController){ngModelController.$parsers.push(function(data){data=$filter('comma2decimal')(data);return data;});ngModelController.$formatters.push(function(data){data=$filter('decimal2comma')(data);return data;});}};}]).directive('printPedido',['$filter',function($filter){return{restrict:'A',link:function(scope,element,attrs,ngModelController){$(".btnPrintPedido").printPage({attr:"href",message:"Imprimir Pedido"});}};}]);})();(function(){'use strict';angular.module('appPrincipal').filter('inArray',['$filter',function($filter){return function(list,arrayFilter,element){if(arrayFilter){return $filter("filter")(list,function(listItem){return _.pluck(arrayFilter,element).indexOf(listItem[element])!=-1;});}};}]);})();(function(){'use strict';angular.module('appPrincipal').filter('cut',['$filter',function($filter){return function(value,wordwise,max,tail){if(!value)return'';max=parseInt(max,10);if(!max)return value;if(value.length<=max)return value;value=value.substr(0,max);if(wordwise){var lastspace=value.lastIndexOf(' ');if(lastspace!==-1){if(value.charAt(lastspace-1)==='.'||value.charAt(lastspace-1)===','){lastspace=lastspace-1;} value=value.substr(0,lastspace);}} return value+(tail||' …');};}]);})();(function(){'use strict';angular.module('appPrincipal').filter('concat',['$filter',function($filter){return function(value,item1,item2,sep1,sep2){if(!value)return'';var salida='';angular.forEach(value,function(i,idx){if(item1) salida+=i[item1] if(sep1) salida+=sep1 if(item2) salida+=i[item2] if(idx!==value.length-1){if(sep2) salida+=sep2}});return salida};}]);})();(function(){'use strict';angular.module('appPrincipal').filter('inArray2',['$filter',function($filter){return function(list,value,element){if(value){return $filter("filter")(list,function(listItem){return value==listItem[element];});}};}]);})();(function(){'use strict';angular.module('appPrincipal').filter('dot2comma',[function(){return function(value){return value.toString().replace(/\./g,',');};}]);})();(function(){'use strict';angular.module('appPrincipal').filter('percentage',['$filter',function($filter){return function(input,decimals){return $filter('number')(input*100,decimals)+'%';};}]);})();(function(){'use strict';angular.module('appPrincipal').filter("unique",function(){return function(collection,keyname){var output=[],keys=[];angular.forEach(collection,function(item){var key=item[keyname];if(keys.indexOf(key)===-1){keys.push(key);output.push(item);}});return output;};});})();(function(){'use strict';angular.module('appPrincipal').filter('comma2decimal',[function(){return function(input){var ret=input!==null&&input!==undefined?input.toString().trim().replace(",","."):null;return parseFloat(ret);};}]);})();(function(){'use strict';angular.module('appPrincipal').filter('decimal2comma',[function(){return function(input){var ret=input!==null&&input!==undefined?input.toString().replace(".",","):null;if(ret){var decArr=ret.split(",");if(decArr.length>1){var dec=decArr[1].length;if(dec===1){ret+="0";}}} return ret;};}]);})(); (function(){'use strict';angular.module('appPrincipal').constant('ServiceURL',RUTAAPI).factory('Manager',['$http','$q','ServiceURL','seguridadEncript','$rootScope',function($http,$q,ServiceURL,seguridadEncript,$rootScope){return{promise:null,search:function(_Ctrl){if(this.promise!==null){this.promise.resolve();this.promise=null;} var abort=$q.defer();var $promise=$http.get(ServiceURL+_Ctrl,{timeout:abort.promise}).then(function(response){return response.data;},function(errResponse){console.warn('Problema',_Ctrl);return $q.reject(errResponse.data);});this.promise=abort;return $promise;},getall:function(_Ctrl){return $http.get(ServiceURL+_Ctrl).then(function(response){return response.data;},function(errResponse){console.error('ERROR:',_Ctrl);return $q.reject(errResponse.data);});},get:function(_Ctrl,id){return $http.get(ServiceURL+_Ctrl+'/'+id).then(function(response){return response.data;},function(errResponse){console.error('ERROR:',_Ctrl);return $q.reject(errResponse.data);});},getP:function(_Ctrl){return $http.get(ServiceURL+_Ctrl).then(function(response){return response.data;},function(errResponse){console.error('ERROR:',_Ctrl);return $q.reject(errResponse.data);});},post:function(_Ctrl,_Obj){return $http.post(ServiceURL+_Ctrl+'/',_Obj).then(function(response){return response.data;},function(errResponse){console.error('ERROR:',_Ctrl);return $q.reject(errResponse.data);});},postR:function(_eldestino,_accion,_dataForm,_id,_id2,_estado,_estado2){var json={destino:seguridadEncript.encrypt(_eldestino,SESSION_ID),accion:seguridadEncript.encrypt(_accion,SESSION_ID),dataForm:_dataForm,id:_id,id2:_id2,estado:validacontenido(_estado)?'T':_estado,estado2:validacontenido(_estado2)?'T':_estado2,PROCESS:$rootScope.PROCESS,pageSize:$rootScope.pageSizeParam,page:$rootScope.pageParam};return $http.post(ServiceURL+'controller.php',json).then(function(response){return response.data;},function(errResponse){console.error('ERROR:',errResponse);return $q.reject(errResponse.data);});},postR2:function(_eldestino,_accion,_dataForm,_id,_id2,_estado,_estado2){var json={destino:seguridadEncript.encrypt(_eldestino,SESSION_ID),accion:seguridadEncript.encrypt(_accion,SESSION_ID),dataForm:_dataForm,id:_id,id2:_id2,estado:validacontenido(_estado)?'T':_estado,estado2:validacontenido(_estado2)?'T':_estado2};var deferred=$q.defer();$http.post(ServiceURL+'controller.php',json).then(function(response){deferred.resolve(response.data);},function(errResponse){console.error('ERROR:',errResponse);deferred.reject(errResponse.data);});return deferred.promise;},put:function(_Ctrl,_Obj,id){return $http.put(ServiceURL+_Ctrl+'/'+id,_Obj).then(function(response){return response.data;},function(errResponse){console.error('ERROR:',_Ctrl);return $q.reject(errResponse.data);});},del:function(_Ctrl,id){return $http.delete(ServiceURL+_Ctrl+'/'+id).then(function(response){return response.data;},function(errResponse){console.error('ERROR:',_Ctrl);return $q.reject(errResponse.data);});}};}]);})(); (function(){'use strict';angular.module('appPrincipalVISOR').constant('ServiceURL',RUTAAPI).factory('Manager',['$http','$q','ServiceURL','seguridadEncript','$rootScope',function($http,$q,ServiceURL,seguridadEncript,$rootScope){return{promise:null,search:function(_Ctrl){if(this.promise!==null){this.promise.resolve();this.promise=null;} var abort=$q.defer();var $promise=$http.get(ServiceURL+_Ctrl,{timeout:abort.promise}).then(function(response){return response.data;},function(errResponse){console.warn('Problema',_Ctrl);return $q.reject(errResponse.data);});this.promise=abort;return $promise;},getall:function(_Ctrl){return $http.get(ServiceURL+_Ctrl).then(function(response){return response.data;},function(errResponse){console.error('ERROR:',_Ctrl);return $q.reject(errResponse.data);});},get:function(_Ctrl,id){return $http.get(ServiceURL+_Ctrl+'/'+id).then(function(response){return response.data;},function(errResponse){console.error('ERROR:',_Ctrl);return $q.reject(errResponse.data);});},getP:function(_Ctrl){return $http.get(ServiceURL+_Ctrl).then(function(response){return response.data;},function(errResponse){console.error('ERROR:',_Ctrl);return $q.reject(errResponse.data);});},post:function(_Ctrl,_Obj){return $http.post(ServiceURL+_Ctrl+'/',_Obj).then(function(response){return response.data;},function(errResponse){console.error('ERROR:',_Ctrl);return $q.reject(errResponse.data);});},postR:function(_eldestino,_accion,_dataForm,_id,_id2,_estado,_estado2){var json={destino:seguridadEncript.encrypt(_eldestino,SESSION_ID),accion:seguridadEncript.encrypt(_accion,SESSION_ID),dataForm:_dataForm,id:_id,id2:_id2,estado:validacontenido(_estado)?'T':_estado,estado2:validacontenido(_estado2)?'T':_estado2,PROCESS:$rootScope.PROCESS,pageSize:$rootScope.pageSizeParam,page:$rootScope.pageParam};return $http.post(ServiceURL+'controllerview.php',json).then(function(response){return response.data;},function(errResponse){console.error('ERROR:',errResponse);return $q.reject(errResponse.data);});},postR2:function(_eldestino,_accion,_dataForm,_id,_id2,_estado,_estado2){var json={destino:seguridadEncript.encrypt(_eldestino,SESSION_ID),accion:seguridadEncript.encrypt(_accion,SESSION_ID),dataForm:_dataForm,id:_id,id2:_id2,estado:validacontenido(_estado)?'T':_estado,estado2:validacontenido(_estado2)?'T':_estado2};var deferred=$q.defer();$http.post(ServiceURL+'controllerview.php',json).then(function(response){deferred.resolve(response.data);},function(errResponse){console.error('ERROR:',errResponse);deferred.reject(errResponse.data);});return deferred.promise;},put:function(_Ctrl,_Obj,id){return $http.put(ServiceURL+_Ctrl+'/'+id,_Obj).then(function(response){return response.data;},function(errResponse){console.error('ERROR:',_Ctrl);return $q.reject(errResponse.data);});},del:function(_Ctrl,id){return $http.delete(ServiceURL+_Ctrl+'/'+id).then(function(response){return response.data;},function(errResponse){console.error('ERROR:',_Ctrl);return $q.reject(errResponse.data);});}};}]);})(); (function(){'use strict';angular.module('appPrincipal').factory('seguridadEncript',function(){return{encode64:function(text){if(/([^\u0000-\u00ff])/.test(text)){throw new Error("Can't base64 encode non-ASCII characters.");} var digits="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,cur,prev,byteNum,result=[];while(i>2));break;case 1:result.push(digits.charAt((prev&3)<<4|(cur>>4)));break;case 2:result.push(digits.charAt((prev&0x0f)<<2|(cur>>6)));result.push(digits.charAt(cur&0x3f));break;} prev=cur;i++;} if(byteNum==0){result.push(digits.charAt((prev&3)<<4));result.push("==");}else if(byteNum==1){result.push(digits.charAt((prev&0x0f)<<2));result.push("=");} return result.join("");},decode64:function(text){text=text.replace(/\s/g,"");if(!(/^[a-z0-9\+\/\s]+\={0,2}$/i.test(text))||text.length%4>0){throw new Error("Not a base64-encoded string.");} var digits="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",cur,prev,digitNum,i=0,result=[];text=text.replace(/=/g,"");while(i>4));break;case 2:result.push(String.fromCharCode((prev&0x0f)<<4|cur>>2));break;case 3:result.push(String.fromCharCode((prev&3)<<6|cur));break;} prev=cur;i++;} return result.join("");},ord:function(string){var str=string+'',code=str.charCodeAt(0);if(0xD800<=code&&code<=0xDBFF){var hi=code;if(str.length===1){return code;} var low=str.charCodeAt(1);return((hi-0xD800)*0x400)+(low-0xDC00)+0x10000;} if(0xDC00<=code&&code<=0xDFFF){return code;} return code;},decrypt:function(sData,sKey){if(ACBMODE==='ACB')return sData;var sResult="";sData=this.decode64(sData);var i=0;for(i=0;i>2));break;case 1:result.push(digits.charAt((prev&3)<<4|(cur>>4)));break;case 2:result.push(digits.charAt((prev&0x0f)<<2|(cur>>6)));result.push(digits.charAt(cur&0x3f));break;} prev=cur;i++;} if(byteNum==0){result.push(digits.charAt((prev&3)<<4));result.push("==");}else if(byteNum==1){result.push(digits.charAt((prev&0x0f)<<2));result.push("=");} return result.join("");},decode64:function(text){text=text.replace(/\s/g,"");if(!(/^[a-z0-9\+\/\s]+\={0,2}$/i.test(text))||text.length%4>0){throw new Error("Not a base64-encoded string.");} var digits="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",cur,prev,digitNum,i=0,result=[];text=text.replace(/=/g,"");while(i>4));break;case 2:result.push(String.fromCharCode((prev&0x0f)<<4|cur>>2));break;case 3:result.push(String.fromCharCode((prev&3)<<6|cur));break;} prev=cur;i++;} return result.join("");},ord:function(string){var str=string+'',code=str.charCodeAt(0);if(0xD800<=code&&code<=0xDBFF){var hi=code;if(str.length===1){return code;} var low=str.charCodeAt(1);return((hi-0xD800)*0x400)+(low-0xDC00)+0x10000;} if(0xDC00<=code&&code<=0xDFFF){return code;} return code;},decrypt:function(sData,sKey){if(ACBMODE==='ACB')return sData;var sResult="";sData=this.decode64(sData);var i=0;for(i=0;imax*1){ctrl.$setValidity('ngMax',false);return undefined;}else{ctrl.$setValidity('ngMax',true);return value;}};ctrl.$parsers.push(maxValidator);ctrl.$formatters.push(maxValidator);}};});})();(function(){'use strict';angular.module('appPrincipal').directive('ngMin',function(){return{restrict:'A',require:'ngModel',link:function(scope,elem,attr,ctrl){scope.$watch(attr.ngMin,function(){ctrl.$setViewValue(ctrl.$viewValue);});var minValidator=function(value){var min=scope.$eval(attr.ngMin)*1||0;console.log(!isEmpty(value));console.log(value*10){s=(s+t%10*(9-m++%6))%11;t=Math.floor(t/10);} var v=(s>0)?(s-1)+'':'K';return(v===_value.slice(-1));} function addValidatorToNgModel(ngModel){var validate=function(value){var valid=validateRut(value);if(value===''||value===undefined||value===null) ngModel.$setValidity('rut',true);else ngModel.$setValidity('rut',valid);return valid;};var validateAndFilter=function(_value){_value=cleanRut(_value);return validate(_value)?_value:null;};var validateAndFilter2=function(_value){_value=cleanRut(_value);return validate(_value)?_value:null;};var validateAndFormat=function(_value){_value=cleanRut(_value);validate(_value);return formatRut(_value);};ngModel.$parsers.unshift(validateAndFilter);ngModel.$formatters.unshift(validateAndFormat);} function addValidatorToNgModel2(ngModel){var validate=function(value){var valid=validateRut(value);if(value===''||value===undefined||value===null) ngModel.$setValidity('rut',true);else ngModel.$setValidity('rut',valid);return valid;};var validateAndFilter=function(_value){_value=cleanRut(_value);return validate(_value)?_value:null;};var validateAndFilter2=function(_value){_value=cleanRut(_value);validate(_value);return formatRut2(_value);};var validateAndFormat=function(_value){_value=cleanRut(_value);validate(_value);return formatRut(_value);};ngModel.$parsers.unshift(validateAndFilter2);ngModel.$formatters.unshift(validateAndFormat);} function formatRutOnWatch($scope,ngModel){$scope.$watch(function(){return ngModel.$viewValue;},function(){ngModel.$setViewValue(formatRut(ngModel.$viewValue));ngModel.$render();});} function formatRutOnBlur($element,ngModel){$element.on('blur',function(){ngModel.$setViewValue(formatRut(ngModel.$viewValue));ngModel.$render();});} angular.module('valida.rut',[]).directive('ngRut',function(){return{restrict:'A',require:'ngModel',link:function($scope,$element,$attrs,ngModel){if(typeof $attrs.rutFormat==='undefined'){$attrs.rutFormat='live';} addValidatorToNgModel(ngModel);switch($attrs.rutFormat){case'live':formatRutOnWatch($scope,ngModel);break;case'blur':formatRutOnBlur($element,ngModel);break;}}};}).directive('ngRut2',function(){return{restrict:'A',require:'ngModel',link:function($scope,$element,$attrs,ngModel){if(typeof $attrs.rutFormat==='undefined'){$attrs.rutFormat='live';} switch($attrs.rutFormat){case'live':formatRutOnWatch($scope,ngModel);break;case'blur':formatRutOnBlur($element,ngModel);break;}}};}).directive('ngRut3',function(){return{restrict:'A',require:'ngModel',link:function($scope,$element,$attrs,ngModel){if(typeof $attrs.rutFormat==='undefined'){$attrs.rutFormat='live';} addValidatorToNgModel2(ngModel);switch($attrs.rutFormat){case'live':formatRutOnWatch($scope,ngModel);break;case'blur':formatRutOnBlur($element,ngModel);break;}}};}).filter('rut',function(){return formatRut;}).constant('RutHelper',{format:formatRut,clean:cleanRut,validate:function(value){return validateRut(cleanRut(value));}});})(angular);(function(){'use strict';angular.module('appPrincipal').directive('tabVertical',function(){return{link:function(scope,element,attrs,ngModel){$(document).ready(function(){$(".bhoechie-tab-menu>div.list-group>a").click(function(e){$(this).siblings('a.active').removeClass("active");$(this).addClass("active");$("div.bhoechie-tab>div.bhoechie-tab-content").removeClass("active");$($(this).attr("data-target")).addClass("active");});});}};});})();app.value('uiTinymceConfig',{});app.directive('uiTinymce',['uiTinymceConfig',function(uiTinymceConfig){var uiTinymceConfig=uiTinymceConfig||{};var generatedIds=0;return{require:'ngModel',link:function(scope,elm,attrs,ngModel){var expression,options,tinyInstance;if(!attrs.id){attrs.$set('id','uiTinymce'+generatedIds++);} options={setup:function(ed){ed.on('init',function(args){ngModel.$render();});ed.on('ExecCommand',function(e){ed.save();ngModel.$setViewValue(elm.val());if(!scope.$$phase){scope.$apply();}});ed.on('KeyUp',function(e){console.log(ed.isDirty());ed.save();ngModel.$setViewValue(elm.val());if(!scope.$$phase){scope.$apply();}});},mode:'exact',elements:attrs.id};if(attrs.uiTinymce){expression=scope.$eval(attrs.uiTinymce);}else{expression={};} angular.extend(options,uiTinymceConfig,expression);setTimeout(function(){tinymce.init(options);});ngModel.$render=function(){if(!tinyInstance){tinyInstance=tinymce.get(attrs.id);} if(tinyInstance){try{tinyInstance.setContent(ngModel.$viewValue||'');}catch(ex){}}};}};}]); (function(){'use strict';angular.module('appPrincipal').factory('newsControllerInitialData',['$rootScope','Manager','userService',function($rootScope,Manager,userService){return function(){var currentUser=userService.GetCurrentUser();};}]);})();(function(){'use strict';angular.module('appPrincipal').controller('Hoperador',['$scope','$rootScope','Manager','ModalService','$controller',function($scope,$rootScope,Manager,ModalService,$controller){$controller('all_comun',{$scope:$scope});$scope.llenaListasVTComun();$scope.close=function(){close(true,200);};$scope.$emit("SETTITLE",{TituloPrincipal:'USUARIOS',TituloSecundario:'Mantención de usuarios'});$scope.filtro={rut:'',nombre:'',rol_code:null,inactivo:0};$rootScope.pageSizeParam=10;$rootScope.pageParam=1;$scope.changePagination=function(pagina){$rootScope.pageParam=$rootScope.pageParam+pagina;$scope.LISTA_TABLA(0);};Manager.postR('roles','getall',{}).then(function(d){$scope.PERFILES_ALL=d.data;},function(errResponse){$scope.$emit("UNLOAD");});Manager.postR('sucursales','getall',{}).then(function(d){$scope.ALL_SUCURSALES=d.data;},function(errResponse){});$scope.updatelinea=function(MODELO){$scope.estado_ejecucion=true;Manager.postR('usuarios','updatesimple',MODELO,MODELO.idoperador).then(function(d){$scope.estado_ejecucion=false;},function(errResponse){$scope.estado_ejecucion=false;});};$scope.LISTA_TABLA=function(modo){if(modo!==0){$rootScope.pageParam=1;} Manager.postR('usuarios','getall',$scope.filtro).then(function(d){$scope.filas=d.data.data;$scope.paginas=d.data.paginas;$scope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});};$scope.LISTA_TABLA();$scope.openEdit=function(id,modo){var html='operador/add.html';var controller='Aoperador';if(modo==='U'){html='operador/add.html';controller='Uoperador';} ModalService.showModal({templateUrl:'app_partials/'+html,controller:controller,inputs:{id:id},preClose:(modal)=>{modal.element.modal('hide');}}).then(function(modal){modal.element.modal();modal.close.then(function(result){$scope.LISTA_TABLA(0);});});};$scope.Baja=function(item){bootbox.confirm({message:"Esta"+(item.estado!=='V'?' Activando ':' Desactivando ')+"el usuario, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$scope.$emit("LOAD");Manager.postR('usuarios','updateestado',item,item.idoperador).then(function(){$scope.LISTA_TABLA();$scope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});}}});};$scope.enviarDatosAcceso=function(item){bootbox.confirm({message:"Enviará mail informando al usuario sus datos de acceso, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$scope.$emit("LOAD");Manager.postR('usuarios','sendDatosAcceso',{},item.idoperador).then(function(){bootbox.alert("Se han enviado los datos.");$scope.LISTA_TABLA(0);$scope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});}}});};}]);})();(function(){'use strict';angular.module('appPrincipal').controller('Aoperador',['$scope','$rootScope','Manager','close','$controller',function($scope,$rootScope,Manager,close,$controller){$controller('all_comun',{$scope:$scope});$scope.llenaListasVTComun();$scope.filtro={modo:'2',search:''};$scope.modo_panatalla="NEW";$scope.modelo={idoperador:null,useraccess:null,rol_code:null,rut:null,password:null,nombre:null,mail:null,estado:null,recuperar:null,recuperar_pass:null,recuperar_fecha:null,super:null,ind_envia_datos:null,last_acceso:null,contacto:null,ind_aceptalogin:0,operadorescol:null,vttipousuario:null,vttipomaestro:null,fechanacimiento:null,celular1:null,celular2:null};$scope.close=function(){close(true,200);};Manager.postR('roles','getall',{}).then(function(d){$scope.PERFILES_ALL=d.data;$rootScope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});$scope.estado_ejecucion=false;$scope.guardar=function(){var MODELO=cloneJson($scope.modelo);if(!validacontenido(MODELO.password)){MODELO.password=$.md5(MODELO.password);} MODELO.fechanacimiento=validacontenido(MODELO.fechanacimiento)?null:$scope.changedate2(MODELO.fechanacimiento,21);bootbox.confirm({message:"Agregará un nuevo usuario, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$scope.$emit("LOAD");$scope.estado_ejecucion=true;Manager.postR('usuarios','add',MODELO).then(function(d){$scope.close();},function(errResponse){$scope.$emit("UNLOAD");$scope.estado_ejecucion=false;});}}});};}]);})();(function(){'use strict';angular.module('appPrincipal').controller('Uoperador',['$scope','$rootScope','Manager','close','id','$controller',function($scope,$rootScope,Manager,close,id,$controller){$controller('all_comun',{$scope:$scope});$scope.llenaListasVTComun();$scope.filtro={modo:'1',search:''};$scope.modo_panatalla="EDIT";$scope.close=function(){close(true,200);};$rootScope.$emit("LOAD");Manager.postR('roles','getall',{}).then(function(d){$scope.PERFILES_ALL=d.data;Manager.postR('usuarios','getid',{},id).then(function(d){d.data.fechanacimiento=validacontenido(d.data.fechanacimiento)?null:new Date(d.data.fechanacimiento);$scope.modelo=d.data;$rootScope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});},function(errResponse){$scope.$emit("UNLOAD");});$scope.estado_ejecucion=false;$scope.guardar=function(){var MODELO=cloneJson($scope.modelo);if(!validacontenido(MODELO.password)){MODELO.password=$.md5(MODELO.password);} MODELO.fechanacimiento=validacontenido(MODELO.fechanacimiento)?null:$scope.changedate2(MODELO.fechanacimiento,21);bootbox.confirm({message:"Actualizará usuario, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$scope.$emit("LOAD");$scope.estado_ejecucion=true;Manager.postR('usuarios','update',MODELO,id).then(function(d){$scope.close(true,200);},function(errResponse){$scope.$emit("UNLOAD");$scope.estado_ejecucion=false;});}}});};}]);})(); (function(){'use strict';angular.module('appPrincipal').controller('Hpermision',['$scope','$rootScope','Manager','ModalService',function($scope,$rootScope,Manager,ModalService){$scope.close=function(){close(true,200);};$scope.$emit("SETTITLE",{TituloPrincipal:'Roles',TituloSecundario:'Roles y Procesos'});$rootScope.pageSizeParam=10;$rootScope.pageParam=1;$scope.LISTA_TABLA=function(){$scope.$emit("LOAD");Manager.postR('roles','getall',{}).then(function(d){$scope.roles=d.data;$scope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});};$scope.LISTA_TABLA();$scope.verProcesos=false;$scope.verRol=function(verRol){$scope.elRolVer=verRol;$scope.$emit("LOAD");Manager.postR('roles','getRolesPermisos',{},verRol.rol_code).then(function(d){Manager.postR('roles','getprocesosmenu',{}).then(function(p){$scope.allTipoProcesos=_.groupBy(p.data,'agrupador');$scope.procesos=_.map(p.data,function(item){return{codigo_m:item.codigo_m,orden:item.orden,seleccion:Object.keys(_.filter(d.data,function(i){return i.codigo_m===item.codigo_m;})).length>0?1:0,descripcion:item.descripcion,agrupador:item.agrupador};});$scope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});},function(errResponse){$scope.$emit("UNLOAD");});};$scope.all_check=function(codigo_m){$scope.procesos=_.map($scope.procesos,function(item){return{codigo_m:item.codigo_m,orden:item.orden,seleccion:(codigo_m===item.codigo_m?1:item.seleccion),descripcion:item.descripcion,agrupador:item.agrupador};});};$scope.guardar=function(elRol){var MODELO=angular.copy($scope.procesos);var ROL=angular.copy(elRol);ROL['procesos']=MODELO;bootbox.confirm({message:"Actualizará información del ROL, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$scope.$emit("LOAD");Manager.postR('roles','updatepermisos',ROL).then(function(d){$scope.verRol(ROL);},function(errResponse){$scope.$emit("UNLOAD");});}}});};}]);})(); (function(){'use strict';angular.module('appPrincipal').controller('Hparametrovalor',['$scope','Manager','ModalService',function($scope,Manager,ModalService){$scope.$emit("SETTITLE",{TituloPrincipal:'Parametros',TituloSecundario:'Valor'});$scope.LISTA_TABLA=function(){$scope.$emit("LOAD");Manager.postR('parametrovalor','getall',{}).then(function(d){$scope.filas=d.data;$scope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});};$scope.LISTA_TABLA();$scope.openEdit=function(id,modo){var html='paramvalor/add.html';var controller='Aparametrovalor';if(modo==='U'){html='paramvalor/add.html';controller='Uparametrovalor';} ModalService.showModal({templateUrl:'app_partials/'+html,controller:controller,inputs:{id:id},preClose:(modal)=>{modal.element.modal('hide');}}).then(function(modal){modal.element.modal();modal.close.then(function(result){$scope.LISTA_TABLA();});});};$scope.Baja=function(item){bootbox.confirm({message:"Esta"+(item.estado!=='V'?' Activando ':' Desactivando ')+"el registro, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$scope.$emit("LOAD");Manager.postR('parametrovalor','updateestado',{},item.codsucursal).then(function(){$scope.LISTA_TABLA();$scope.$emit("UNLOAD");},function(errResponse){bootbox.alert(errResponse.message);$scope.$emit("UNLOAD");});}}});};}]);})();(function(){'use strict';angular.module('appPrincipal').controller('Aparametrovalor',['$scope','$rootScope','Manager','close',function($scope,$rootScope,Manager,close){$scope.modo_panatalla="NEW";$scope.aprobadores=[];$scope.filtro={modo:'1',search:''};$scope.close=function(){close(true,200);};$scope.modelo={esagregado:0};$scope.estado_ejecucion=false;$scope.guardar=function(){var MODELO=angular.copy($scope.modelo);bootbox.confirm({message:"Agregará un registro, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$rootScope.$emit("LOAD");$scope.estado_ejecucion=true;Manager.postR('parametrovalor','add',MODELO).then(function(d){$scope.close();$rootScope.$emit("UNLOAD");},function(errResponse){$rootScope.$emit("UNLOAD");$scope.estado_ejecucion=false;});}}});};$scope.fetchUsers=function(){var searchText_len=Object.keys($scope.filtro.search).length;if(searchText_len>0){Manager.postR('usuarios','getallSearch',$scope.filtro).then(function(d){$scope.searchResult=d.data;},function(errResponse){});}else{$scope.searchResult={};}};$scope.setValue=function(index,$event){if(!Object.keys(_.filter($scope.aprobadores,function(i){return i.idoperador===$scope.searchResult[index].idoperador;})).length>0){$scope.aprobadores.push($scope.searchResult[index]);$scope.filtro.search=null;}};$scope.delAprbador=function(item){$scope.aprobadores=_.filter($scope.aprobadores,function(i){return i.idoperador!==item.idoperador;});};$scope.searchboxClicked=function($event){$event.stopPropagation();};$scope.containerClicked=function(){$scope.searchResult={};};}]);})();(function(){'use strict';angular.module('appPrincipal').controller('Uparametrovalor',['$scope','$rootScope','Manager','close','id',function($scope,$rootScope,Manager,close,id){$scope.filtro={modo:'1',search:''};$scope.modo_panatalla="EDIT";$scope.close=function(){close(true,200);};$rootScope.$emit("LOAD");Manager.postR('parametrovalor','getid',{},id).then(function(d){$scope.modelo=d.data;$rootScope.$emit("UNLOAD");},function(errResponse){$rootScope.$emit("UNLOAD");});$scope.estado_ejecucion=false;$scope.guardar=function(){bootbox.confirm({message:"Actualizará registro, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$rootScope.$emit("LOAD");$scope.estado_ejecucion=true;var MODELO=angular.copy($scope.modelo);Manager.postR('parametrovalor','update',MODELO,id).then(function(d){$scope.close(true,200);},function(errResponse){$rootScope.$emit("UNLOAD");$scope.estado_ejecucion=false;});}}});};$scope.fetchUsers=function(){var searchText_len=Object.keys($scope.filtro.search).length;if(searchText_len>0){Manager.postR('usuarios','getallSearch',$scope.filtro).then(function(d){$scope.searchResult=d.data;},function(errResponse){});}else{$scope.searchResult={};}};$scope.setValue=function(index,$event){if(!Object.keys(_.filter($scope.aprobadores,function(i){return i.idoperador===$scope.searchResult[index].idoperador;})).length>0){$scope.aprobadores.push($scope.searchResult[index]);$scope.filtro.search=null;}};$scope.delAprbador=function(item){$scope.aprobadores=_.filter($scope.aprobadores,function(i){return i.idoperador!==item.idoperador;});};$scope.searchboxClicked=function($event){$event.stopPropagation();};$scope.containerClicked=function(){$scope.searchResult={};};}]);})();(function(){'use strict';angular.module('appPrincipal').controller('Avalorestipo',['$scope','$rootScope','Manager','close',function($scope,$rootScope,Manager,close){$scope.modo_panatalla="NEW";$scope.aprobadores=[];$scope.filtro={modo:'1',search:''};$scope.close=function(){close(true,200);};$scope.modelo={esagregado:0};$scope.estado_ejecucion=false;$scope.guardar=function(){var MODELO=angular.copy($scope.modelo);bootbox.confirm({message:"Agregará un registro, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$rootScope.$emit("LOAD");$scope.estado_ejecucion=true;Manager.postR('valorestipo','add',MODELO).then(function(d){$scope.close();$rootScope.$emit("UNLOAD");},function(errResponse){$rootScope.$emit("UNLOAD");});}}});};}]);})();(function(){'use strict';angular.module('appPrincipal').controller('Uvalorestipo',['$scope','$rootScope','Manager','close','id',function($scope,$rootScope,Manager,close,id){$scope.filtro={modo:'1',search:''};$scope.modo_panatalla="EDIT";$scope.close=function(){close(true,200);};$rootScope.$emit("LOAD");Manager.postR('valorestipo','getid',{},id).then(function(d){$scope.modelo=d.data;$rootScope.$emit("UNLOAD");},function(errResponse){$rootScope.$emit("UNLOAD");});$scope.guardar=function(){bootbox.confirm({message:"Actualizará registro, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$rootScope.$emit("LOAD");var MODELO=angular.copy($scope.modelo);Manager.postR('valorestipo','update',MODELO,id).then(function(d){$scope.close(true,200);},function(errResponse){$rootScope.$emit("UNLOAD");});}}});};}]);})(); (function(){'use strict';angular.module('appPrincipal').controller('Hvalorestipo',['$scope','Manager','ModalService',function($scope,Manager,ModalService){$scope.$emit("SETTITLE",{TituloPrincipal:'Tipos y Valores',TituloSecundario:'Tipos y Valores'});$scope.LISTA_TABLA=function(){$scope.$emit("LOAD");Manager.postR('valorestipo','getall',{}).then(function(d){$scope.filas=d.data;$scope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});};$scope.LISTA_TABLA();$scope.openEdit=function(id,modo){var html='mantenedores/valorestipo/add.html';var controller='Avalorestipo';if(modo==='U'){html='mantenedores/valorestipo/add.html';controller='Uvalorestipo';} ModalService.showModal({templateUrl:'app_partials/'+html,controller:controller,inputs:{id:id},preClose:(modal)=>{modal.element.modal('hide');}}).then(function(modal){modal.element.modal();modal.close.then(function(result){$scope.LISTA_TABLA();});});};}]);})(); (function(){'use strict';angular.module('appPrincipal').controller('Hvalorestipoadmin',['$scope','Manager','ModalService',function($scope,Manager,ModalService){$scope.$emit("SETTITLE",{TituloPrincipal:'Tipos y Valores',TituloSecundario:'Tipos y Valores'});$scope.LISTA_TABLA=function(){$scope.$emit("LOAD");Manager.postR('valorestipo','getall',{},'VERALL').then(function(d){$scope.filas=d.data;$scope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});};$scope.LISTA_TABLA();$scope.openEdit=function(id,modo){var html='mantenedores/valorestipo/add.html';var controller='Avalorestipo';if(modo==='U'){html='mantenedores/valorestipo/add.html';controller='Uvalorestipo';} ModalService.showModal({templateUrl:'app_partials/'+html,controller:controller,inputs:{id:id},preClose:(modal)=>{modal.element.modal('hide');}}).then(function(modal){modal.element.modal();modal.close.then(function(result){$scope.LISTA_TABLA();});});};}]);})();(function(){'use strict';angular.module('appPrincipal').controller('Avalorestipodetalle',['$scope','$rootScope','Manager','close','codigotipo',function($scope,$rootScope,Manager,close,codigotipo){$scope.modo_panatalla="NEW";$scope.close=function(){close(true,200);};$scope.modelo={codigotipo:codigotipo,codigovalor:null,descripcion:null,aux1:null,aux2:null,aux3:null,aux4:null,aux5:null};$scope.estado_ejecucion=false;$scope.guardar=function(){var MODELO=angular.copy($scope.modelo);bootbox.confirm({message:"Agregará un registro, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$rootScope.$emit("LOAD");$scope.estado_ejecucion=true;Manager.postR('valorestipodetalle','add',MODELO).then(function(d){$scope.close();$rootScope.$emit("UNLOAD");},function(errResponse){$rootScope.$emit("UNLOAD");});}}});};}]);})();(function(){'use strict';angular.module('appPrincipal').controller('Uvalorestipodetalle',['$scope','$rootScope','Manager','close','id','codigotipo',function($scope,$rootScope,Manager,close,id,codigotipo){$scope.modo_panatalla="EDIT";$scope.close=function(){close(true,200);};$rootScope.$emit("LOAD");Manager.postR('valorestipodetalle','getid',{},id).then(function(d){$scope.modelo=d.data;$rootScope.$emit("UNLOAD");},function(errResponse){$rootScope.$emit("UNLOAD");});$scope.guardar=function(){bootbox.confirm({message:"Actualizará registro, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$rootScope.$emit("LOAD");var MODELO=angular.copy($scope.modelo);Manager.postR('valorestipodetalle','update',MODELO,id).then(function(d){$scope.close(true,200);},function(errResponse){$rootScope.$emit("UNLOAD");});}}});};}]);})();(function(){'use strict';angular.module('appPrincipal').controller('Hvalorestipodetalle',['$scope','Manager','ModalService','$routeParams',function($scope,Manager,ModalService,$routeParams){$scope.filtro={inactivo:0};$scope.$emit("SETTITLE",{TituloPrincipal:'Tipos y Valores',TituloSecundario:'Valores asociados a '+$routeParams.codigotipo});$scope.LISTA_TABLA=function(){$scope.$emit("LOAD");Manager.postR('valorestipodetalle','getall',$scope.filtro,$routeParams.codigotipo).then(function(d){$scope.filas=d.data;$scope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});};$scope.LISTA_TABLA();$scope.openEdit=function(id,modo){var html='mantenedores/valorestipodetalle/add.html';var controller='Avalorestipodetalle';if(modo==='U'){html='mantenedores/valorestipodetalle/add.html';controller='Uvalorestipodetalle';} ModalService.showModal({templateUrl:'app_partials/'+html,controller:controller,inputs:{codigotipo:$routeParams.codigotipo,id:id},preClose:(modal)=>{modal.element.modal('hide');}}).then(function(modal){modal.element.modal();modal.close.then(function(result){$scope.LISTA_TABLA();});});};$scope.Baja=function(item){bootbox.confirm({message:"Esta"+(item.estado!=='V'?' Activando ':' Desactivando ')+"el registro, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$scope.$emit("LOAD");Manager.postR('valorestipodetalle','updateestado',{estado:(item.estado==='V'?'A':'V')},item.idvalorestipo).then(function(){$scope.LISTA_TABLA();$scope.$emit("UNLOAD");},function(errResponse){bootbox.alert(errResponse.message);$scope.$emit("UNLOAD");});}}});};}]);})(); (function(){'use strict';angular.module('appPrincipal').controller('Hcomunas',['$scope','Manager','ModalService','ServiceURL','$http','seguridadEncript',function($scope,Manager,ModalService,ServiceURL,$http,seguridadEncript){$scope.urlsbaseFormato=ServiceURL+'excel/outFormatoVersiones.php';$scope.urlsbaseDownload=ServiceURL+'excel/outVersiones.php';$scope.$emit("SETTITLE",{TituloPrincipal:'IMPORTAR COMUNAS',TituloSecundario:'Regiones y comunas de chile'});$scope.existemarca=1;$scope.existemodelo=1;$scope.modelo={vtregion:null,vtcomuna:null};Manager.postR('valorestipodetalle','getall',{inactivo:0},'REGION').then(function(d){$scope.ALL_REGION=d.data;},function(errResponse){$scope.$emit("UNLOAD");});$scope.LISTA_TABLA=function(){Manager.postR('valorestipodetalle','getByDescripcionAuxContiene',{inactivo:0,descripcion:$scope.modelo.vtcomuna,aux1:$scope.modelo.vtregion},'COMUNA').then(function(d){$scope.filas=d.data;},function(errResponse){$scope.$emit("UNLOAD");});};$scope.LISTA_TABLA();$scope.agregaComuna=function(){if(validacontenido($scope.modelo.vtregion)){bootbox.alert("Debe indicar region para agregar registro");} else if(validacontenido($scope.modelo.vtcomuna)){bootbox.alert("Debe indicar comuna para agregar registro");} Manager.postR('valorestipodetalle','importaCOMUNASREGIONView',$scope.modelo).then(function(d){bootbox.alert("Registro realizado") $scope.LISTA_TABLA();},function(errResponse){bootbox.alert("No se pudo realizar el registro") $scope.$emit("UNLOAD");});};$scope.uploadComunas=function(files){$scope.$emit('LOAD');var fd=new FormData();$scope.archivos=[];fd.append("file",files[0]);fd.append("origen",'vf');fd.append("modo",'tmp');var $promise=$http.post(ServiceURL+'excel/uComunasRegion.php',fd,{withCredentials:true,headers:{'Content-Type':undefined},transformRequest:angular.identity});$promise.then(function(msg){$('#fileaddVideo').val('');LOG(msg.data);var Salida="Importación finalizada.";bootbox.alert(Salida);$scope.LISTA_TABLA();$scope.$emit('UNLOAD');},function(errResponse){$('#fileaddVideo').val('');$scope.LISTA_TABLA();bootbox.alert('
    Problemas al cargar archivos
    ');$scope.$emit('UNLOAD');});};}]);})();(function(){'use strict';angular.module('appPrincipal').controller('all_comun',['$scope','$rootScope','Manager','ModalService','userService','seguridadEncript','ServiceURL','$http',function($scope,$rootScope,Manager,ModalService,userService,seguridadEncript,ServiceURL,$http){$scope.urlsbaseDownload=ServiceURL+'excel/outSABANA.php';$scope.urlsbaseDownloadFiltro=ServiceURL+'excel/outSABANAfiltro.php';$scope.ServiceURL=ServiceURL;$scope.segurito=seguridadEncript;var current=userService.GetCurrentUserData();$scope.iop=current.data.id;$scope.rol=current.data.rol_code;$scope.codsucursalorigen=current.data.codsucursalorigen;$scope.idoperador=current.data.id;$rootScope.pageSizeParam=10;$rootScope.pageParam=1;$rootScope.filtroProyectos={rut:null,cliente:null,proyecto:null};$scope.LimpiaFiltroProyectos=function(){$rootScope.filtroProyectos={rut:null,cliente:null,proyecto:null}};$scope.length=function(v){if(validacontenido(v))return 0;return(''+v).length;};$scope.llenaListasVTComun=function(){Manager.postR('parametrovalor','getparkeyjson',{}).then(function(d){$scope.PARAMETROSVALOR=d.data;Manager.postR('valorestipodetalle','getallVT',{}).then(function(d){$scope.ALL_VT=d.data;},function(errResponse){});},function(errResponse){});};$rootScope.VTforce=function(clave){$rootScope.$emit("LOAD");Manager.postR('valorestipodetalle','getall',{inactivo:0},clave).then(function(d){$scope.ALL_VT[clave]=d.data;$rootScope.$emit("UNLOAD");},function(errResponse){$rootScope.$emit("UNLOAD");});};$scope.toInt=function(valor){return Math.trunc(valor);};$rootScope.EditarProyectoFechas=0;$scope.UpdateFechaProyecto=function(campo,modelo){var MODELO=angular.copy(modelo);Manager.postR('proyectos','updatefecha',MODELO,campo,$scope.changedate2(MODELO[campo],21)).then(function(d){bootbox.alert("OK");$rootScope.EditarProyectoFechas=0;},function(errResponse){bootbox.alert("Problemas al registrar");$scope.$emit("UNLOAD");});};$scope.TraerProyectoCabyCliente=function(idproyecto){Manager.postR('proyectos','getid',{},idproyecto).then(function(d){d.data.fechainicio=validacontenido(d.data.fechainicio)?null:new Date(d.data.fechainicio);d.data.fechaterminoestimada=validacontenido(d.data.fechaterminoestimada)?null:new Date(d.data.fechaterminoestimada);d.data.fechterminoreal=validacontenido(d.data.fechterminoreal)?null:new Date(d.data.fechterminoreal);d.data.fechaarquitecturainicio=validacontenido(d.data.fechaarquitecturainicio)?null:new Date(d.data.fechaarquitecturainicio);d.data.fechaarquitecturafin=validacontenido(d.data.fechaarquitecturafin)?null:new Date(d.data.fechaarquitecturafin);d.data.fechamanoobrainicio=validacontenido(d.data.fechamanoobrainicio)?null:new Date(d.data.fechamanoobrainicio);d.data.fechamanoobrafin=validacontenido(d.data.fechamanoobrafin)?null:new Date(d.data.fechamanoobrafin);$scope.modelo=d.data;Manager.postR('clientes','getid',{},d.data.idclientes).then(function(d){$scope.modelo_cliente=d.data;$scope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});},function(errResponse){$scope.$emit("UNLOAD");});};$scope.TraerProyectoDetalle=function(idproyecto){Manager.postR('proyectodetalle','getall',{},idproyecto).then(function(d){$scope.detalleproyecto=d.data;$scope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});};$scope.TraerProyectoDetalleId=function(idproyectodetalle){Manager.postR('proyectodetalle','getid',{},idproyectodetalle).then(function(d){$scope.itemProyecto=d.data;$scope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});};$scope.TraerProyectoDetallePagos=function(idproyectodetalle){Manager.postR('proyectodetallepagos','getall',{},idproyectodetalle).then(function(d){$scope.detalleproyectopagos=d.data;$scope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});};$scope.TraerProyectoDetalleGastosCategoria=function(idproyecto){Manager.postR('proyectodetgastos','getallbycat',{},idproyecto).then(function(d){$scope.detalleproyectogastoscategoria=d.data;$scope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});};$scope.TraerProyectoDetalleGastos=function(idproyecto){Manager.postR('proyectodetgastos','getall',{},idproyecto).then(function(d){$scope.detalleproyectogastos=d.data;$scope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});};$scope.TraerProyectoDetalleGastosId=function(idproyectodetgastos){Manager.postR('proyectodetgastos','getid',{},idproyectodetgastos).then(function(d){$scope.itemGasto=d.data;$scope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});};$scope.TraerProyectoDetalleGastosPagos=function(idproyectodetgastos){Manager.postR('proyectodetgastospagos','getall',{},idproyectodetgastos).then(function(d){$scope.detallegastospago=d.data;$scope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});};$scope.TraerProyectoDocumentos=function(idproyecto){Manager.postR('proyectosdocumentos','getALLById',{},idproyecto).then(function(d){$scope.proyecto_documentos=d.data;$scope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});};$scope.addPagoCorto=function(item,modo,id){var MODELO={idproyectodetgastospagos:null,registro:null,valor:item.valor,comentarios:'PAGO RAPIDO',idproyectodetgastos:item.idproyectodetgastos,idoperador:null,estado:null,fechapago:modo===0?new Date(item.fechagasto):new Date()};if(item.vttipogasto==='TRATO'||item.vttipogasto==='SUELDO'){bootbox.confirm({message:"Registrará pago de sueldo/trato, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$scope.$emit("LOAD");Manager.postR('proyectodetgastospagos','add',MODELO,item.idproyectodetgastos).then(function(d){notyConfig("OK",'success','bottomRight');$scope.$emit("UNLOAD");$scope.TraerProyectoCabyCliente(id);$scope.TraerProyectoDetalleGastosCategoria(id);$scope.TraerProyectoDetalleGastos(id);},function(errResponse){notyConfig("Problema",'danger','bottomRight');$scope.$emit("UNLOAD");$scope.press_btn=false;});}else{$scope.press_btn=false;}}});}else{$scope.$emit("LOAD");Manager.postR('proyectodetgastospagos','add',MODELO,item.idproyectodetgastos).then(function(d){notyConfig("OK",'success','bottomRight');$scope.$emit("UNLOAD");$scope.TraerProyectoCabyCliente(id);$scope.TraerProyectoDetalleGastosCategoria(id);$scope.TraerProyectoDetalleGastos(id);},function(errResponse){notyConfig("Problema",'danger','bottomRight');$scope.$emit("UNLOAD");$scope.press_btn=false;});}};$scope.addPagoCorto2=function(item,modo,id){var MODELO={idproyectodetgastospagos:null,registro:null,valor:item.valor,comentarios:'PAGO RAPIDO',idproyectodetgastos:item.idproyectodetgastos,idoperador:null,estado:null,fechapago:modo===0?new Date(item.fechagasto):new Date()};if(item.vttipogasto==='TRATO'||item.vttipogasto==='SUELDO'){bootbox.confirm({message:"Registrará pago de sueldo/trato, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$scope.$emit("LOAD");Manager.postR('proyectodetgastospagos','add',MODELO,item.idproyectodetgastos).then(function(d){notyConfig("OK",'success','bottomRight');$scope.$emit("UNLOAD");$scope.TraerProyectoDetalleGastos(id);},function(errResponse){notyConfig("Problema",'danger','bottomRight');$scope.$emit("UNLOAD");$scope.press_btn=false;});}else{$scope.press_btn=false;}}});}else{$scope.$emit("LOAD");Manager.postR('proyectodetgastospagos','add',MODELO,item.idproyectodetgastos).then(function(d){notyConfig("OK",'success','bottomRight');$scope.$emit("UNLOAD");$scope.TraerProyectoDetalleGastos(id);},function(errResponse){notyConfig("Problema",'danger','bottomRight');$scope.$emit("UNLOAD");$scope.press_btn=false;});}};$scope.selection_vttipodocumento=null;$scope.uploadDocumentProyecto=function(element,files){var fd=new FormData();$scope.archivos=[];$scope.$emit('LOAD');fd.append("file",files[0]);fd.append("idproyecto",$scope.modelo.idproyecto);fd.append("vttipodocumento",$scope.selection_vttipodocumento);var $promise=$http.post(ServiceURL+'upload/uNegocioProy.php',fd,{withCredentials:true,headers:{'Content-Type':undefined},transformRequest:angular.identity});$promise.then(function(msg){notyConfig("Archivo cargado",'success','bottomRight');$(element).val('');$scope.TraerProyectoDocumentos($scope.modelo.idproyecto);$scope.$emit('UNLOAD');},function(errResponse){var problemas_up="";angular.forEach(errResponse.data.data,function(itemE){problemas_up+=itemE+"
    ";});notyConfig("No es posible cargar el archivo
    "+problemas_up,'warning','bottomRight');$scope.TraerProyectoDocumentos($scope.modelo.idproyecto);$(element).val('');$scope.$emit('UNLOAD');});};}]);})();(function(){'use strict';angular.module('appPrincipal').controller('g001_add',['$scope','$rootScope','Manager','$location','$controller',function($scope,$rootScope,Manager,$location,$controller){$controller('all_comun',{$scope:$scope,$rootScope:$rootScope});$scope.llenaListasVTComun();$scope.$emit("SETTITLE",{TituloPrincipal:'PROYECTOS',TituloSecundario:'Gestión de proyectos/Nuevo'});$scope.$emit("UNLOAD");$scope.modelo_cliente={nombre:null,celular1:null,celular2:null,mail1:null,mail2:null,estado:'V',rut:null,comentarios:null,direccionprincipal:null};$scope.modelo={idproyecto:null,descripcion:null,comentarios:null,registro:null,fechainicio:null,fechaterminoestimada:null,fechterminoreal:null,vtestadoproyecto:'PROYECTO/NUEVO',vtestadoejecucion:'GESTION',idclientes:null,idoperador:null,proyectodireccion:null,vtcomuna:null,vtregion:null};$scope.modo_panatalla="NEW";$scope.press_btn=false;$scope.guardar=function(){var MODELO={proyecto:angular.copy($scope.modelo),cliente:angular.copy($scope.modelo_cliente)} if(MODELO.proyecto.idclientes=='-999'){bootbox.confirm({message:"Agregará un registro, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$scope.$emit("LOAD");Manager.postR('proyectos','add',MODELO).then(function(d){$scope.$emit("UNLOAD");$scope.press_btn=false;$location.path('/gestion/proyectos/edit/'+d.data);notyConfig("OK",'success','bottomRight');},function(errResponse){notyConfig("Problema",'danger','bottomRight');$scope.$emit("UNLOAD");$scope.press_btn=false;});}else{$scope.press_btn=false;}}});}else{bootbox.confirm({message:"Agregará un registro, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$scope.$emit("LOAD");Manager.postR('proyectos','add',MODELO).then(function(d){$scope.$emit("UNLOAD");$scope.press_btn=false;$location.path('/gestion/proyectos/edit/'+d.data);notyConfig("OK",'success','bottomRight');},function(errResponse){notyConfig("Problema",'danger','bottomRight');$scope.$emit("UNLOAD");$scope.press_btn=false;});}else{$scope.press_btn=false;}}});}} $scope.searchCliente={search:''};$scope.clienteSeleccionado=null;$scope.buscarClientes=function(){var searchText_len=Object.keys($scope.searchCliente.search).length;if(searchText_len>0){Manager.postR('clientes','getALLVigentesSearch',$scope.searchCliente).then(function(d){$scope.searchResult=d.data;},function(errResponse){});}else{$scope.searchResult={};$scope.clienteSeleccionado=null;}};$scope.setValueCliente=function(index,$event){$scope.modelo.idclientes=$scope.searchResult[index].idclientes;$scope.clienteSeleccionado=$scope.searchResult[index];$scope.searchCliente.search=null;$scope.searchResult={};};}]);})();(function(){'use strict';angular.module('appPrincipal').controller('g001_edit',['$scope','$rootScope','Manager','ServiceURL','$http','ModalService','$location','$routeParams','$controller',function($scope,$rootScope,Manager,ServiceURL,$http,ModalService,$location,$routeParams,$controller){$controller('all_comun',{$scope:$scope,$rootScope:$rootScope});$scope.llenaListasVTComun();$scope.$emit("SETTITLE",{TituloPrincipal:'PROYECTOS',TituloSecundario:'Gestión de proyectos/Editar #'+$routeParams.id});$scope.URL_PPAL=URL_PPAL;$scope.$emit("LOAD");$rootScope.EditarProyectoCab=0;$rootScope.EditarProyectoFechas=0;$scope.TraerProyectoCabyCliente($routeParams.id);$scope.TraerProyectoDetalle($routeParams.id);$scope.TraerProyectoDetalleGastosCategoria($routeParams.id);$scope.TraerProyectoDetalleGastos($routeParams.id);$scope.TraerProyectoDocumentos($routeParams.id);$scope.idproyecto=$routeParams.id;$scope.press_btn=false;$scope.showEditCab=function(){$rootScope.EditarProyectoCab=($rootScope.EditarProyectoCab===1?0:1)} $scope.showEditFechas=function(){$rootScope.EditarProyectoFechas=($rootScope.EditarProyectoFechas===1?0:1)} $scope.guardarCabeceraProyecto=function(){var MODELO=angular.copy($scope.modelo);bootbox.confirm({message:"Agregará un registro, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$scope.$emit("LOAD");Manager.postR('proyectos','update',MODELO,$routeParams.id).then(function(d){$scope.press_btn=false;$scope.TraerProyectoCabyCliente($routeParams.id);$rootScope.EditarProyectoCab=0;notyConfig("OK",'success','bottomRight');},function(errResponse){notyConfig("Problema",'danger','bottomRight');$scope.$emit("UNLOAD");$scope.press_btn=false;});}else{$scope.press_btn=false;}}});};$scope.modelo_detalle_proyecto={idproyectodetalle:null,descripcion:null,valor:null,vtestadoproyectodetalle:null,idproyecto:null} $scope.showActualizar=function(item){$scope.modelo_detalle_proyecto=angular.copy(item);} $scope.cancelaDataProyecto=function(){$scope.modelo_detalle_proyecto={idproyectodetalle:null,descripcion:null,valor:null,vtestadoproyectodetalle:null,idproyecto:null}};$scope.addDetalleProyecto=function(){var MODELO=angular.copy($scope.modelo_detalle_proyecto);if(validacontenido(MODELO.idproyectodetalle)){bootbox.confirm({message:"Agregará un registro, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$scope.$emit("LOAD");Manager.postR('proyectodetalle','add',MODELO,$routeParams.id).then(function(d){$scope.press_btn=false;$scope.TraerProyectoCabyCliente($routeParams.id);$scope.TraerProyectoDetalle($routeParams.id);$scope.modelo_detalle_proyecto={idproyectodetalle:null,descripcion:null,valor:null,vtestadoproyectodetalle:null,idproyecto:null} notyConfig("OK",'success','bottomRight');},function(errResponse){notyConfig("Problema",'danger','bottomRight');$scope.$emit("UNLOAD");$scope.press_btn=false;});}else{$scope.press_btn=false;}}});}else{bootbox.confirm({message:"Modificará un registro, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$scope.$emit("LOAD");Manager.postR('proyectodetalle','update',MODELO,MODELO.idproyectodetalle).then(function(d){$scope.press_btn=false;$scope.TraerProyectoCabyCliente($routeParams.id);$scope.TraerProyectoDetalle($routeParams.id);$scope.modelo_detalle_proyecto={idproyectodetalle:null,descripcion:null,valor:null,vtestadoproyectodetalle:null,idproyecto:null} notyConfig("OK",'success','bottomRight');},function(errResponse){notyConfig("Problema",'danger','bottomRight');$scope.$emit("UNLOAD");$scope.press_btn=false;});}else{$scope.press_btn=false;}}});}};$scope.showAddPago=function(itemProyecto){var html='proyectos/edit-pagos.html';var controller='g001_edit_pagos';ModalService.showModal({templateUrl:'app_partials/'+html,controller:controller,inputs:{itemProyecto:itemProyecto},preClose:(modal)=>{modal.element.modal('hide');}}).then(function(modal){modal.element.modal();modal.close.then(function(result){$scope.TraerProyectoCabyCliente($routeParams.id);$scope.TraerProyectoDetalle($routeParams.id);});});};$scope.showAddGasto=function(itemGasto){var html='proyectos/edit-gastos.html';var controller='g001_edit_gastos';ModalService.showModal({templateUrl:'app_partials/'+html,controller:controller,inputs:{itemGasto:itemGasto,idproyecto:$routeParams.id},preClose:(modal)=>{modal.element.modal('hide');}}).then(function(modal){modal.element.modal();modal.close.then(function(result){$scope.TraerProyectoCabyCliente($routeParams.id);$scope.TraerProyectoDetalleGastosCategoria($routeParams.id);$scope.TraerProyectoDetalleGastos($routeParams.id);});});};$scope.showAddPagoGastos=function(itemGasto){var html='proyectos/edit-pagos-gastos.html';var controller='g001_edit_pagos_gastos';ModalService.showModal({templateUrl:'app_partials/'+html,controller:controller,inputs:{itemGasto:itemGasto},preClose:(modal)=>{modal.element.modal('hide');}}).then(function(modal){modal.element.modal();modal.close.then(function(result){$scope.TraerProyectoCabyCliente($routeParams.id);$scope.TraerProyectoDetalleGastosCategoria($routeParams.id);$scope.TraerProyectoDetalleGastos($routeParams.id);});});};}]);})();(function(){'use strict';angular.module('appPrincipal').controller('g001_edit_gastos',['$scope','$rootScope','Manager','close','itemGasto','idproyecto','$controller',function($scope,$rootScope,Manager,close,itemGasto,idproyecto,$controller){$scope.itemGasto=itemGasto;$controller('all_comun',{$scope:$scope,$rootScope:$rootScope});$scope.llenaListasVTComun();$scope.idproyecto=idproyecto;Manager.postR('usuarios','getALLVigentes',{}).then(function(d){$scope.ALL_USUARIOS=d.data;$rootScope.$emit("UNLOAD");},function(errResponse){$rootScope.$emit("UNLOAD");});$scope.close=function(){close(true,200);};$scope.modelo_detalle_proyecto_gasto={idproyectodetgastos:null,vtcategoriagasto:itemGasto.descripcion,vttipogasto:'GASTO',descripciongasto:null,vttipousuario:null,fechagasto:null,valor:null,idproyecto:idproyecto,idoperadorsueldo:null};$scope.cancelaData=function(){$scope.modelo_detalle_proyecto_gasto={idproyectodetgastos:null,vtcategoriagasto:itemGasto.descripcion,vttipogasto:'GASTO',descripciongasto:null,vttipousuario:null,fechagasto:null,valor:null,idproyecto:idproyecto,idoperadorsueldo:null};};$scope.showActualizarGasto=function(item){var itemEdit=angular.copy(item);itemEdit.fechagasto=new Date(itemEdit.fechagasto);$scope.modelo_detalle_proyecto_gasto=itemEdit;};$scope.TraerProyectoDetalleGastos(idproyecto);$scope.addDetalleProyectoGasto=function(){var MODELO=angular.copy($scope.modelo_detalle_proyecto_gasto);if(validacontenido(MODELO.idproyectodetgastos)){bootbox.confirm({message:"Agregará un registro, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$scope.$emit("LOAD");Manager.postR('proyectodetgastos','add',MODELO,idproyecto).then(function(d){$scope.press_btn=false;$scope.TraerProyectoDetalleGastos(idproyecto);$scope.modelo_detalle_proyecto_gasto={idproyectodetgastos:null,vtcategoriagasto:itemGasto.descripcion,vttipogasto:null,descripciongasto:null,fechagasto:null,valor:null,idproyecto:idproyecto,idoperadorsueldo:null};notyConfig("OK",'success','bottomRight');},function(errResponse){notyConfig("Problema",'danger','bottomRight');$scope.$emit("UNLOAD");$scope.press_btn=false;});}else{$scope.press_btn=false;}}});}else{bootbox.confirm({message:"Modificará un registro, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$scope.$emit("LOAD");Manager.postR('proyectodetgastos','update',MODELO,idproyecto).then(function(d){$scope.press_btn=false;$scope.TraerProyectoDetalleGastos(idproyecto);$scope.modelo_detalle_proyecto_gasto={idproyectodetgastos:null,vtcategoriagasto:itemGasto.descripcion,vttipogasto:null,descripciongasto:null,fechagasto:null,valor:null,idproyecto:idproyecto,idoperadorsueldo:null};notyConfig("OK",'success','bottomRight');},function(errResponse){notyConfig("Problema",'danger','bottomRight');$scope.$emit("UNLOAD");$scope.press_btn=false;});}else{$scope.press_btn=false;}}});}};$scope.eliminaGasto=function(item){var MODELO=angular.copy(item);bootbox.confirm({message:"Eliminara un registro, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$scope.$emit("LOAD");Manager.postR('proyectodetgastos','updateestado',MODELO,MODELO.idproyectodetgastos).then(function(d){$scope.press_btn=false;$scope.TraerProyectoDetalleGastos(idproyecto);notyConfig("OK",'success','bottomRight');},function(errResponse){notyConfig("Problema",'danger','bottomRight');$scope.$emit("UNLOAD");$scope.press_btn=false;});}else{$scope.press_btn=false;}}});};}]);})();(function(){'use strict';angular.module('appPrincipal').controller('g001_edit_pagos',['$scope','$rootScope','Manager','close','itemProyecto','$controller',function($scope,$rootScope,Manager,close,itemProyecto,$controller){$scope.itemProyecto=itemProyecto;$controller('all_comun',{$scope:$scope,$rootScope:$rootScope});$scope.close=function(){close(true,200);};$scope.modelo_detalle_proyecto_pago={idproyectodetallepagos:null,valor:null,comentarios:null,fechapago:new Date(),idproyectodetalle:itemProyecto.idproyectodetalle};$scope.showActualizarPago=function(item){var itemEdit=angular.copy(item);itemEdit.fechapago=new Date(itemEdit.fechapago);$scope.modelo_detalle_proyecto_pago=itemEdit;};$scope.cancelaData=function(){$scope.modelo_detalle_proyecto_pago={idproyectodetallepagos:null,valor:null,comentarios:null,fechapago:new Date(),idproyectodetalle:itemProyecto.idproyectodetalle};};$scope.TraerProyectoDetallePagos(itemProyecto.idproyectodetalle);$scope.addDetalleProyectoPago=function(){var MODELO=angular.copy($scope.modelo_detalle_proyecto_pago);if(validacontenido(MODELO.idproyectodetallepagos)){bootbox.confirm({message:"Agregará un registro, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$scope.$emit("LOAD");Manager.postR('proyectodetallepagos','add',MODELO,itemProyecto.idproyectodetalle).then(function(d){$scope.press_btn=false;$scope.TraerProyectoDetallePagos(itemProyecto.idproyectodetalle);$scope.TraerProyectoDetalleId(itemProyecto.idproyectodetalle);$scope.modelo_detalle_proyecto_pago={idproyectodetallepagos:null,valor:null,comentarios:null,idproyectodetalle:itemProyecto.idproyectodetalle};notyConfig("OK",'success','bottomRight');},function(errResponse){notyConfig("Problema",'danger','bottomRight');$scope.$emit("UNLOAD");$scope.press_btn=false;});}else{$scope.press_btn=false;}}});}else{bootbox.confirm({message:"Modificará un registro, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$scope.$emit("LOAD");Manager.postR('proyectodetallepagos','update',MODELO,itemProyecto.idproyectodetalle).then(function(d){$scope.press_btn=false;$scope.TraerProyectoDetallePagos(itemProyecto.idproyectodetalle);$scope.TraerProyectoDetalleId(itemProyecto.idproyectodetalle);$scope.modelo_detalle_proyecto_pago={idproyectodetallepagos:null,valor:null,comentarios:null,idproyectodetalle:itemProyecto.idproyectodetalle};notyConfig("OK",'success','bottomRight');},function(errResponse){notyConfig("Problema",'danger','bottomRight');$scope.$emit("UNLOAD");$scope.press_btn=false;});}else{$scope.press_btn=false;}}});}};$scope.eliminar=function(item){var MODELO=angular.copy(item);bootbox.confirm({message:"Eliminara un registro, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$scope.$emit("LOAD");Manager.postR('proyectodetallepagos','updateestado',MODELO,MODELO.idproyectodetalle).then(function(d){$scope.press_btn=false;$scope.TraerProyectoDetallePagos(itemProyecto.idproyectodetalle);$scope.TraerProyectoDetalleId(itemProyecto.idproyectodetalle);$scope.modelo_detalle_proyecto_pago={idproyectodetallepagos:null,valor:null,comentarios:null,idproyectodetalle:itemProyecto.idproyectodetalle};notyConfig("OK",'success','bottomRight');},function(errResponse){notyConfig("Problema",'danger','bottomRight');$scope.$emit("UNLOAD");$scope.press_btn=false;});}else{$scope.press_btn=false;}}});};}]);})();(function(){'use strict';angular.module('appPrincipal').controller('g001_lista',['$scope','$rootScope','Manager','ModalService','$location','$controller','userService','$interval',function($scope,$rootScope,Manager,ModalService,$location,$controller,userService,$interval){$controller('all_comun',{$scope:$scope});$scope.llenaListasVTComun();$scope.$emit("SETTITLE",{TituloPrincipal:'PROYECTOS',TituloSecundario:'Gestión de proyectos'});$scope.changePagination=function(pagina){$rootScope.pageParam=$rootScope.pageParam+pagina;$scope.LISTA_TABLA_PROYECTOS(0);};$scope.LISTA_TABLA_PROYECTOS=function(modo){$rootScope.$emit("LOAD");if(modo!==0){$rootScope.pageParam=1;} Manager.postR('proyectos','getall',$rootScope.filtroProyectos).then(function(d){$scope.filas=d.data.data;$scope.paginas=d.data.paginas;$rootScope.$emit("UNLOAD");},function(errResponse){$rootScope.$emit("UNLOAD");});};$scope.LISTA_TABLA_PROYECTOS(0);$scope.ordena=function(clave,v){$scope.filtroNegocio.ordenapor=clave;if(v=='ASC'){$scope.filtroNegocio.ordenmodo='DESC';}else{$scope.filtroNegocio.ordenmodo='ASC';} $scope.LISTA_TABLA_PROYECTOS(0);};}]);})();(function(){'use strict';angular.module('appPrincipal').controller('g001_view',['$scope','$rootScope','Manager','ServiceURL','$http','ModalService','$routeParams','$location','userService','$controller',function($scope,$rootScope,Manager,ServiceURL,$http,ModalService,$routeParams,$location,userService,$controller){$controller('all_comun',{$scope:$scope,$rootScope:$rootScope});$scope.llenaListasVTComun();$scope.$emit("SETTITLE",{TituloPrincipal:'PROYECTOS',TituloSecundario:'Gestión de proyectos/Ver'});$scope.modelo={};$scope.modo_panatalla="NEW";$scope.press_btn=false;}]);})();(function(){'use strict';angular.module('appPrincipal').controller('g001_edit_pagos_gastos',['$scope','$rootScope','Manager','close','itemGasto','$controller',function($scope,$rootScope,Manager,close,itemGasto,$controller){$scope.itemGasto=itemGasto;$controller('all_comun',{$scope:$scope,$rootScope:$rootScope});$scope.close=function(){close(true,200);};$scope.modelo_detalle_proyecto_pago_gastos={idproyectodetgastospagos:null,registro:null,valor:null,comentarios:null,idproyectodetgastos:itemGasto.idproyectodetgastos,idoperador:null,estado:null,fechapago:new Date()};$scope.showActualizarPago=function(item){var itemEdit=angular.copy(item);itemEdit.fechapago=new Date(itemEdit.fechapago);$scope.modelo_detalle_proyecto_pago_gastos=itemEdit;};$scope.cancelaData=function(){$scope.modelo_detalle_proyecto_pago_gastos={idproyectodetgastospagos:null,registro:null,valor:null,comentarios:null,idproyectodetgastos:itemGasto.idproyectodetgastos,idoperador:null,estado:null,fechapago:new Date()};};$scope.TraerProyectoDetalleGastosPagos(itemGasto.idproyectodetgastos);$scope.addDetalleGastoPago=function(){var MODELO=angular.copy($scope.modelo_detalle_proyecto_pago_gastos);if(validacontenido(MODELO.idproyectodetgastospagos)){bootbox.confirm({message:"Agregará un registro, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$scope.$emit("LOAD");Manager.postR('proyectodetgastospagos','add',MODELO,itemGasto.idproyectodetgastos).then(function(d){$scope.press_btn=false;$scope.TraerProyectoDetalleGastosPagos(itemGasto.idproyectodetgastos);$scope.TraerProyectoDetalleGastosId(itemGasto.idproyectodetgastos);$scope.modelo_detalle_proyecto_pago_gastos={idproyectodetgastospagos:null,registro:null,valor:null,comentarios:null,idproyectodetgastos:itemGasto.idproyectodetgastos,idoperador:null,estado:null,fechapago:new Date()};notyConfig("OK",'success','bottomRight');},function(errResponse){notyConfig("Problema",'danger','bottomRight');$scope.$emit("UNLOAD");$scope.press_btn=false;});}else{$scope.press_btn=false;}}});}else{bootbox.confirm({message:"Modificará un registro, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$scope.$emit("LOAD");Manager.postR('proyectodetgastospagos','update',MODELO,itemGasto.idproyectodetgastos).then(function(d){$scope.press_btn=false;$scope.TraerProyectoDetalleGastosPagos(itemGasto.idproyectodetgastos);$scope.TraerProyectoDetalleGastosId(itemGasto.idproyectodetgastos);$scope.modelo_detalle_proyecto_pago_gastos={idproyectodetgastospagos:null,registro:null,valor:null,comentarios:null,idproyectodetgastos:itemGasto.idproyectodetgastos,idoperador:null,estado:null,fechapago:new Date()};notyConfig("OK",'success','bottomRight');},function(errResponse){notyConfig("Problema",'danger','bottomRight');$scope.$emit("UNLOAD");$scope.press_btn=false;});}else{$scope.press_btn=false;}}});}};$scope.eliminar=function(item){var MODELO=angular.copy(item);bootbox.confirm({message:"Eliminara un registro, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$scope.$emit("LOAD");Manager.postR('proyectodetgastospagos','updateestado',MODELO,MODELO.idproyectodetgastospagos).then(function(d){$scope.press_btn=false;$scope.TraerProyectoDetalleGastosPagos(itemGasto.idproyectodetgastos);$scope.TraerProyectoDetalleGastosId(itemGasto.idproyectodetgastos);$scope.modelo_detalle_proyecto_pago_gastos={idproyectodetgastospagos:null,registro:null,valor:null,comentarios:null,idproyectodetgastos:itemGasto.idproyectodetgastos,idoperador:null,estado:null,fechapago:new Date()};notyConfig("OK",'success','bottomRight');},function(errResponse){notyConfig("Problema",'danger','bottomRight');$scope.$emit("UNLOAD");$scope.press_btn=false;});}else{$scope.press_btn=false;}}});};}]);})();(function(){'use strict';angular.module('appPrincipal').controller('g002_add',['$scope','Manager','close','$controller',function($scope,Manager,close,$controller){$controller('all_comun',{$scope:$scope});$scope.llenaListasVTComun();$scope.filtro={rut:null,nombre:null};$scope.modo_panatalla="NEW";$scope.modelo={idclientes:null,nombre:null,celular1:null,celular2:null,mail1:null,mail2:null,estado:null,rut:null,comentarios:null,direccionprincipal:null};$scope.close=function(){close(true,200);};$scope.estado_ejecucion=false;$scope.guardar=function(){var MODELO=cloneJson($scope.modelo);bootbox.confirm({message:"Agregará un nuevo usuario, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$scope.$emit("LOAD");$scope.estado_ejecucion=true;Manager.postR('clientes','add',MODELO).then(function(d){$scope.close();notyConfig("OK",'success','bottomRight');},function(errResponse){notyConfig("Problema",'danger','bottomRight');$scope.$emit("UNLOAD");$scope.estado_ejecucion=false;});}}});};}]);})();(function(){'use strict';angular.module('appPrincipal').controller('g002_edit',['$scope','$rootScope','Manager','close','id','$controller',function($scope,$rootScope,Manager,close,id,$controller){$controller('all_comun',{$scope:$scope});$scope.llenaListasVTComun();$scope.modo_panatalla="EDIT";$scope.close=function(){close(true,200);};Manager.postR('clientes','getid',{},id).then(function(d){$scope.modelo=d.data;$rootScope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});$scope.estado_ejecucion=false;$scope.guardar=function(){var MODELO=cloneJson($scope.modelo);bootbox.confirm({message:"Actualizará usuario, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$scope.$emit("LOAD");$scope.estado_ejecucion=true;Manager.postR('clientes','update',MODELO,id).then(function(d){$scope.close(true,200);notyConfig("OK",'success','bottomRight');},function(errResponse){notyConfig("Problema",'danger','bottomRight');$scope.$emit("UNLOAD");$scope.estado_ejecucion=false;});}}});};}]);})(); (function(){'use strict';angular.module('appPrincipal').controller('g002_lista',['$scope','$rootScope','Manager','ModalService','$controller','$location',function($scope,$rootScope,Manager,ModalService,$controller,$location){$controller('all_comun',{$scope:$scope});$scope.llenaListasVTComun();$scope.close=function(){close(true,200);};$scope.$emit("SETTITLE",{TituloPrincipal:'CLIENTES',TituloSecundario:'Mantención de clientes'});$scope.filtro={rut:'',nombre:'',rol_code:null,inactivo:0};$rootScope.pageSizeParam=10;$rootScope.pageParam=1;$scope.changePagination=function(pagina){$rootScope.pageParam=$rootScope.pageParam+pagina;$scope.LISTA_TABLA(0);};$scope.irVerProyectos=function(item){$rootScope.filtroProyectos.rut=item.rut;$location.path('/gestion/proyectos');} $scope.LISTA_TABLA=function(modo){if(modo!==0){$rootScope.pageParam=1;} Manager.postR('clientes','getall',$scope.filtro).then(function(d){$scope.filas=d.data.data;$scope.paginas=d.data.paginas;$scope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});};$scope.LISTA_TABLA();$scope.openEdit=function(id,modo){var html='clientes/add.html';var controller='g002_add';if(modo==='U'){html='clientes/add.html';controller='g002_edit';} ModalService.showModal({templateUrl:'app_partials/'+html,controller:controller,inputs:{id:id},preClose:(modal)=>{modal.element.modal('hide');}}).then(function(modal){modal.element.modal();modal.close.then(function(result){$scope.LISTA_TABLA(0);});});};$scope.Baja=function(item){bootbox.confirm({message:"Esta"+(item.estado!=='V'?' Activando ':' Desactivando ')+"el usuario, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$scope.$emit("LOAD");Manager.postR('clientes','updateestado',item,item.idclientes).then(function(){$scope.LISTA_TABLA();$scope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});}}});};}]);})();(function(){'use strict';angular.module('appPrincipal').controller('g002_view',['$scope','$rootScope','Manager','ServiceURL','$http','ModalService','$routeParams','$location','userService','$controller',function($scope,$rootScope,Manager,ServiceURL,$http,ModalService,$routeParams,$location,userService,$controller){$controller('all_comun',{$scope:$scope,$rootScope:$rootScope});$scope.llenaListasVTComun();$scope.$emit("SETTITLE",{TituloPrincipal:'CLIENTES',TituloSecundario:'Gestión de clientes/Ver'});$scope.modelo={};$scope.modo_panatalla="NEW";$scope.press_btn=false;}]);})();(function(){'use strict';angular.module('appPrincipal').controller('Hverpagos',['$scope','$rootScope','Manager','$controller',function($scope,$rootScope,Manager,$controller){$scope.$emit("SETTITLE",{TituloPrincipal:'VER PAGOS',TituloSecundario:'Detalle de pagos'});$controller('all_comun',{$scope:$scope,$rootScope:$rootScope});$scope.llenaListasVTComun();$scope.filtro1={start:new Date(new Date().getFullYear(),new Date().getMonth(),1),end:new Date()};$scope.informe1=function(){var filtro1=angular.copy($scope.filtro1);filtro1.start=$scope.changedate2(filtro1.start,21);filtro1.end=$scope.changedate2(filtro1.end,21);$scope.proyecto_ver=null;$scope.idoperadorsueldo_ver=null;$scope.filas2=[];$scope.filas3=[] $scope.$emit("LOAD");Manager.postR('proyectossueldos','filtro1',filtro1).then(function(d){$scope.filas1=d.data;$scope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});};$scope.informe1();$scope.proyecto_ver=null;$scope.idoperadorsueldo_ver=null;$scope.informe2=function(usuario){var filtro1=angular.copy($scope.filtro1);filtro1.start=$scope.changedate2(filtro1.start,21);filtro1.end=$scope.changedate2(filtro1.end,21);$scope.proyecto_ver=null;$scope.idoperadorsueldo_ver=usuario;var filtro2={start:filtro1.start,end:filtro1.end,idoperadorsueldo:usuario};$scope.filas3=[] $scope.$emit("LOAD");Manager.postR('proyectossueldos','filtro3',filtro2).then(function(d){$scope.filas2=d.data;$scope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});};$scope.gastos=function(categoria){var filtro1=angular.copy($scope.filtro1);filtro1.start=$scope.changedate2(filtro1.start,21);filtro1.end=$scope.changedate2(filtro1.end,21);$scope.categoria_ver=categoria;$scope.proyecto_ver=null;var filtro2={start:filtro1.start,end:filtro1.end,vtcategoriagasto:categoria};$scope.gastosperiodo=[];$scope.$emit("LOAD");Manager.postR('proyectossueldos','otrosgastos',filtro2).then(function(d){$scope.gastosperiodo=d.data;$scope.totalGasto=_.reduce(d.data,function(memo,num){return memo+num.valor_gasto;},0);$scope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});};$scope.gastos();}]);})(); (function(){'use strict';angular.module('appPrincipal').controller('Hmispagos',['$scope','Manager','ModalService',function($scope,Manager,ModalService){$scope.$emit("SETTITLE",{TituloPrincipal:'MIS PAGOS',TituloSecundario:'Detalle de pagos'});$scope.filtro1={start:new Date(new Date().getFullYear(),new Date().getMonth(),1),end:new Date()};$scope.informe1=function(){var filtro1=angular.copy($scope.filtro1);filtro1.start=$scope.changedate2(filtro1.start,21);filtro1.end=$scope.changedate2(filtro1.end,21);$scope.proyecto_ver=null;$scope.idoperadorsueldo_ver=null;$scope.filas2=[];$scope.filas3=[] $scope.$emit("LOAD");Manager.postR('proyectossueldos','filtro1_2',filtro1).then(function(d){$scope.filas1=d.data;$scope.informe2();$scope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});};$scope.informe1();$scope.idoperadorsueldo_ver=null;$scope.proyecto_ver=null;$scope.informe2=function(){var filtro1=angular.copy($scope.filtro1);filtro1.start=$scope.changedate2(filtro1.start,21);filtro1.end=$scope.changedate2(filtro1.end,21);$scope.proyecto_ver=null;var filtro2={start:filtro1.start,end:filtro1.end,idoperadorsueldo:null};$scope.filas3=[] $scope.$emit("LOAD");Manager.postR('proyectossueldos','filtro3_2',filtro2).then(function(d){$scope.filas2=d.data;$scope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});};}]);})(); (function(){'use strict';angular.module('appPrincipal').controller('Hmispagossimple',['$scope','Manager','ModalService',function($scope,Manager,ModalService){$scope.$emit("SETTITLE",{TituloPrincipal:'MIS PAGOS',TituloSecundario:'Detalle de pagos'});$scope.filtro1={start:new Date(new Date().getFullYear(),new Date().getMonth(),1),end:new Date()};$scope.informe1=function(){var filtro1=angular.copy($scope.filtro1);filtro1.start=$scope.changedate2(filtro1.start,21);filtro1.end=$scope.changedate2(filtro1.end,21);$scope.proyecto_ver=null;$scope.idoperadorsueldo_ver=null;$scope.filas2=[];$scope.filas3=[] $scope.$emit("LOAD");Manager.postR('proyectossueldos','filtro1_2',filtro1).then(function(d){$scope.filas1=d.data;$scope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");});};$scope.informe1();}]);})(); (function(){'use strict';angular.module('appPrincipal').controller('DashboardIni',['$scope','$rootScope','Manager','ModalService',function($scope,$rootScope,Manager,ModalService){$scope.URL_PPAL=URL_PPAL;$scope.hoy=moment().format("MMMM");$scope.f_leidos=0;$scope.listOption=[{v:1,t:'Leidos'},{v:0,t:'No Leidos'}];$scope.$emit("SETTITLE");$scope.refreshLista1=function(){};$scope.refreshLista1();$scope.setFeedbackLeido=function(idfeedback){bootbox.confirm({message:"Marcará como leído el registro, ¿desea continuar?",buttons:{confirm:{label:'Aceptar',className:'btn-primary'},cancel:{label:'Cancelar',className:'btn-default'}},callback:function(result){if(result===true){$scope.$emit("LOAD");$scope.estado_ejecucion=true;Manager.postR('dashboardoperador','updateFeedbackLeido',{},idfeedback).then(function(d){$scope.refreshLista1();$scope.$emit("UNLOAD");},function(errResponse){$scope.$emit("UNLOAD");$scope.estado_ejecucion=false;});}}});};$scope.openEditResponderFeedback=function(item){var html='responderFeed.html';var controller='responderFeed';ModalService.showModal({templateUrl:'app_partials/'+html,controller:controller,inputs:{item:item},preClose:(modal)=>{modal.element.modal('hide');}}).then(function(modal){modal.element.modal();modal.close.then(function(result){$scope.refreshLista1();});});};}]);})();(function(){'use strict';angular.module('appPrincipal').directive('verficacionFlow',['$compile','$timeout',function($compile,$timeout){return{restrict:'E',require:'ngModel',replace:true,scope:{evento:"="},templateUrl:'app_scripts/directivas/verificaciones/verificaciones1.html',controller:['$scope','$rootScope','Manager','$interval','ModalService','accountService',function($scope,$rootScope,Manager,$interval,ModalService,accountService){$scope.USERCONECTADO=$rootScope.USERCONECTADO;$scope.isLogin=function(){$scope.USERCONECTADO=$rootScope.USERCONECTADO;return $rootScope.USERCONECTADO&&$rootScope.USERCONECTADO.data!=undefined;};$scope.salirApp=function(){delete $rootScope.USERCONECTADO;$rootScope.estadoLog=0;accountService.logout();};$scope.cambiarClave=function(){ModalService.showModal({templateUrl:'app_partials/cambiarPassword.html',controller:'ChangeController',preClose:(modal)=>{modal.element.modal('hide');}}).then(function(modal){modal.element.modal();modal.close.then(function(result){});});};}]};}]);})();