import{a as S,b as d}from"./chunk-KRKJKNWH.js";import{a}from"./chunk-UQV4G4ZN.js";import{a as f}from"./chunk-F6HNVCUM.js";import{d as m}from"./chunk-JTYOM5WI.js";import{a as h}from"./chunk-MKXPJTAW.js";import{K as i,da as o,ja as c}from"./chunk-QMYHTLAJ.js";import{d as p,n as y}from"./chunk-HE7HQ6LI.js";var l=function(r){return r[r.NoReturn=0]="NoReturn",r[r.Full=1]="Full",r[r.Partial=2]="Partial",r}(l||{});y();var u=class r{constructor(t,e,n){this._sellDocumentsServiceApi=t,this._paymentServiceApi=e,this._localization=n,this._defaultFilter={criteria:null,take:10,skip:0,orderBy:"id"}}getAll(t){return this._sellDocumentsServiceApi.getAll(t??this._defaultFilter).pipe(i(1))}getById(t){return this._sellDocumentsServiceApi.getById(t).pipe(i(1))}fiscalizeById(t){return this._sellDocumentsServiceApi.fiscalizeById(t).pipe(i(1))}externalFiscalize(t){return this._sellDocumentsServiceApi.externalFiscalize(t).pipe(i(1))}getPaymentMethods(t){return this._paymentServiceApi.getPaymentMethodsWithArchive(t).pipe(i(1))}getReturnTypeName(t){switch(t){case l.NoReturn:return this._localization.getSync("\u041D\u0435\u0442");case l.Full:return this._localization.getSync("\u041F\u043E\u043B\u043D\u044B\u0439");case l.Partial:return this._localization.getSync("\u0427\u0430\u0441\u0442\u0438\u0447\u043D\u044B\u0439");default:return""}}getPaymentTypeName(t,e){if(!t?.length)return null;let n=t.includes(1),s=t.includes(2);switch(!0){case(n&&s&&e!=null||s&&e!=null):return this._localization.getSync("\u0421\u043C\u0435\u0448\u0430\u043D\u043D\u044B\u0439 (\u0414\u043E\u043B\u0433)");case(n&&e!=null):return this._localization.getSync("\u041D\u0430\u043B\u0438\u0447\u043D\u044B\u0439 (\u0414\u043E\u043B\u0433)");case(n&&s):return this._localization.getSync("\u0421\u043C\u0435\u0448\u0430\u043D\u043D\u044B\u0439");case n:return this._localization.getSync("\u041D\u0430\u043B\u0438\u0447\u043D\u044B\u0439");case s:return this._localization.getSync("\u0411\u0435\u0437\u043D\u0430\u043B\u0438\u0447\u043D\u044B\u0439");default:return null}}getPriceNameById(t){return t===null?this._localization.getSync("\u041E\u0441\u043D\u043E\u0432\u043D\u0430\u044F"):this.prices.find(e=>e.id===t)?.name??this._localization.getSync("\u041E\u0441\u043D\u043E\u0432\u043D\u0430\u044F")}syncSellDocument(t,e=!1){return this._sellDocumentsServiceApi.syncSellDocument(t,e).pipe(i(1))}delete(t,e=!1){return this._sellDocumentsServiceApi.delete(t,e).pipe(i(1))}lastSellDocument(t,e=!1){return this._sellDocumentsServiceApi.delete(t,e).pipe(i(1))}getLastSellDocument(){let t={criteria:null,take:1,skip:0,orderBy:"operationDate"};return this._sellDocumentsServiceApi.getAll(t).pipe(i(1))}static{this.\u0275fac=function(e){return new(e||r)(c(S),c(a),c(m))}}static{this.\u0275prov=o({token:r,factory:r.\u0275fac})}};p([h(f.prices)],u.prototype,"prices",void 0);var M=(()=>{class r{constructor(e,n){this._returnDocumentsServiceApi=e,this._paymentServiceApi=n,this._defaultFilter={criteria:null,take:10,skip:0,orderBy:"id"}}getAll(e){return this._returnDocumentsServiceApi.getAll(e??this._defaultFilter).pipe(i(1))}getById(e){return this._returnDocumentsServiceApi.getById(e).pipe(i(1))}fiscalizeById(e){return this._returnDocumentsServiceApi.fiscalizeById(e).pipe(i(1))}getPaymentMethodById(e){return this._paymentServiceApi.getPaymentMethodById(e).pipe(i(1))}externalFiscalize(e){return this._returnDocumentsServiceApi.externalFiscalize(e).pipe(i(1))}syncReturnSellDocument(e,n=!1){return this._returnDocumentsServiceApi.syncReturnSellDocument(e,n).pipe(i(1))}delete(e,n=!1){return this._returnDocumentsServiceApi.delete(e,n).pipe(i(1))}static{this.\u0275fac=function(n){return new(n||r)(c(d),c(a))}}static{this.\u0275prov=o({token:r,factory:r.\u0275fac})}}return r})();export{l as a,u as b,M as c};
