import{c as p}from"./chunk-NMAI6SSY.js";import{a as m}from"./chunk-CVN2SFTO.js";import{s as u}from"./chunk-S6D4NUPV.js";import{s as i,t as v,w as d,x as C}from"./chunk-GTAUKNDY.js";import{A as n,a as c,la as I,nd as O,qa as s,va as l}from"./chunk-PGS4AHIT.js";var k=function(e){return e.POS="POS",e.Wholesale="Wholesale",e.ReceivedBills="ReceivedBills",e.OrderBuyer="OrderBuyer",e}(k||{}),o=function(e){return e.Wholesale="I",e.ReceivedBills="P",e}(o||{}),B=function(e){return e.Wholesale="PrometIzd",e.POS="PrometPOS",e.ReceivedBills="PrometPre",e.SupplierBuyerOrders="NarocKup",e.Inventory="PrometInventura",e.ReceivingAdvancePayment="PrometDaniAvansi",e.IssuingAdvancePayment="PrometIzdaniAvansi",e.POSAndWholesale="POSAndWholesale",e.TradeRecords="TradeRecords",e.OrdersBuyer="OrdersBuyer",e.OrdersSupplier="OrdersSupplier",e.PriceChange="PriceChange",e}(B||{});v();I();O();C();var N=(()=>{class e extends m{constructor(r){super(),this.apiService=r}fetchNeighour(r,t,a=!0){return this.apiService.get(i.move[a?"getPreviousNeighbour":"getNextNeighbour"](r,t))}fetch(r){return this.apiService.get(i.move.fetch(r))}saveInvoice(r){return r?this.apiService.put(i.move.putInvoice,c({},r)):n()}fetchDocumentLinks(r){return this.apiService.get(i.move.getDocumentLinks(r))}fetchDocTypeData(r){return this.apiService.get(i.move.docTypeData(r))}fiscalizeInvoice(r,t,a=null){return this.apiService.post(i.move.fiscalize(r,t,a))}deleteInvoice(r){return this.apiService.delete(i.move.delete(r))}checkClosedVatPeriod(r){return this.apiService.post(i.move.checkClosedVatPeriod,{date:r})}recalculateInvoiceItems(r){return this.apiService.post(i.move.recalculateInvoiceItems,r)}getAdvancePayments(r,t,a,h,S){let g={acKey:t,docType:a,date:h,subject:S,vat:"",type:"O",invoiceType:r===p.Wholesale?o.Wholesale:o.ReceivedBills};return this.apiService.post(i.move.getAdvancePaymentLinks,g)}workPlaceInitialTodayExist(r){return this.apiService.get(i.fiscalWorkPlace.workPlaceInitialTodayExist(r))}static{this.\u0275fac=function(t){return new(t||e)(l(d))}}static{this.\u0275prov=s({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();v();var f=class{static produceVatCodeField(P,r){return{id:"vatCode",searchable:!0,lazyLoad:!0,component:u,feature:r,apiRequest:t=>P.get(i.general.vatCodeLookup(t)),valueMapper:t=>t.vatCode,labelMapper:t=>`${t.vatCode} - ${t.vat}%`,modelToOptionMapper:(t,a)=>({vatCode:a.vatCode,vat:a.vat}),modelValueSetter:(t,a)=>(a.vat=t?.vat??0,console.log("MODEL",a.vat,t),t?.vatCode)}}};export{k as a,o as b,B as c,N as d,f as e};
