import{a as v}from"./chunk-M2HQ3MOJ.js";import{a as ae}from"./chunk-TUS2BK6M.js";import"./chunk-XVBMDTR7.js";import"./chunk-W53ZFLVQ.js";import"./chunk-H4ROT3RX.js";import"./chunk-VKGUPMBV.js";import{a as ie}from"./chunk-TAJTF3SG.js";import"./chunk-3EB7XXGJ.js";import{c as oe}from"./chunk-PAFQ4MHK.js";import{a as te}from"./chunk-WJQYXGPC.js";import{a as $}from"./chunk-P7KQ7LX4.js";import"./chunk-EGRHWZRV.js";import{a as re}from"./chunk-VBM2RR4H.js";import"./chunk-5Y7OCYBP.js";import{b as X}from"./chunk-7RA22N3I.js";import"./chunk-V7623CLP.js";import"./chunk-7SSPIKUV.js";import"./chunk-NF4G3L36.js";import"./chunk-CYVMZNT7.js";import"./chunk-WIGT3F63.js";import{a as ee}from"./chunk-QYMDN3S2.js";import"./chunk-Z6SX4HYB.js";import{t as K}from"./chunk-E65EA4Y7.js";import{c as y,d as Z}from"./chunk-SMAIR2YP.js";import"./chunk-JAY45DEO.js";import"./chunk-LINAD4CC.js";import"./chunk-FZR6ITPM.js";import"./chunk-BNNGG6ED.js";import{B as L,D as G,Ia as z,Ja as Q,Ka as Y,La as q,q as B,r as R,u as j,w as V,z as U}from"./chunk-CQ74FR7E.js";import{a as S,b as x}from"./chunk-KXDO3JYP.js";import"./chunk-MDTKDCI6.js";import"./chunk-4CXDVP3F.js";import"./chunk-5JFE5MLS.js";import{p as H}from"./chunk-GD42XZQD.js";import"./chunk-ZNYLCQSJ.js";import"./chunk-YIGUHH4B.js";import"./chunk-CC7H2Q52.js";import"./chunk-LUCOJAXQ.js";import"./chunk-FWAWZDGH.js";import"./chunk-IHFPHQ5N.js";import"./chunk-RTKDH4JU.js";import"./chunk-IFY4UZPR.js";import"./chunk-Y4KZVCMP.js";import"./chunk-UU4K5RCK.js";import"./chunk-FKH5Y42R.js";import{a as J}from"./chunk-F24KRXZV.js";import"./chunk-JBWPPKX4.js";import"./chunk-7N232KV6.js";import"./chunk-PDYJ5OYY.js";import{s as O,u as W}from"./chunk-NDLDFKR2.js";import{Cb as h,Gb as f,Hb as P,Qc as E,Ue as k,bc as c,cc as p,dc as d,ec as C,ed as N,kb as m,lc as T,nc as b,pc as w,sd as g,ta as _,ua as F,vb as o,yc as M}from"./chunk-PVUKHE45.js";import"./chunk-AKP2VPKK.js";import"./chunk-GVXHDKBW.js";import{d as l,n as I}from"./chunk-VD6R3735.js";import"./chunk-MZPAXKJS.js";I();I();var a,D=(a=class extends ae{constructor(t,e,i,r){super(e,t,i,r)}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}}},a.\u0275fac=function(e){return new(e||a)(o(Q),o(L),o(z),o(g))},a.\u0275cmp=h({type:a,selectors:[["tis-acceptance-statistics-filters"]],features:[f],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(e,i){e&1&&(p(0,"form",0),C(1,"wk-date-picker",1)(2,"wk-date-picker",2),d()),e&2&&(c("formGroup",i.filtersForm),m(),c("maxDate",i.filtersForm.value.operationDateTo),m(),c("minDate",i.filtersForm.value.operationDateFrom))},dependencies:[G,j,B,R,V,U,ie],styles:[`[_nghost-%COMP%]{display:block;width:100%}
/*# sourceMappingURL=acceptance-statistics-filters.component-GCNIU32V.css.map */`],changeDetection:0}),a);D=l([S()],D);var ne=[{dataField:"date",caption:"\u0414\u0430\u0442\u0430",minWidth:100,calculateCellValue:s=>K(new Date(s.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:s=>s.totalSellCost-s.totalPurchaseCost}];function me(s,t){if(s&1){let e=T();p(0,"wk-dropdown",4),b("changed",function(r){_(e);let u=w();return F(u.changedWarehouse(r,{router:u.router,route:u.route}))}),d()}if(s&2){let e=w();c("options",e.warehouseOptions)("value",e.warehouseId)("showClearButton",!1)}}var n,A=(n=class extends oe{get warehouseOptions(){return this._warehouseService.warehouseOptions}get criteria(){return{filter:this._toFilterModel(this.filters)}}get filterData(){return{filters:{filter:this.filters}}}constructor(t,e,i,r,u,ce,se){super(ce,se),this._warehouseService=t,this._acceptanceStatisticService=e,this._amplitudeService=i,this.router=r,this.route=u,this.filterComponent=D,this.columns=ne}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(t){return this._acceptanceStatisticService.getAcceptanceStatistic(t,this.warehouseId)}_toFilterModel(t){return t?{operationDateFrom:y(t.operationDateFrom),operationDateTo:y(Z(t.operationDateTo))}:null}_initQueryParamsSub(){this.route.queryParams.pipe(x(this)).subscribe(t=>{this.changedWarehouse(t.warehouseId??this.mainWarehouseId)})}},n.\u0275fac=function(e){return new(e||n)(o(re),o(v),o(X),o(W),o(O),o(g),o(Y))},n.\u0275cmp=h({type:n,selectors:[["tis-acceptance-statistics"]],features:[E([v]),f],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(e,i){if(e&1){let r=T();C(0,"tis-subheader",2),p(1,"tis-main-layout")(2,"tis-table",3,0),b("clickedFilters",function(){return _(r),F(i.openFilters())}),d()(),P(4,me,1,3,"ng-template",null,1,N)}if(e&2){let r=M(5);c("showBackButton",!1),m(2),c("allowColumnResizing",!0)("enableTotalCount",!0)("customToolbarTemplate",r)("data",i.dataSource)("enableToolbar",!0)("enableFilters",!0)("columns",i.columns)("enablePagination",!0)("enableSearch",!1)("enableSpinner",!0)("pageNavigation",!0)("hoverable",!0)("activeFilters",!!i.filters)}},dependencies:[k,$,te,ee,q],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}),n);l([J(H.mainWarehouseId)],A.prototype,"mainWarehouseId",void 0);A=l([S()],A);export{A as AcceptanceStatisticsComponent};
//# sourceMappingURL=acceptance-statistics.component-AGRQ45DJ.js.map
