import{b as e}from"./chunk-NMAI6SSY.js";import{a as t,b as v}from"./chunk-NUAVJ2U7.js";import{c as y,d as l}from"./chunk-PBM4LEG7.js";var p=function(a){return a.NotSerial="N",a}(p||{}),s=function(a){return a.K="K",a}(s||{}),i=function(a){return a.Move="M",a.Receive="P",a.Order="O",a}(i||{});v();l();var d=class{static documentTypeLabel(n){switch(n){case e.POS:case e.Wholesale:case e.ReceivedBills:return"ConnectionTypeTrafic";case e.IssuedAdvancePayment:case e.ReceivingAdvancePayment:case e.AdvancePayment:return"ConnectionTypeAdvPay";case e.BuyerOrder:case e.SupplierOrder:case e.Orders:return"ConnectionTypeOrder";case e.Documents:case e.Archive:return"ConnectionTypeDocument";case e.InventoryExcess:return"ConnectionTypeExcess";case e.InventoryShortage:return"ConnectionTypeShortage"}return""}static documentTypeColor(n){switch(n){case e.POS:case e.Wholesale:case e.ReceivedBills:return"yellow";case e.IssuedAdvancePayment:case e.ReceivingAdvancePayment:case e.AdvancePayment:return"orange";case e.BuyerOrder:case e.SupplierOrder:case e.Orders:return"red";case e.Documents:case e.Archive:return"green";case e.InventoryExcess:return"cyan";case e.InventoryShortage:return"dark-pink"}return"no-fill"}static documentTypeLink(n,r){switch(n){case e.POS:return`${t.backofficeUrl}CashRegister/Index?acKey=`+r;case e.Wholesale:return`${t.backofficeUrl}Wholesale/Edit?id=`+r;case e.ReceivedBills:return`${t.backofficeUrl}ReceivedBills/Edit?id=`+r;case e.IssuedAdvancePayment:return`${t.backofficeUrl}AdvancePayment/EditIssuedAdvancePayment?id=`+r;case e.ReceivingAdvancePayment:case e.AdvancePayment:return`${t.backofficeUrl}AdvancePayment/EditReceivingAdvancePayment?id=`+r;case e.Orders:case e.BuyerOrder:return`${t.backofficeUrl}Order/EditBuyerOrder?id=`+r;case e.SupplierOrder:return`${t.backofficeUrl}Order/EditSupplierOrder?id=`+r;case e.Documents:case e.Archive:return`${t.backofficeUrl}Documents/Edit?qId=`+r;case e.InventoryExcess:return`${t.backofficeUrl}Inventory/ExcessOrMissing?inventoryType=E&id=`+r;case e.InventoryShortage:return`${t.backofficeUrl}Inventory/ExcessOrMissing?inventoryType=S&id=`+r}return""}static checkForZeros(n,r,c,o){(n.quantity===0||n[r]===0)&&c.openTyped({type:"error",text:o.instant("InoicePositionQuantityOrPrice0Warning",{0:n.anNo+" - "+n.name}),confirmButtonLabel:"Ok",denyButtonLabel:null})}static openSerialNumbersDialog(n,r,c,o,u=()=>{}){!c||r.serialNo==="N"||r.serialNo===""||(o?n.serialNumbersAutoEdition({acKey:r.acKey,docType:c.docType,date:c.invoiceDate??new Date,anNo:r.anNo,ident:r.ident,issuer:c.issuerId||"",receiver:c.receiverId||"",quantityOld:0,quantityNew:r.quantity,type:s.K,invoiceType:i.Move},r,u):n.isDialogOpen()||n.openDialog(r,c.receiverId||"",s.K,i.Move,!1,c.date??new Date,c.issuerId,!0,null,u))}static getIdentRabate(n,r,c){return n>0?n:r>0?r:c}static displayUpdateErrors(n,r){r&&r&&y.isSet(r.error)&&r.error!==""&&n.openTyped({type:"error",text:r.error??"GeneralError",confirmButtonLabel:"Ok",denyButtonLabel:null})}};export{p as a,s as b,i as c,d};
