import{a as f}from"./chunk-746EIR7X.js";import{a as $}from"./chunk-BTZM7RHX.js";import"./chunk-VRWFN34K.js";import"./chunk-Q4BUITAL.js";import{b as X}from"./chunk-AJTKPNL2.js";import{a as K}from"./chunk-F5MI6XGL.js";import{a as Z}from"./chunk-2JBQM4A4.js";import"./chunk-IXB4YWKF.js";import{b as Y}from"./chunk-XDPS256Z.js";import"./chunk-SMMIHGJB.js";import{d as J}from"./chunk-7PKMSCVL.js";import"./chunk-WL2OYEJL.js";import"./chunk-TJNL4KWR.js";import{a as H}from"./chunk-RVEFR64E.js";import"./chunk-3P6JRLEI.js";import"./chunk-7SSPIKUV.js";import"./chunk-CYVMZNT7.js";import"./chunk-WIGT3F63.js";import{t as Q}from"./chunk-S332DHRQ.js";import"./chunk-5QUMV2KP.js";import"./chunk-EGRHWZRV.js";import{g as S,h as q}from"./chunk-JSG72ZNQ.js";import"./chunk-JAY45DEO.js";import"./chunk-LINAD4CC.js";import"./chunk-UBQPCB4A.js";import"./chunk-RTVR37QC.js";import"./chunk-ZATDFETU.js";import"./chunk-QHAVDXDG.js";import{$ as j,H as B,aa as L,ba as U,ca as V,f as E,g as k,j as N,n as O,o as W,q as x,s as R}from"./chunk-27KSTDMK.js";import"./chunk-NF4G3L36.js";import"./chunk-OC7PGGXC.js";import"./chunk-PSDBNMO6.js";import"./chunk-V4WCDZSD.js";import{p as G}from"./chunk-3WWEFG5Z.js";import"./chunk-ZQPWXQD7.js";import"./chunk-NRBWRRAF.js";import"./chunk-NA4DKUZO.js";import"./chunk-OCLYE42A.js";import"./chunk-7E4GTVCE.js";import{a as z}from"./chunk-HEWBVLHR.js";import"./chunk-N3BL5TXR.js";import"./chunk-RTL4XZI4.js";import"./chunk-QGNMEQRN.js";import"./chunk-F4GTCTBH.js";import"./chunk-WXQVX7WD.js";import"./chunk-OWZ5YAMH.js";import"./chunk-KXX3UDJ3.js";import"./chunk-PDYJ5OYY.js";import{s as I,u as P,z as M}from"./chunk-GQAU5ACB.js";import{Bb as o,Ec as w,Ib as m,Mb as p,Nb as T,Wc as y,hc as n,ic as u,jc as l,k as _,kc as d,kd as A,rc as b,sb as s,tc as C,vc as g,ya as D,yd as h,za as F}from"./chunk-ISMRT7VU.js";import"./chunk-GMHSUEGX.js";import"./chunk-M5TX2NVG.js";var ee=(()=>{class e extends ${constructor(t,i,a,c){super(i,t,a,c)}buildForm(){return this.fb.group({operationDateFrom:this.fb.control(null),operationDateTo:this.fb.control(null)})}patchValue(){return{operationDateFrom:this.data.filters?.filter?.operationDateFrom??null,operationDateTo:this.data.filters?.filter?.operationDateTo??null}}static{this.\u0275fac=function(i){return new(i||e)(o(L),o(x),o(j),o(h))}}static{this.\u0275cmp=m({type:e,selectors:[["tis-acceptance-statistics-filters"]],features:[p],decls:3,vars:3,consts:[[3,"formGroup"],["token","date-to","label","\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430","placeholder","\u0434\u0434.\u043C\u043C.\u0433\u0433\u0433\u0433","formControlName","operationDateFrom",3,"maxDate"],["token","date-from","label","\u0414\u0430\u0442\u0430 \u043E\u043A\u043E\u043D\u0447\u0430\u043D\u0438\u044F","placeholder","\u0434\u0434.\u043C\u043C.\u0433\u0433\u0433\u0433","formControlName","operationDateTo",3,"minDate"]],template:function(i,a){i&1&&(u(0,"form",0),d(1,"wk-date-picker",1)(2,"wk-date-picker",2),l()),i&2&&(n("formGroup",a.filtersForm),s(),n("maxDate",a.filtersForm.value.operationDateTo),s(),n("minDate",a.filtersForm.value.operationDateFrom))},dependencies:[R,N,E,k,W,O,B],styles:[`[_nghost-%COMP%]{display:block;width:100%}
/*# sourceMappingURL=acceptance-statistics-filters.component-GCNIU32V.css.map */`],changeDetection:0})}}return e})();var te=[{dataField:"date",caption:"\u0414\u0430\u0442\u0430",minWidth:100,calculateCellValue:e=>Q(new Date(e.date),"dd.MM.yyyy")},{dataField:"count",caption:"\u041A\u043E\u043B-\u0432\u043E \u043F\u0440\u0438\u0435\u043C\u043E\u043A",minWidth:100},{dataField:"totalPaid",caption:"\u041E\u043F\u043B\u0430\u0447\u0435\u043D\u043E, \u20B8",minWidth:100,numericPrecision:2,alignment:"right"},{dataField:"totalLeftToPay",caption:"\u041E\u0441\u0442\u0430\u043B\u043E\u0441\u044C \u043E\u043F\u043B\u0430\u0442\u0438\u0442\u044C, \u20B8",minWidth:100,numericPrecision:2,alignment:"right"},{dataField:"totalPurchaseCost",caption:"\u0421\u0443\u043C\u043C\u0430 \u043F\u043E \u0437\u0430\u043A\u0443\u043F\u043E\u0447\u043D\u043E\u0439, \u20B8",minWidth:100,numericPrecision:2,alignment:"right"},{dataField:"totalSellCost",caption:"\u0421\u0443\u043C\u043C\u0430 \u043F\u043E \u043F\u0440\u043E\u0434\u0430\u0436\u043D\u043E\u0439, \u20B8",minWidth:100,numericPrecision:2,alignment:"right"},{dataField:"margin",caption:"\u041C\u0430\u0440\u0436\u0430, \u20B8",minWidth:100,numericPrecision:2,alignment:"right",calculateCellValue:e=>e.totalSellCost-e.totalPurchaseCost}];function ne(e,r){if(e&1){let t=b();u(0,"wk-dropdown",4),C("changed",function(a){D(t);let c=g();return F(c.changedWarehouse(a,{router:c.router,route:c.route}))}),l()}if(e&2){let t=g();n("options",t.warehouseOptions)("value",t.warehouseId)("showClearButton",!1)}}var v=class e extends X{get warehouseOptions(){return this._warehouseService.warehouseOptions}get criteria(){return{filter:this._toFilterModel(this.filters)}}get filterData(){return{filters:{filter:this.filters}}}constructor(r,t,i,a,c,ie,oe){super(ie,oe),this._warehouseService=r,this._acceptanceStatisticService=t,this._amplitudeService=i,this.router=a,this.route=c,this.filterComponent=ee,this.columns=te}ngOnInit(){super.ngOnInit(),this._initQueryParamsSub(),this._amplitudeService.track("openAcceptanceStatistics","\u0410\u043D\u0430\u043B\u0438\u0442\u0438\u043A\u0430","\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043A\u0430 \u043F\u043E \u043F\u0440\u0438\u0435\u043C\u043A\u0430\u043C")}getLoadMethod(r){return this._acceptanceStatisticService.getAcceptanceStatistic(r,this.warehouseId)}_toFilterModel(r){return r?{operationDateFrom:S(r.operationDateFrom),operationDateTo:S(q(r.operationDateTo))}:null}_initQueryParamsSub(){this.route.queryParams.pipe(M(this.destroyRef)).subscribe(r=>{this.changedWarehouse(r.warehouseId??this.mainWarehouseId)})}static{this.\u0275fac=function(t){return new(t||e)(o(Z),o(f),o(Y),o(P),o(I),o(h),o(U))}}static{this.\u0275cmp=m({type:e,selectors:[["tis-acceptance-statistics"]],features:[y([f]),p],decls:6,vars:14,consts:[["table",""],["customToolbarTmpl",""],["title","\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043A\u0430 \u043F\u043E \u043F\u0440\u0438\u0435\u043C\u043A\u0430\u043C",1,"header",3,"showBackButton"],["searchPlaceholder","\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u043D\u043E\u043C\u0435\u0440\u0443",3,"clickedFilters","allowColumnResizing","enableTotalCount","customToolbarTemplate","data","enableToolbar","enableFilters","columns","enablePagination","enableSearch","enableSpinner","pageNavigation","hoverable","activeFilters"],["placeholder","\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043A\u0430\u0441\u0441\u0443",1,"dropdown",3,"changed","options","value","showClearButton"]],template:function(t,i){if(t&1&&(d(0,"tis-subheader",2),u(1,"tis-main-layout")(2,"tis-table",3,0),C("clickedFilters",function(){return i.openFilters()}),l()(),T(4,ne,1,3,"ng-template",null,1,A)),t&2){let a=w(5);n("showBackButton",!1),s(2),n("allowColumnResizing",!0)("enableTotalCount",!0)("customToolbarTemplate",a)("data",i.dataSource)("enableToolbar",!0)("enableFilters",!0)("columns",i.columns)("enablePagination",!0)("enableSearch",!1)("enableSpinner",!0)("pageNavigation",!0)("hoverable",!0)("activeFilters",!!i.filters)}},dependencies:[H,K,J,V],styles:[`[_nghost-%COMP%]{display:flex;flex-direction:column;min-height:100%}.header[_ngcontent-%COMP%]{top:0;position:sticky;z-index:10}.dropdown[_ngcontent-%COMP%]{margin-bottom:0;width:290px}
/*# sourceMappingURL=acceptance-statistics.component-JOHG5YYM.css.map */`],changeDetection:0})}};_([z(G.mainWarehouseId)],v.prototype,"mainWarehouseId",void 0);export{v as AcceptanceStatisticsComponent};
//# sourceMappingURL=acceptance-statistics.component-UHIKDAR2.js.map
