1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7250],{74292:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/partners/showMonth/[id]",function(){return n(42669)}])},42669:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return j}});var r=n(34051),a=n.n(r),l=n(85893),o=n(67294),i=n(11163),c=n(91798),u=n(86595),d=n(71577),s=n(12461),m=n(6292),v=n(40280),p=n(2587),f=n(77987),h=n(62548);function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function y(e,t,n,r,a,l,o){try{var i=e[l](o),c=i.value}catch(u){return void n(u)}i.done?t(c):Promise.resolve(c).then(r,a)}function x(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var l=e.apply(t,n);function o(e){y(l,r,a,o,i,"next",e)}function i(e){y(l,r,a,o,i,"throw",e)}o(void 0)}))}}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w(e){return function(e){if(Array.isArray(e))return _(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}u.Z.Paragraph;function j(){var e,t,n,r,u,_,y,j,I,k,g,S,N,F=(0,i.useRouter)(),Z=F.query.id,C=(0,o.useState)(null),P=C[0],A=C[1],O=(0,o.useState)(null),E=O[0],T=O[1],M=(0,o.useState)(!1),D=M[0],q=M[1],z=(new Date).getFullYear(),W=(new Date).getMonth()+1,R=Array.from({length:z-2023+1},(function(e,t){return 2023+t})),B=(0,o.useState)(Array.from({length:12},(function(e,t){return{month:t+1,data:null}}))),K=B[0],X=B[1],H=(0,o.useState)({totalWeb:0,totalMechanic:0,totalWebFee:0,totalMechanicFee:0,totalFee:0}),U=H[0],Y=H[1],$=(0,o.useState)({year:z,month:W+1}),G=$[0],J=$[1],L=[{title:"\u041e\u0433\u043d\u043e\u043e(\u0421\u0430\u0440\u0430\u0430\u0440)",dataIndex:"month",key:"month",render:function(t,n){var r;return(0,l.jsxs)("p",{className:"cursor-pointer ".concat(G.month===n.month?"text-[#000] underline font-semibold":""),children:[null!==(e=null===(r=n.data)||void 0===r?void 0:r.calc_year)&&void 0!==e?e:G.year,"-",n.month," \u0441\u0430\u0440"]})}},{title:"\u041d\u0438\u0439\u0442 \u0430\u0432\u0430\u0445",dataIndex:"total_price",key:"total_price",render:function(e,n){var r;return"".concat((new Intl.NumberFormat).format(null!==(t=null===n||void 0===n||null===(r=n.data)||void 0===r?void 0:r.total_price)&&void 0!==t?t:0),"\u20ae")}},{title:"\u0423\u0440\u044c\u0434\u0447\u0438\u043b\u0430\u043d \u0430\u0432\u0441\u0430\u043d",dataIndex:"prepaid",key:"prepaid",render:function(e,t){var a,l;return"".concat((new Intl.NumberFormat).format((null!==(n=null===t||void 0===t||null===(a=t.data)||void 0===a?void 0:a.total_price)&&void 0!==n?n:0)-(null!==(r=null===t||void 0===t||null===(l=t.data)||void 0===l?void 0:l.customer_price)&&void 0!==r?r:0)),"\u20ae")}},{title:"\u0414\u044d\u043b\u043a\u043e \u0425\u0410 \u0430\u0432\u0430\u0445",dataIndex:"customer_price",key:"customer_price",render:function(e,t){var n;return"".concat((new Intl.NumberFormat).format(null!==(u=null===t||void 0===t||null===(n=t.data)||void 0===n?void 0:n.customer_price)&&void 0!==u?u:0),"\u20ae")}},{title:"\u0414\u044d\u043b\u043a\u043e \u0425\u0410 \u0430\u0432\u0441\u0430\u043d",dataIndex:"paid_customer_price",key:"paid_customer_price",render:function(e,t){var n;return"".concat((new Intl.NumberFormat).format(null!==(_=null===t||void 0===t||null===(n=t.data)||void 0===n?void 0:n.paid_customer_price)&&void 0!==_?_:0),"\u20ae")}},{title:"\u04ae\u043b\u0434\u044d\u0433\u0434\u044d\u043b",dataIndex:"balance",key:"balance",render:function(e,t){var n,r;return"".concat((new Intl.NumberFormat).format((null!==(y=null===t||void 0===t||null===(n=t.data)||void 0===n?void 0:n.customer_price)&&void 0!==y?y:0)-(null!==(j=null===t||void 0===t||null===(r=t.data)||void 0===r?void 0:r.paid_customer_price)&&void 0!==j?j:0)),"\u20ae")}},{title:"\u0414\u044d\u043b\u043a\u043e \u0445\u04af\u0440\u0433\u044d\u043b\u0442\u0438\u0439\u043d \u04af\u0439\u043b\u0447\u0438\u043b\u0433\u044d\u044d\u043d\u0438\u0439 \u0442\u04e9\u043b\u0431\u04e9\u0440",dataIndex:"calc_delivery_price",key:"calc_delivery_price",render:function(e,t){var n;return"".concat((new Intl.NumberFormat).format(null!==(I=null===(n=t.data)||void 0===n?void 0:n.calc_delivery_price)&&void 0!==I?I:0),"\u20ae")}},{title:"\u0422\u0430\u0442\u0430\u043d \u0430\u0432\u0430\u043b\u0442\u044b\u043d \u0442\u04e9\u043b\u0431\u04e9\u0440",dataIndex:"withdraw_price",key:"withdraw_price",render:function(e,t){var n;return"".concat((new Intl.NumberFormat).format(null!==(k=null===(n=t.data)||void 0===n?void 0:n.withdraw_price)&&void 0!==k?k:0),"\u20ae")}},{title:"\u0414\u044d\u043b\u043a\u043e\u0433\u043e\u043e\u0441 \u0425\u0430\u0440\u0438\u043b\u0446\u0430\u0433\u0447\u0438\u0434 \u0442\u04e9\u043b\u04e9\u0445",dataIndex:"send_merchant_price",key:"send_merchant_price",render:function(e,t){var n;return"".concat((new Intl.NumberFormat).format(null!==(g=null===t||void 0===t||null===(n=t.data)||void 0===n?void 0:n.send_merchant_price)&&void 0!==g?g:0),"\u20ae")}},{title:"\u0425\u0430\u0440\u0438\u043b\u0446\u0430\u0433\u0447\u0430\u0430\u0441 \u0414\u044d\u043b\u043a\u043e\u0434 \u0442\u04e9\u043b\u04e9\u0445",dataIndex:"take_merchant_price",key:"take_merchant_price",render:function(e,t){var n;return"".concat((new Intl.NumberFormat).format(null!==(S=null===t||void 0===t||null===(n=t.data)||void 0===n?void 0:n.take_merchant_price)&&void 0!==S?S:0),"\u20ae")}}
1,{title:"\u0417\u04e9\u0440\u04af\u04af",dataIndex:"amount",key:"amount",render:function(e,t){var n;return"".concat((new Intl.NumberFormat).format(null!==(N=null===t||void 0===t||null===(n=t.data)||void 0===n?void 0:n.amount)&&void 0!==N?N:0),"\u20ae")}},{title:"\u0422\u043e\u043e\u0446\u043e\u043e\u043d\u044b \u0442\u04e9\u043b\u04e9\u04e9\u0432",dataIndex:"payment_status",key:"payment_status"},{title:"\u04ae\u0439\u043b\u0434\u044d\u043b",key:"action",render:function(e,t){return(0,l.jsx)(d.Z,{size:"small",icon:(0,l.jsx)(h.Z,{className:"text-[#fff]",rev:void 0}),loading:E==t.month,onClick:function(){return function(e){return Q.apply(this,arguments)}(null===t||void 0===t?void 0:t.month)},className:(null===t||void 0===t?void 0:t.data)?"bg-primary-100 ml-2":"bg-red-500 ml-2"})}}];function Q(){return(Q=x(a().mark((function e(t){var n,r;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(F.query.id){e.next=2;break}return e.abrupt("return");case 2:if(!(E>0)){e.next=4;break}return e.abrupt("return");case 4:return T(t),e.prev=5,e.next=8,c._6.salesCalculationByMerchant(F.query.id,G.year,t);case 8:"Success"===(null===(n=e.sent.data)||void 0===n?void 0:n.status)?s.ZP.success("\u0410\u043c\u0436\u0438\u043b\u0442\u0442\u0430\u0439"):null===n||void 0===n||null===(r=n.errors)||void 0===r||r.map((function(e){s.ZP.error(e.msg)})),e.next=14;break;case 12:e.prev=12,e.t0=e.catch(5);case 14:return e.prev=14,T(null),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[5,12,14,17]])})))).apply(this,arguments)}function V(){return ee.apply(this,arguments)}function ee(){return(ee=x(a().mark((function e(){var t,n,r;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(F.query.id){e.next=2;break}return e.abrupt("return");case 2:if(!D){e.next=4;break}return e.abrupt("return");case 4:return q(!0),e.prev=5,e.next=8,c._6.salesCalculation("".concat(F.query.id,"?page=0&results=25&year=").concat(G.year));case 8:t=e.sent.data,n=w(K),r={totalDelivery_price:0,totalSubtotal_price:0,totalTotal_price:0,totalTake_merchant_price:0,totalPaid_customer_price:0,totalSend_merchant_price:0,totalAmount:0,totalPaid:0,totalCalc_delivery_price:0},(null===t||void 0===t?void 0:t.data.length)>0?(null===t||void 0===t||t.data.map((function(e){n[e.calc_month-1]={month:e.calc_month,data:e},r.totalDelivery_price+=e.delivery_price,r.totalTotal_price+=e.total_price,r.totalSubtotal_price+=e.subtotal_price,r.totalTake_merchant_price+=e.take_merchant_price,r.totalPaid_customer_price+=e.paid_customer_price,r.totalSend_merchant_price+=e.send_merchant_price,r.totalAmount+=e.amount,r.totalPaid+=e.paid,r.totalCalc_delivery_price+=e.calc_delivery_price})),X(n),Y(r)):(Y({totalWeb:0,totalMechanic:0,totalWebFee:0,totalMechanicFee:0,totalFee:0}),X(Array.from({length:12},(function(e,t){return{month:t+1,data:null}})))),q(!1),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(5),console.log(e.t0);case 18:return e.prev=18,q(!1),e.finish(18);case 21:case"end":return e.stop()}}),e,null,[[5,15,18,21]])})))).apply(this,arguments)}(0,o.useEffect)((function(){V()}),[G.year]),(0,o.useEffect)((function(){null===P&&Z&&(se(Z),V())}),[P,Z]);var te,ne,re,ae,le,oe,ie,ce,ue,de,se=function(e){c.x4.get(Z).then((function(e){var t;A(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.data)})).catch((function(){return i.default.push("/admin")}))};return(0,l.jsxs)("div",{className:" w-full ",children:[(0,l.jsx)("title",{children:"\u0411\u0430\u0439\u0433\u0443\u0443\u043b\u043b\u0430\u0433\u0430"}),(0,l.jsx)(m.Z,{className:"p-0",onBack:function(){return i.default.back()},title:(0,l.jsxs)("h4",{className:"text-title",children:["\u0425\u04af\u0440\u0433\u044d\u043b\u0442\u0438\u0439\u043d \u0442\u043e\u043e\u0446\u043e\u043e: ",null===P||void 0===P?void 0:P.merchant_name]}),extra:[(0,l.jsx)(v.Z,{value:G.year,onSelect:function(e){J(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){b(e,t,n[t])}))}return e}({},G,{year:e}))},dropdownStyle:{zIndex:999},children:R.map((function(e){return(0,l.jsxs)(v.Z.Option,{value:e,children:[e," \u043e\u043d"]})}))}),(0,l.jsx)(d.Z,{onClick:function(){return F.push("/admin/partners/show/".concat(Z))},className:" ml-1",children:"\u04e8\u0434\u0440\u04e9\u04e9\u0440 \u0445\u0430\u0440\u0430\u0445"}),(0,l.jsx)(d.Z,{type:"primary",onClick:function(){i.default.push("/admin/partners/edit/"+Z)},children:"\u0417\u0430\u0441\u0430\u0445"})],children:(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)(p.Z,{size:"small",column:{xxl:4,xl:3,lg:3,md:3,sm:2,xs:1},children:[(0,l.jsxs)(p.Z.Item,{label:"\u041d\u044d\u0440",children:[null===P||void 0===P?void 0:P.branch_name," (",(null===P||void 0===P?void 0:P.is_organization)?"\u0411\u0430\u0439\u0433\u0443\u0443\u043b\u043b\u0430\u0433\u0430":"\u0425\u0443\u0432\u044c \u0445\u04af\u043d",")"]}),(0,l.jsx)(p.Z.Item,{label:"\u0423\u0442\u0430\u0441",children:null===P||void 0===P?void 0:P.phone}),(0,l.jsx)(p.Z.Item,{label:"MARKET.SHOP",children:null===P||void 0===P?void 0:P.store_name}),(0,l.jsxs)(p.Z.Item,{label:"\u0425\u04af\u0440\u0433\u044d\u043b\u0442\u0438\u0439\u043d \u0442\u04e9\u043b\u0431\u04e9\u0440",children:[(new Intl.NumberFormat).format(null!==(te=null===P||void 0===P?void 0:P.delivery_price)&&void 0!==te?te:0),"\u20ae"]}),(0,l.jsxs)(p.Z.Item,{label:"\u0422\u043e\u043e\u0446\u043e\u043e \u043d\u0438\u0439\u043b\u044d\u0445 \u0442\u04e9\u043b\u0431\u04e9\u0440",children:[(new Intl.NumberFormat).format(null!==(ne=null===P||void 0===P?void 0:P.calc_price)&&void 0!==ne?ne:0),"\u20ae"]}),(0,l.jsxs)(p.Z.Item,{label:"\u0417\u0430\u0445\u0438\u0430\u043b\u0433\u044b\u043d \u0448\u0438\u043c\u0442\u0433\u044d\u043b",children:[(new Intl.NumberFormat).format(null!==(re=null===P||void 0===P?void 0:P.delivery_fee)&&void 0!==re?re:0),"\u20ae"]})]})})}),(0,l.jsx)(f.Z,{dataSource:K,columns:L,rowKey:"month",pagination:!1,bordered:!0,scroll:{x:1300},loading:D,className:"mb-4",summary:function(){return(0,l.jsxs)(f.Z.Summary.Row,{children:[(0,l.jsx)(f.Z.Summary.Cell,{index:0,colSpan:1,children:(0,l.jsx)("strong",{children:"\u041d\u0438\u0439\u0442 \u0434\u04af\u043d:"})}),(0,l.jsx)(f.Z.Summary.Cell,{index:1,children:(0,l.jsxs)("strong",{children:[(new Intl.NumberFormat).format(null!==(ae=U.totalSubtotal_price)&&void 0!==ae?ae:""),"\u20ae"]})}),(0,l.jsx)(f.Z.Summary.Cell,{index:2,children:(0,l.jsxs)("strong",{children:[(new Intl.NumberFormat).format(null!==(le=U.totalDelivery_price)&&void 0!==le?le:""),"\u20ae"]})}),(0,l.jsx)(f.Z.Summary.Cell,{index:3,children:(0,l.jsxs)("strong",{children:[(new Intl.NumberFormat).format(null!==(oe=U.totalTotal_price)&&void 0!==oe?oe:""),"\u20ae"]})}),(0,l.jsx)(f.Z.Summary.Cell,{index:4,children:(0,l.jsxs)("strong",{children:[(new Intl.NumberFormat).format(null!==(ie=U.totalTake_merchant_price)&&void 0!==ie?ie:""),"\u20ae"]})}),(0,l.jsx)(f.Z.Summary.Cell,{index:5,children:(0,l.jsxs)("strong",{children:[(new Intl.NumberFormat).format(null!==(ce=U.totalPaid_customer_price)&&void 0!==ce?ce:""),"\u20ae"]})}),(0,l.jsx)(f.Z.Summary.Cell,{index:6,children:(0,l.jsxs)("strong",{children:[(new Intl.NumberFormat).format(null!==(ue=U.totalSend_merchant_price)&&void 0!==ue?ue:""),"\u20ae"]})}),(0,l.jsx)(f.Z.Summary.Cell,{index:7,children:(0,l.jsxs)("strong",{children:[(new Intl.NumberFormat).format(null!==(de=U.totalAmount)&&void 0!==de?de:""),"\u20ae"]})}),(0,l.jsx)(f.Z.Summary.Cell,{index:8,colSpan:4})]})}})]})}}},function(e){e.O(0,[280,7616,7987,6292,663,9774,2888,179],(function(){return t=74292,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
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.