import{a as e}from"./chunk-26D5YGBB.js";import{a as p,b as u,c as o}from"./chunk-XZQN4CJB.js";import{f as l}from"./chunk-Z7UPUZED.js";import{s as i,t as x}from"./chunk-DYEAP73Z.js";import{c,d as f}from"./chunk-I6HXBYFU.js";x();f();var S=class{static statusColor(r){switch(r){case"P":return"paw-status-success";case"R":return"neutral";case"N":return"paw-status-warning"}return""}static statusTagColor(r){switch(r){case"P":return"green";case"R":return"neutral";case"N":return"warning"}return""}static statusHeaderColor(r){switch(r){case"P":return"paw-status-success";case"R":return"paw-status-neutral";case"N":return"paw-status-warning"}return""}static statusIcon(r){switch(r){case"P":return"far fa-check";case"N":return"far fa-hourglass-half";default:return""}}static wayOfSaleText(r){switch(r){case e.FinalBuyer:return"FinalBuyer";case e.IsTaxComitted:return"IsTaxCommitedShort";case e.ExportSale:return"ExportSale";case e.ExportSaleEU:return"ExportSaleEU";case e.DomesticTaxpayers:return"DomesticTaxpayers";case e.Flatrate:return"Flatrate";case e.OtherNotTaxComitted:return"";case e.R1:return"WayOfSaleBuyerR1";case e.R2:return"WayOfSaleR2";case e.RS:return"SerbianRepublic";case e.BiH:return"FederationBiH";case e.BrckoDistrictBiH:return"BrckoDistrictBiH";case e.Import:return"Import";case e.ImportEU:return"ImportEU";case e.Nonresident:return"Nonresident";case e.DiplomaticConsulate:return"WayOfSaleDiplomaticConsulate";case e.Other:return"Other";default:return""}}static wayOfSaleColor(r){switch(r){case e.FinalBuyer:return"green";case e.IsTaxComitted:return"turquoise";case e.ExportSale:return"cyan";case e.ExportSaleEU:return"pink";case e.DomesticTaxpayers:return"orange";case e.Flatrate:return"yellow";case e.OtherNotTaxComitted:return"";case e.R1:return"green";case e.R2:return"yellow";case e.RS:return"pink";case e.BiH:return"blue";case e.BrckoDistrictBiH:return"purple";case e.Import:return"dark-pink";case e.ImportEU:return"pink";case e.Nonresident:return"red";case e.DiplomaticConsulate:return"purple";case e.Other:return"no-fill";default:return""}}static stringFormat(r,a,t,n){if(a){let s=new RegExp("\\{0\\}","gm");r=r.replace(s,a)}if(t){let s=new RegExp("\\{1\\}","gm");r=r.replace(s,t)}if(n){let s=new RegExp("\\{2\\}","gm");r=r.replace(s,n)}return r}static getStartDate(r,a){let t=new Date;return r===l.DateDoc1&&a.orderDate?t=a.orderDate:r===l.DateDoc2&&a.orderFormDate?t=a.orderFormDate:r===l.Date&&a.date?t=a.date:r===l.TaxDate&&a.dateVAT?t=a.dateVAT:a.invoiceDate&&(t=a.invoiceDate),t}static stripTime(r){return new Date(r.getFullYear(),r.getMonth(),r.getDate())}static isSameDay(r,a){return!r||!a?!1:(r=r instanceof Date?r:new Date(r),this.stripTime(r).getTime()===this.stripTime(a).getTime())}static getWayOfSales(r){switch(r){case i.BA:return[{value:e.IsTaxComitted,label:"IsTaxCommited"},{value:e.ExportSale,label:"ExportSale"},{value:e.BiH,label:"FederationBiH"},{value:e.RS,label:"SerbianRepublic"},{value:e.BrckoDistrictBiH,label:"BrckoDistrictBiH"}];case i.ME:return[{value:e.IsTaxComitted,label:"SubjTaxPayer"},{value:e.FinalBuyer,label:"FinalBuyer"},{value:e.ExportSale,label:"ExportSale"}];case i.RS:case i.MK:return[{value:e.IsTaxComitted,label:"IsTaxCommitedShort"},{value:e.ExportSale,label:"ExportSale"},{value:e.FinalBuyer,label:"FinalBuyer"},{value:e.DiplomaticConsulate,label:"WayOfSaleDiplomaticConsulate"}];case i.HR:return[{value:e.IsTaxComitted,label:"WayOfSaleBuyerR1"},{value:e.ExportSale,label:"ExportSale"},{value:e.ExportSaleEU,label:"ExportSaleEU"},{value:e.FinalBuyer,label:"FinalBuyer"},{value:e.Nonresident,label:"TaxExempt"},{value:e.Other,label:"Other"}];default:return[{value:e.IsTaxComitted,label:"IsTaxCommitedShort"},{value:e.FinalBuyer,label:"FinalBuyer"},{value:e.ExportSale,label:"ExportSale"},{value:e.ExportSaleEU,label:"ExportSaleEU"}]}}static openSerialNumbersDialog(r,a,t,n,s=()=>{}){!t||a.serialNo===""||a.serialNo===p.NotSerial||(t?.autoInvoSerialNo?r.serialNumbersAutoEdition({acKey:t.acKey,docType:t.docType,anNo:a.anNo,issuer:t.issuerId,ident:a.ident,quantityOld:n??0,quantityNew:a.quantity,type:u.K,receiver:t.receiverId,invoiceType:o.Move,date:t.invoiceDate??new Date},a,s):r.openDialog(a,t?.receiverId,u.K,o.Move,!1,t?.invoiceDate??new Date,t?.issuerId,a.quantity>=0,null,s))}static displayItemErrors(r,a){a&&a&&c.isSet(a.error)&&a.error!==""&&r.openTyped({type:"error",text:a.error??"GeneralError",confirmButtonLabel:"Ok",denyButtonLabel:null})}};export{S as a};
