1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[355],{42318:function(t,e,n){"use strict";n.d(e,{A:function(){return a}});var r=n(67294);let a=()=>r.useRef({})},42176:function(t,e,n){"use strict";n.d(e,{D:function(){return h}});var r=n(87462),a=n(63366),i=n(67294),o=n(90512),c=n(13264),u=n(94780),s=n(73490),d=n(48836),l=n(85893);let p=["className","children"],f=t=>{let{classes:e}=t;return(0,u.Z)({root:["toolbarContainer"]},s.d,e)},g=(0,c.Z)("div",{name:"MuiDataGrid",slot:"ToolbarContainer",overridesResolver:(t,e)=>e.toolbarContainer})(({theme:t})=>({display:"flex",alignItems:"center",flexWrap:"wrap",gap:t.spacing(1),padding:t.spacing(.5,.5,0)})),h=i.forwardRef(function(t,e){let{className:n,children:i}=t,c=(0,a.Z)(t,p),u=(0,d.B)(),s=f(u);return i?(0,l.jsx)(g,(0,r.Z)({ref:e,className:(0,o.Z)(n,s.root),ownerState:u},c,{children:i})):null})},29387:function(t){var e,n;t.exports=(e={year:0,month:1,day:2,hour:3,minute:4,second:5},n={},function(t,r,a){var i,o=function(t,e,r){void 0===r&&(r={});var a,i,o,c,u=new Date(t);return(void 0===(a=r)&&(a={}),(c=n[o=e+"|"+(i=a.timeZoneName||"short")])||(c=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:i}),n[o]=c),c).formatToParts(u)},c=function(t,n){for(var r=o(t,n),i=[],c=0;c<r.length;c+=1){var u=r[c],s=u.type,d=u.value,l=e[s];l>=0&&(i[l]=parseInt(d,10))}var p=i[3],f=i[0]+"-"+i[1]+"-"+i[2]+" "+(24===p?0:p)+":"+i[4]+":"+i[5]+":000",g=+t;return(a.utc(f).valueOf()-(g-=g%1e3))/6e4},u=r.prototype;u.tz=function(t,e){void 0===t&&(t=i);var n=this.utcOffset(),r=this.toDate(),o=r.toLocaleString("en-US",{timeZone:t}),c=Math.round((r-new Date(o))/1e3/60),u=a(o).$set("millisecond",this.$ms).utcOffset(-(15*Math.round(r.getTimezoneOffset()/15))-c,!0);if(e){var s=u.utcOffset();u=u.add(n-s,"minute")}return u.$x.$timezone=t,u},u.offsetName=function(t){var e=this.$x.$timezone||a.tz.guess(),n=o(this.valueOf(),e,{timeZoneName:t}).find(function(t){return"timezonename"===t.type.toLowerCase()});return n&&n.value};var s=u.startOf;u.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return s.call(this,t,e);var n=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"));return s.call(n,t,e).tz(this.$x.$timezone,!0)},a.tz=function(t,e,n){var r=n&&e,o=n||e||i,u=c(+a(),o);if("string"!=typeof t)return a(t).tz(o);var s=function(t,e,n){var r=t-60*e*1e3,a=c(r,n);if(e===a)return[r,e];var i=c(r-=60*(a-e)*1e3,n);return a===i?[r,a]:[t-60*Math.min(a,i)*1e3,Math.max(a,i)]}(a.utc(t,r).valueOf(),u,o),d=s[0],l=s[1],p=a(d).utcOffset(l);return p.$x.$timezone=o,p},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(t){i=t}})},70178:function(t){var e,n,r;t.exports=(e="minute",n=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g,function(t,a,i){var o=a.prototype;i.utc=function(t){var e={date:t,utc:!0,args:arguments};return new a(e)},o.utc=function(t){var n=i(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},o.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var c=o.parse;o.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),c.call(this,t)};var u=o.init;o.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else u.call(this)};var s=o.utcOffset;o.utcOffset=function(t,a){var i=this.$utils().u;if(i(t))return this.$u?0:i(this.$offset)?s.call(this):this.$offset;if("string"==typeof t&&null===(t=function(t){void 0===t&&(t="");var e=t.match(n);if(!e)return null;var a=(""+e[0]).match(r)||["-",0,0],i=a[0],o=60*+a[1]+ +a[2];return 0===o?0:"+"===i?o:-o}(t)))return this;var o=16>=Math.abs(t)?60*t:t,c=this;if(a)return c.$offset=o,c.$u=0===t,c;if(0!==t){var u=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(c=this.local().add(o+u,e)).$offset=o,c.$x.$localOffset=u}else c=this.utc();return c};var d=o.format;o.format=function(t){var e=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,e)},o.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var l=o.toDate;o.toDate=function(t){return"s"===t&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():l.call(this)};var p=o.diff;o.diff=function(t,e,n){if(t&&this.$u===t.$u)return p.call(this,t,e,n);var r=this.local(),a=i(t).local();return p.call(r,a,e,n)}})},6833:function(t){t.exports=function(t,e){e.prototype.weekday=function(t){var e=this.$locale().weekStart||0,n=this.$W,r=(n<e?n+7:n)-e;return this.$utils().u(t)?r:this.subtract(r,"day").add(t,"day")}}},46963:function(t,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/productstable",function(){return n(83662)}])},83662:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return C}});var r=n(85893),a=n(87357),i=n(15861),o=n(42318),c=n(40525),u=n(78609),s=n(72873),d=n(50348);let l={field:"productName",headerName:"Ðазвание",editField:d.yO,nullable:!0,width:300,groupable:!1},p={field:"cost",headerName:"СебеÑÑоимоÑÑÑ",editField:d.Ne,nullable:!1,width:180,groupable:!1},f={field:"tax",headerName:"Ðалог",editField:d.oP,nullable:!0,groupNullable:!1,width:120,groupable:!1,placeholderGetter:t=>{let{row:e,api:n}=t,r=n.getCellValue(e.path[0],"tax");return Number.isFinite(r)?r.toString():""},interpolationFunction:t=>{let{row:e,rows:n,value:r}=t;return[{...e,tax:r||0},...n]}},g={field:"storagePrice",headerName:"Цена Ñ
ÑанениÑ",editField:d.Ne,nullable:!0,groupNullable:!1,width:180,groupable:!1,placeholderGetter:t=>{let{row:e,api:n}=t,r=n.getCellValue(e.path[0],"storagePrice");return Number.isFinite(r)?r.toString():""},interpolationFunction:t=>{let{row:e,rows:n,value:r}=t;return[{...e,storagePrice:r||0},...n]}},h={field:"additionalExpensePercent",headerName:"Ðоп. ÑаÑÑ
од %",editField:d.oP,nullable:!0,groupNullable:!1,width:120,groupable:!1,placeholderGetter:t=>{let{row:e,api:n}=t,r=n.getCellValue(e.path[0],"additionalExpensePercent");return Number.isFinite(r)?r.toString():""},interpolationFunction:t=>{let{row:e,rows:n,value:r}=t;return[{...e,additionalExpensePercent:r||0},...n]}},m={field:"avgDirectLogistic",headerName:"ÐÑÑÐ¼Ð°Ñ Ð»Ð¾Ð³Ð¸ÑÑика",editField:d.Ne,nullable:!0,width:120,groupable:!1,placeholderGetter:()=>"авÑо"},v={field:"avgReturnLogistic",headerName:"ÐбÑаÑÐ½Ð°Ñ Ð»Ð¾Ð³Ð¸ÑÑика",editField:d.Ne,nullable:!0,width:120,groupable:!1,placeholderGetter:()=>"авÑо"},x=[s.k5.create({groupable:!1}
1),s.lv.create(),s.nc.create({groupable:!1}),s.Y2.create({groupable:!1}),l,p,f,g,h,m,v],b={headerName:"ÐккаÑнÑ",valueGetter:t=>{let{row:e,rowNode:n}=t;return"group"===n.type?e.mpAccountName:""}},P=t=>{let e=new Map,n=t.ozOrderedArticles.map(t=>{let n="ozProduct-".concat(t.product.id),r="ozAccount-".concat(t.ozAccount.id);e.has(r)||e.set(r,{id:r,ozAccountId:t.ozAccount.id,path:[r],mpAccountName:t.ozAccount.name||t.ozAccount.id.toString(),mpName:"Ozon",tax:t.ozAccount.tax,storagePrice:t.ozAccount.storagePrice,additionalExpensePercent:t.ozAccount.additionalExpensePercent});let a=e.get(r);return{id:n,ozAccountId:t.ozAccount.id,productId:t.product.id,path:[r,n],name:t.product.name||t.product.article,img:t.product.img||null,sku:t.product.sku,url:t.product.url,mpAccountName:a.mpAccountName,mpName:"Ozon",article:t.product.article,productName:t.product.name||null,cost:t.product.cost,tax:t.product.tax||null,storagePrice:t.product.storagePrice||null,additionalExpensePercent:t.product.additionalExpensePercent||null,avgDirectLogistic:t.product.avgDirectLogistic||null,avgReturnLogistic:t.product.avgReturnLogistic||null}}),r=t.wbOrderedArticles.map(t=>{let n="wbProduct-".concat(t.product.id),r="wbAccount-".concat(t.wbAccount.id);e.has(r)||e.set(r,{id:r,wbAccountId:t.wbAccount.id,path:[r],mpAccountName:t.wbAccount.name||t.wbAccount.id.toString(),mpName:"Wildberries",tax:t.wbAccount.tax,storagePrice:t.wbAccount.storagePrice,additionalExpensePercent:t.wbAccount.additionalExpensePercent});let a=e.get(r);return{id:n,wbAccountId:t.wbAccount.id,productId:t.product.id,path:[r,n],name:t.product.name||t.product.supplierArticle,img:t.product.img||null,sku:t.product.nmId,url:t.product.url,mpAccountName:a.mpAccountName,mpName:"Wildberries",article:t.product.supplierArticle,productName:t.product.name||null,cost:t.product.cost,tax:t.product.tax||null,storagePrice:t.product.storagePrice||null,additionalExpensePercent:t.product.additionalExpensePercent||null,avgDirectLogistic:t.product.avgDirectLogistic||null,avgReturnLogistic:t.product.avgReturnLogistic||null}});return[n,r,[...e.values()]].flat()};var $=n(47705);let A=(0,$.BX)("\nmutation BatchCreateOrUpdateMpAccounts($wbAccounts: [WbAccountInput!]!, $ozAccounts: [OzAccountInput!]!) {\n batchCreateOrUpdateWbAccounts(wbAccounts: $wbAccounts) {\n id\n name\n accountId\n statisticsToken\n defectiveRate\n storagePrice\n tax\n additionalExpensePercent\n errors\n loadingData\n dataUpdatedAt\n }\n batchCreateOrUpdateOzAccounts(ozAccounts: $ozAccounts) {\n id\n name\n clientId\n apiKey\n tax\n additionalExpensePercent\n storagePrice\n errors\n loadingData\n dataUpdatedAt\n }\n}\n"),w=(0,$.BX)("\n mutation BatchUpdateProducts($wbProducts: [WbProductInput!]!, $ozProducts: [OzProductInput!]!) {\n batchUpdateWbProducts(wbProducts: $wbProducts) {\n id\n nmId\n img\n url\n cost\n defectiveRate\n storagePrice\n tax\n additionalExpensePercent\n spp\n supplierArticle\n name\n redeemRate\n avgDirectLogistic\n avgReturnLogistic\n }\n batchUpdateOzProducts(ozProducts: $ozProducts) {\n id\n ozAccountId\n article\n sku\n name\n ozonName\n img\n url\n cost\n defectiveRate\n storagePrice\n tax\n additionalExpensePercent\n redeemRateExpected\n avgDirectLogistic\n avgReturnLogistic\n }\n }\n");var z=n(33040);let D=async t=>{let e=[],n=[],r=[],a=[];t.forEach(t=>{if(t.productId){let r={id:t.productId,additionalExpensePercent:t.additionalExpensePercent,cost:t.cost,name:t.productName,storagePrice:t.storagePrice,tax:t.tax,avgDirectLogistic:t.avgDirectLogistic,avgReturnLogistic:t.avgReturnLogistic};t.wbAccountId?n.push(r):t.ozAccountId&&e.push(r);return}if(t.ozAccountId){r.push({id:t.ozAccountId,additionalExpensePercent:t.additionalExpensePercent,storagePrice:t.storagePrice,tax:t.tax});return}if(t.wbAccountId){a.push({id:t.wbAccountId,additionalExpensePercent:t.additionalExpensePercent,storagePrice:t.storagePrice,tax:t.tax});return}}),(e.length||n.length)&&await z.Z.mutate({mutation:w,variables:{ozProducts:e,wbProducts:n}}),(r.length||a.length)&&await z.Z.mutate({mutation:A,variables:{ozAccounts:r,wbAccounts:a}})};var N=n(37887);let O=(0,$.BX)("\n query AllOrderedProducts($dateStart: String!, $dateEnd: String!) {\n ozOrderedArticles(dateStart: $dateStart, dateEnd: $dateEnd) {\n count\n product {\n id\n article\n name\n img\n sku\n cost\n url\n tax\n additionalExpensePercent\n avgDirectLogistic\n avgReturnLogistic\n storagePrice\n }\n ozAccount {\n id\n name\n tax\n additionalExpensePercent\n storagePrice\n }\n }\n wbOrderedArticles(dateStart: $dateStart, dateEnd: $dateEnd) {\n count\n product {\n id\n supplierArticle\n name\n img\n nmId\n cost\n url\n tax\n additionalExpensePercent\n avgDirectLogistic\n avgReturnLogistic\n storagePrice\n }\n wbAccount {\n id\n name\n tax\n additionalExpensePercent\n storagePrice\n }\n }\n }\n");var E=n(87328);let S=()=>{let{data:t,...e}=(0,N.a)(O,{variables:{dateStart:(0,E.Z)().subtract(3,"month").format("YYYY-MM-DD"),dateEnd:(0,E.Z)().format("YYYY-MM-DD")}});return{...e,data:t}};var I=()=>{let{data:t,error:e,loading:n}=S(),i=t?P(t):[],s=(0,o.A)();return(0,r.jsxs)(a.Z,{children:[e&&(0,r.jsx)(c.Z,{errors:[e]}),(0,r.jsx)(u.Z,{sx:{width:"100%",height:"calc(100vh - 100px)"},apiRef:s,onSave:D,tableId:"productsTable",loading:n,rows:i,columns:x,treeData:!0,getTreeDataPath:t=>t.path,isGroupExpandedByDefault:()=>!0,groupingColDef:b})]})},L=n(45023),y=n(95395);let T=()=>(0,r.jsxs)(a.Z,{children:[(0,r.jsx)(i.Z,{variant:"h4",gutterBottom:!0,children:"ТоваÑÑ"}),(0,r.jsx)(i.Z,{variant:"subtitle1",gutterBottom:!0,children:"Ðиже оÑобÑÐ°Ð¶ÐµÐ½Ñ ÑоваÑÑ Ñ ÑазлиÑнÑÑ
маÑкеÑплейÑов, Ð´Ð»Ñ Ð½Ð¸Ñ
можно задаÑÑ Ð½Ð°Ð¸Ð¼ÐµÐ½Ð¾Ð²Ð°Ð½Ð¸Ðµ, иÑ
ÑебеÑÑоимоÑÑÑ, налог, ÑÐµÐ½Ñ Ñ
ÑÐ°Ð½ÐµÐ½Ð¸Ñ Ð¸ % доп. ÑаÑÑ
ода. ÐÑе заполненнÑе даннÑе оÑобÑазÑÑÑÑ Ð² ÑаблиÑе и бÑдÑÑ ÑÑÑÐµÐ½Ñ Ð¿Ñи ÑаÑÑеÑаÑ
. ÐÑи налиÑии одинакового ÑоваÑа на ÑазнÑÑ
маÑкеÑплейÑаÑ
Ð
1·Ð°Ð´Ð°Ð¹Ñе одинаковое название и они бÑдÑÑ Ð¿Ð¾Ð¼ÐµÑÐµÐ½Ñ Ð² Ñводной ÑаблиÑе в Ð¾Ð´Ð½Ñ Ð³ÑÑÐ¿Ð¿Ñ Ð¿Ñи ÑилÑÑÑаÑии."}),(0,r.jsx)(I,{})]});T.authorize=[y.u.ADMIN,y.u.ANALYST],T.Layout=L.Z;var C=T}},function(t){t.O(0,[1962,4138,8584,6395,6692,34,2173,674,389,5023,7705,6458,260,9774,2888,179],function(){return t(t.s=46963)}),_N_E=t.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.