1import{b as K}from"./chunk-GVD4XTA2.js";import{a as J}from"./chunk-7LX45KZB.js";import"./chunk-FNYKUOS6.js";import{a as W}from"./chunk-3IOADHME.js";import{a as X,b as H}from"./chunk-WWWTI5XN.js";import{c as z}from"./chunk-EYRMDCSK.js";import{b as V}from"./chunk-IZTI2ZOZ.js";import"./chunk-VQIYVJ43.js";import{a as y,b as P,h as Z}from"./chunk-5AQOYHGN.js";import"./chunk-LAZ5R3DN.js";import{G as Q,m as E,n as $,r as q,t as Y}from"./chunk-524UNHJE.js";import{g as C,m as B,o as R,s as O,y as j}from"./chunk-OTEZQ6U4.js";import{h as A,i as T}from"./chunk-NCK6B3WI.js";import{A as _,K as N,L as w,R as M,U as G,V as L,ba as D,da as U,ea as x,y as g}from"./chunk-KT3ZGGMK.js";import"./chunk-F2X3VGZZ.js";import"./chunk-H5J3NFNR.js";import{a as F}from"./chunk-3E6XKCOQ.js";import{a as k}from"./chunk-DV4LIFKY.js";import{b as I}from"./chunk-TOVONXPW.js";import"./chunk-USN7SMJM.js";import"./chunk-VVJCBLHC.js";import{I as h,Kb as n,Lb as s,Mb as c,Q as b,Ub as d,Ya as a,bb as l,f as v,gc as u,mb as S,zb as i}from"./chunk-ZLK5JD3D.js";import"./chunk-PHUH23IY.js";var ee=class f{constructor(e,r,t,p,m,o){this.fb=e;this.serv=r;this.commonService=t;this.authService=p;this.utilService=m;this.blockUIService=o}filterForm;currentUser;isLoading=!1;cboLocation=[];cboWarehouse=[];data=[];cols;destroy$=new v;ngOnInit(){this.authService.getUserLocalStorage()&&(this.currentUser=JSON.parse(this.authService.getUserLocalStorage())),this._GetWarehouseBy(),this.builForm(),this.buildCols(),this.serv.cboLocation$.pipe(b(this.destroy$)).subscribe(e=>{e&&e.length>0&&(e.unshift({i_ParameterId:-1,v_Description:"--Todos--"}),this.cboLocation=e)})}GetWarehouseStockProductGeneral(){if(this.filterForm.value.i_WarehouseId===0){this.commonService.HanddleWarningMessage({message:"Seleccione un Almac\xE9n"});return}this.isLoading=!0,this.blockUIService.bloquear(),this.serv.GetWarehouseStockProductGeneral(this.filterForm.getRawValue()).pipe(h(()=>{this.isLoading=!1,this.blockUIService.desbloquear()})).subscribe(e=>{e&&e.data&&(this.data=e.data)})}exportarExcel(){let e=new Date,t=`Reporte General AAP - ${`${e.getDate().toString().padStart(2,"0")}${(e.getMonth()+1).toString().padStart(2,"0")}${e.getFullYear()}${e.getHours().toString().padStart(2,"0")}${e.getMinutes().toString().padStart(2,"0")}${e.getSeconds().toString().padStart(2,"0")}`}`,p={columnas:["v_Product","v_Plate","v_PlateOld","v_ProcessName","i_CurrentQuantity","v_Shelf","i_PositionX","v_PositionY","v_OwnerCompleteName"],header:["Producto","Placa Nueva","Placa Antigua","Tr\xE1mite","Cantidad","Anaquel","Fila","Columna","Solicitante"],columnWidths:[50,25,25,40,20,25,20,20,25],excelFileName:t,headerBgColor:"#156185",textAlign:["left","center","left","center","center","center","center","center","center"]},m=[];this.data&&(this.data.map(o=>{m.push({v_Product:o.v_Product,v_Plate:o.v_Plate,v_PlateOld:o.v_PlateOld,v_ProcessName:o.v_ProcessName,i_CurrentQuantity:o.i_CurrentQuantity,v_Shelf:o.v_Shelf,i_PositionX:o.i_PositionX,v_PositionY:o.v_PositionY,v_OwnerCompleteName:o.v_OwnerCompleteName})}),this.utilService.exportReport(m,p))}_GetWarehouseBy(){let e={i_WarehouseId:0,v_Description:"",i_LocationId:this.currentUser.i_LocationId,i_WarehouseTypeUseId:-1};this.serv.GetWarehouseBy(e).subscribe(r=>{let t={i_WarehouseId:0,v_Description:"--Seleccione--"};r&&(this.cboWarehouse=r,this.cboWarehouse.unshift(t))})}builForm(){this.filterForm=this.fb.nonNullable.group({i_LocationId:this.fb.nonNullable.control({value:this.currentUser.i_LocationId,disabled:!0}),i_WarehouseId:this.fb.nonNullable.control(0)})}buildCols(){this.cols=[{field:"v_Product",header:"Producto",type:"text",align:"center"},{field:"v_Plate",header:"Placa Nueva",type:"text"},{field:"v_PlateOld",header:"Placa Antigua",type:"text"},{field:"v_ProcessName",header:"Tr\xE1mite",type:"text"},{field:"i_CurrentQuantity",header:"Cantidad",type:"number",align:"center"},{field:"v_Shelf",header:"Anaquel",type:"text",align:"center"},{field:"i_PositionX",header:"Fila",type:"text",align:"center"},{field:"v_PositionY",header:"Columna",type:"text",align:"center"},{field:"v_OwnerCompleteName",header:"Solicitante",type:"text",align:"center"}]}static \u0275fac=function(r){return new(r||f)(l(D),l(J),l(I),l(F),l(W),l(k))};static \u0275cmp=S({type:f,selectors:[["app-product-stock-general-report"]],decls:19,vars:11,consts:[["key","tst",3,"baseZIndex"],["header","Filtros de B\xFAsqueda","styleClass","mb-3",3,"toggleable"],[1,"",3,"formGroup"],[1,"mt-3","grid","grid-cols-2","gap-4"],[1,"flex","flex-row","items-center","w-full"],["variant","on",1,"w-full"],["formControlName","i_LocationId","optionValue","i_LocationId","optionLabel","v_Description",3,"options"],[1,"text-sm","font-medium","text-gray-700"],["formControlName","i_WarehouseId","optionValue","i_WarehouseId","optionLabel","v_Description",3,"options"],[1,"flex","flex-row","justify-end","mt-3"],["pButton","","type","button","label","Buscar","icon","pi pi-search",1,"p-button-primary","mr-2",3,"click","loading"],["pButton","","type","button","label","Exportar","icon","pi pi-file-excel",1,"p-button-secondary",3,"click","disabled"],["header","Resultados de la B\xFAsqueda","styleClass","mb-3"],[3,"cols","data","totalRecords","showPaginator"]],template:function(r,t){r&1&&(c(0,"p-toast",0),n(1,"p-panel",1)(2,"form",2)(3,"div",3)(4,"div",4)(5,"p-floatlabel",5),c(6,"p-dropdown",6),n(7,"label",7),u(8,"Punto de Entrega:"),s()()(),n(9,"div",4)(10,"p-floatlabel",5),c(11,"p-dropdown",8),n(12,"label",7),u(13,"Almac\xE9n:"),s()()()(),n(14,"div",9)(15,"button",10),d("click",function(){return t.GetWarehouseStockProductGeneral()}),s(),n(16,"button",11),d("click",function(){return t.exportarExcel()}),s()()()(),n(17,"p-panel",12),c(18,"app-table",13),s()),r&2&&(i("baseZIndex",99999),a(),i("toggleable",!0),a(),i("formGroup",t.filterForm),a(4),i("options",t.cboLocation),a(5),i("options",t.cboWarehouse),a(4),i("loading",t.isLoading),a(),i("disabled",t.data&&t.data.length===0),a(2),i("cols",t.cols)("data",t.data)("totalRecords",t.data&&t.data.length)("showPaginator",!1))},dependencies:[U,M,N,w,x,G,L,T,A,P,y,O,R,Q,Y,j,_,g,V,z,$,E,q,Z,H,X,B,C,K],styles:["[_nghost-%COMP%]{display:block} .p-dropdown{width:100%!important} .p-datepicker{width:100%!important} .p-panel-header{background-color:#b1c2f0}"]})};export{ee as ProductStockGeneralReportComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.