import{d as c}from"./chunk-ROXTSU3L.js";import{a as y}from"./chunk-DS23P5M5.js";import{a as A}from"./chunk-KKHKQRC4.js";import{b as i}from"./chunk-NMAI6SSY.js";import{n as s}from"./chunk-IXKDTEH3.js";import{a as b,b as w,c as f,d as M}from"./chunk-ZQPT7Y6M.js";import{c as P}from"./chunk-66FT2LEU.js";import{a as l,b as q}from"./chunk-NUAVJ2U7.js";import{$b as v,Kb as u,Lb as g,Md as I,Sd as L,hc as k,ic as p,nd as C,qc as h,ra as m}from"./chunk-PGS4AHIT.js";L();var o=function(e){return e[e.POS=0]="POS",e[e.Wholesale=1]="Wholesale",e[e.ReceivedBills=2]="ReceivedBills",e[e.IssuedAdvancePayment=3]="IssuedAdvancePayment",e[e.ReceivingAdvancePayment=4]="ReceivingAdvancePayment",e[e.BuyerOrder=5]="BuyerOrder",e[e.SupplierOrder=6]="SupplierOrder",e[e.Documents=7]="Documents",e[e.Orders=8]="Orders",e[e.Goods=9]="Goods",e[e.Transfer=10]="Transfer",e[e.PriceChange=11]="PriceChange",e[e.Inventory=12]="Inventory",e[e.WorkOrder=13]="WorkOrder",e[e.TravelOrder=14]="TravelOrder",e[e.Plan=15]="Plan",e[e.Customs=16]="Customs",e[e.Excise=17]="Excise",e[e.Money=18]="Money",e[e.Wage=19]="Wage",e[e.PayOrder=20]="PayOrder",e[e.CashTransaction=21]="CashTransaction",e[e.Issue=22]="Issue",e[e.Receive=23]="Receive",e[e.Archive=24]="Archive",e[e.AdvancePayment=25]="AdvancePayment",e[e.InventoryExcess=26]="InventoryExcess",e[e.InventoryShortage=27]="InventoryShortage",e}(o||{});M();w();q();var d=class e{static produceDocumentLinkAction(a,r){let n=e.getDocumentLink(r.typeOfDocument,r.documentId);return{action:{id:a.id,label:a.label,type:"paw-link",href:n.href,link:n.link,linkParams:n.qparams?{queryParams:n.qparams}:void 0}}}static getDocumentLink(a,r){switch(a){case i.POS:return{href:`${l.backofficeUrl}CashRegister/Index?acKey=`+r};case i.Wholesale:return{href:`${l.backofficeUrl}Wholesale/Edit?id=`+r};case i.ReceivedBills:return{link:"/material-business/received-bill",qparams:{id:r}};case i.IssuedAdvancePayment:return{link:"/material-business/issued-advance-payment",qparams:{id:r}};case i.ReceivingAdvancePayment:case i.AdvancePayment:return{link:"/material-business/received-advance-payment",qparams:{id:r}};case i.Orders:case i.BuyerOrder:return{link:"/order/order-buyer",qparams:{id:r}};case i.SupplierOrder:return{link:"/order/order-supplier",qparams:{id:r}};case i.Documents:case i.Archive:return{link:"/documentation/documents/documents-form/document-data",qparams:{id:r}};case i.InventoryExcess:return{link:"/material-business/inventory",qparams:{id:r}};case i.InventoryShortage:return{link:"/material-business/inventory",qparams:{id:r}}}return{}}};C();var Q=(()=>{class e{get datagridId(){return this.id?this.id+"-document-links":void 0}get datagridConfigId(){return this.gridConfigId?this.gridConfigId+"-document-links":void 0}constructor(){this.links=[],this.columns=[{id:"ackeyView",label:"DocumentNumber",flex:1,render:{component:P,params:r=>r?d.produceDocumentLinkAction({id:"ackeyLink",label:this.acKey===r.ackey?r.aclnkkeyView:r.ackeyView},{typeOfDocument:r.typeOfDocument,documentId:r.typeOfDocument==o.Documents||r.typeOfDocument==o.Archive?r.anQid:this.acKey===r.ackey?r.aclnkkey:r.ackey}):{action:{id:"ackeyLink",label:"",type:"paw-link"}}}},{id:"typeOfDocument",label:"Status",flex:1,render:{component:A,params:r=>({type:r?c.documentTypeColor(r.typeOfDocument):"no-fill",label:r?c.documentTypeLabel(r.typeOfDocument):void 0})}},{id:"date",label:"Date",flex:1,format:r=>f.dateFromIso(r,b.formatting.datetime.date)}],this.loadInfo=null,this.items=null,this.dataGridSettings={loadData:(r,n,t)=>this.settings.loadData()}}onDataModelChanges(r){r&&!r.isFirstChange()&&r.currentValue!==r.previousValue&&(this.acKey=r.currentValue)}onGridReady(r){this.grid=r}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275cmp=u({type:e,selectors:[["paw-document-links"]],inputs:{settings:"settings",acKey:"acKey",id:"id",gridConfigId:"gridConfigId"},standalone:!1,decls:1,vars:4,consts:[[3,"ready","id","configId","cols","settings"]],template:function(n,t){n&1&&(k(0,"paw-datagrid",0),h("ready",function(S){return t.onGridReady(S)}),p()),n&2&&v("id",t.datagridId)("configId",t.datagridConfigId)("cols",t.columns)("settings",t.dataGridSettings)},dependencies:[s],encapsulation:2})}}return e})();C();var D=(()=>{class e{static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275mod=g({type:e})}static{this.\u0275inj=m({imports:[I,s,y]})}}return e})();export{o as a,d as b,Q as c,D as d};
