PageSourceSearch

https://app.free.fi/static/js/17.b697a240.chunk.js

js free.fi collected 2026-10-07 12:36:13 UTC 97,900 bytes, 1 lines download raw bytes

1(this["webpackJsonpone-free-ui"]=this["webpackJsonpone-free-ui"]||[]).push([[17],{1151:function(e,t,n){"use strict";var i=n(15),a=n(1149),c=n(1169),l=n(313),o=n(21),r=n(2);t.a=function(e){var t=Object(l.a)().t,n=e.backgroundColor,d=e.label,s=e.handleDelete;return d?Object(r.jsx)(a.a,{style:{height:"auto",padding:"5px 10px",borderRadius:"18px",color:n,border:"2px solid ".concat(n),backgroundColor:Object(o.Z)(n,.1),fontFamily:"Inter-Bold"},label:t(i.a.capitalize(d)),onDelete:s,deleteIcon:Object(r.jsx)(c.a,{})}):""}},1152:function(e,t,n){"use strict";var i=n(9),a=n(3),c=n(381),l=n(1368),o=n(1372),r=n(1371),d=n(1367),s=n(1369),u=n(1370),v=n(10),b=n(8),j=n(0),m=n.n(j),x=n(313),O=n(1166),p=n(2),h=Object(c.a)((function(e){var t;return{tableHeaderRow:(t={fontFamily:"Inter-Bold, sans-serif",whiteSpace:"pre-wrap",textAlign:"center",verticalAlign:"top"},Object(a.a)(t,e.breakpoints.down("sm"),{border:"none",display:"flex",flexDirection:"column",alignItems:"center",padding:"0"}),Object(a.a)(t,"& > div",Object(a.a)({"& > label":{fontFamily:"Inter-Regular"},"& > div:nth-of-type(1)":{borderBottom:"1px solid ".concat(e.palette.utility.main)}},e.breakpoints.down("sm"),{minHeight:"50px",display:"flex",flexDirection:"column",alignItems:"center",width:"100%","& > div:nth-of-type(1)":{display:"none"},"& > input":{marginTop:"20px",maxWidth:"100%",width:"85%","&::placeholder":{color:"black"}}})),t),tableBody:{"& tr:nth-of-type(odd)":{background:e.palette.utility.rowOdd}},tableRow:Object(a.a)({},e.breakpoints.down("sm"),{borderBottom:"1px solid ".concat(e.palette.background.border)}),tableBodyRow:Object(a.a)({whiteSpace:"pre-wrap",textAlign:"center"},e.breakpoints.down("sm"),{border:"none",display:"flex",flexDirection:"column",alignItems:"center",padding:"0"}),inputPage:{margin:"0px 10px",width:"70px",textAlign:"center",border:"1px solid ".concat(e.palette.utility.main),background:e.palette.background.main,padding:"5px 7px",borderRadius:"3px",fontWeight:"400"},selectPageSize:{margin:"0px 10px",border:"1px solid ".concat(e.palette.utility.main),background:e.palette.background.main,padding:"7px",borderRadius:"3px",fontWeight:"400"},pagination:Object(a.a)({color:e.palette.text.main,fontFamily:"Inter-Bold"},e.breakpoints.down("sm"),{display:"flex",flexDirection:"column","& > *":{margin:"10px 0"}}),emptyRowsPlaceholder:{height:"80px",backgroundColor:e.palette.background.main}}}));t.a=function(e){var t,n,a,c=e.columns,j=e.onRowClick,f=void 0===j?function(){}:j,g=e.data,y=e.tablePagination,I=void 0!==y&&y,N=e.page,T=void 0===N?1:N,w=e.onChangePage,A=e.pageSize,C=void 0===A?10:A,D=e.pageSizes,k=void 0===D?v.z:D,E=e.changePageSize,S=e.noDataText,P=void 0===S?v.gc:S,F=e.classWrapper,R=e.classRow,L=e.rowProps,V=void 0===L?function(){return{}}:L,U=e.cellProps,Y=void 0===U?function(){return{}}:U,B=e.error,H=void 0===B?null:B,_=e.editInvoiceItemIndex,M=void 0===_?void 0:_,q=e.editInvoiceItemId,W=void 0===q?void 0:q,z=Object(x.a)().t,J=h(e),X=Array.isArray(g)&&g||[],Z=Object(O.useTable)({columns:c,data:X}),G=Z.getTableProps,K=Z.headerGroups,Q=Z.rows,$=Z.prepareRow;return Object(p.jsxs)("div",{className:F||"",children:[Object(p.jsx)(d.a,{className:"flex flex-1 striped",children:Object(p.jsxs)(l.a,Object(i.a)(Object(i.a)({},G()),{},{children:[Object(p.jsx)(s.a,{children:K.map((function(e){return Object(p.jsx)(u.a,Object(i.a)(Object(i.a)({},e.getHeaderGroupProps()),{},{className:J.tableHead,children:e.headers.map((function(e){return Object(p.jsx)(r.a,Object(i.a)(Object(i.a)({},e.getHeaderProps()),{},{className:Object(b.a)(J.tableHeaderRow,(null===e||void 0===e?void 0:e.classHeader)||""),children:e.render("Header")}))}))}))}))}),Object(p.jsx)(o.a,{className:J.tableBody,children:Q.length>0?Q.map((function(e,t){return $(e),Object(p.jsxs)(m.a.Fragment,{children:[Object(p.jsx)(u.a,Object(i.a)(Object(i.a)({},e.getRowProps(V(e))),{},{className:Object(b.a)(J.tableRow,R||""),onClick:function(t){return f(t,e)},children:e.cells.map((function(n){var a;return Object(p.jsxs)(r.a,Object(i.a)(Object(i.a)({},n.getCellProps(Y(e))),{},{className:Object(b.a)(J.tableBodyRow,(null===n||void 0===n||null===(a=n.column)||void 0===a?void 0:a.className)||""),children:[n.render("Cell"),H&&t===M&&n.column.id===W&&Object(p.jsx)("div",{className:"text-10 text-red-500 \n                                  relative md:absolute max-w-160 text-left self-end \n                                  lg:mr-0 mr-16 sm:mr-40 -mt-4 md:mt-0",children:"* ".concat(H)})]}),n.column.id)}))}))," "]},e.id)})):Object(p.jsx)(u.a,{children:Object(p.jsx)(r.a,{className:Object(b.a)(J.emptyRowsPlaceholder,"text-center"),colSpan:"100%",children:z(P)})})})]}))}),(I&&Q.length>0||I&&0!==(null===I||void 0===I?void 0:I.totalPages)&&T>((null===I||void 0===I?void 0:I.totalPages)||0))&&Object(p.jsxs)("div",{className:Object(b.a)(J.pagination,"flex m-10 items-center"),children:[Object(p.jsxs)("span",{children:[Object(p.jsx)("span",{children:z("Page Size")}),Object(p.jsx)("select",{"aria-label":"rows per page",className:J.selectPageSize,value:C,onChange:function(e){return E(e)},children:k.map((function(e){return Object(p.jsxs)("option",{value:e,children:[e," ",z("rows")]},e)}))})]}),Object(p.jsxs)("span",{children:[Object(p.jsx)("span",{className:"ml-10",children:z("Page")}),Object(p.jsx)("input",{className:J.inputPage,"aria-label":"jump to page",type:"number",onChange:function(e){return w(e)},value:T,max:null===I||void 0===I?void 0:I.totalPages,min:1}),Object(p.jsxs)("span",{children:[" / ",null!==(t=null===I||void 0===I?void 0:I.totalPages)&&void 0!==t?t:0]})]}),Object(p.jsx)("span",{className:"w-64"}),Object(p.jsxs)("span",{className:"px-10",children:[z("Number of items"),": ",null!==(n=null===I||void 0===I?void 0:I.numberOfElements)&&void 0!==n?n:0]}),Object(p.jsxs)("span",{id:"total-of-items",className:"px-10",children:[z("Total of items"),": ",null!==(a=null===I||void 0===I?void 0:I.totalElements)&&void 0!==a?a:0]})," "]})]})}},1153:function(e,t,n){"use strict";var i=n(381),a=n(623),c=n(396),l=n(109),o=n(8),r=n(1140),d=n(313),s=n(46),u=n(2),v=Object(i.a)((function(e){return{root:{backgroundColor:e.palette.background.main,color:e.palette.text.main,"& .titleText":{fontFamily:"PlusJakartaSans-Bold !important"}}}}));t.a=function(e){var t=Object(d.a)().t,n=v();return Object(u.jsx)(u.Fragment,{children:Object(u.jsx)("div",{className:Object(o.a)(n.root,"flex items-center w-full"),children:Object(u.jsxs)("div",{className:"w-full mt-12",children:[e.linkBack&&Object(u.jsxs)(l.a,{className:"font-bold flex items-center sm:mb-12",component:s.a,role:"button",to:e.linkBack,color:"inherit",children:[Object(u.jsx)(c.a,{className:"mr-4 text-20",children:"arrow_back"}),t(e.titleBack)]}),e.title&&Object(u.jsx)("div",{className:"headline",children:Object(u.jsxs)("div",{className:"flex items-center",children:[e.icon&&Object(u.jsx)(c.a,{className:"text-24 sm:text-32 mr-12",children:e.icon}),Object(u.jsx)(r.a.span,{initial:{scale:.6},animate:{scale:1,transition:{delay:.2}},className:"text-24 sm:text-32 uppercase titleText",children:t(e.title)})]})}),Object(u.jsxs)("div",{className:"my-10",children:[e.button&&!e.buttonHidden&&Object(u.jsx)(a.a,{component:s.a,to:e.link,className:"whitespace-no-wrap mr-20 ",variant:"contained",color:"primary",children:Object(u.jsx)("span",{children:t(e.button)})}),e.refresh&&Object(u.jsx)(a.a,{id:"refresh",className:"ml-2 m-0",variant:"outlined",color:"primary",onClick:e.handleRefresh,children:Object(u.jsx)(c.a,{className:"",children:"refresh"})}),e.isClearFilter&&Object(u.jsxs)(a.a,{id:"clearFilters",className:"ml-2 m-0",variant:"outlined",color:"primary",onClick:function(){var e=window.location.search.includes("tenantType")?"tenantType=".concat(window.location.search.split("tenantType=")[1].split("&")[0]):"";window.location.search=e},children:[Object(u.jsx)(c.a,{children:"filter_alt"})," Clear"]})]})]})})})}},1154:function(e,t,n){"use strict";var i=n(3),a=n(1132),c=n(10),l=n(52),o=n(16),r=n(2);var d=function(e){var t=Object(o.c)(l.f),n=Object(o.c)(l.c),i=Object(o.c)((function(e){return e.auth.user.data})).role;return Object(r.jsx)("div",{className:e.classes.header,children:e.header&&Object(r.jsx)(a.a,{theme:i===c.kd.contractor_company.name?n:t,children:e.header})})},s=n(9),u=n(19),v=n(108),b=n(1144),j=n(1147),m=n(8),x=n(0),O=n.n(x),p=n(233),h=n(59);var f=function(e){var t=Object(h.a)(),n=Object(o.c)(Object(l.e)(t.palette.primary.main)),i=e.classes;return Object(r.jsxs)(r.Fragment,{children:[e.header&&Object(r.jsx)(a.a,{theme:n,
1children:Object(r.jsx)("div",{className:Object(m.a)(i.sidebarHeader,e.variant),children:e.header})}),e.content&&Object(r.jsx)(p.a,{className:i.sidebarContent,enable:e.innerScroll,children:e.content})]})};function g(e,t){var n=Object(x.useState)(!1),i=Object(u.a)(n,2),a=i[0],c=i[1],l=e.classes;Object(x.useImperativeHandle)(t,(function(){return{toggleSidebar:o}}));var o=function(){c(!a)};return Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(b.a,{lgUp:"permanent"===e.variant,children:Object(r.jsx)(j.a,{variant:"temporary",anchor:e.position,open:a,onOpen:function(e){},onClose:function(e){return o()},disableSwipeToOpen:!0,classes:{root:Object(m.a)(l.sidebarWrapper,e.variant),paper:Object(m.a)(l.sidebar,e.variant,"left"===e.position?l.leftSidebar:l.rightSidebar)},ModalProps:{keepMounted:!0},container:e.rootRef.current,BackdropProps:{classes:{root:l.backdrop}},style:{position:"absolute"},children:Object(r.jsx)(f,Object(s.a)({},e))})}),"permanent"===e.variant&&Object(r.jsx)(b.a,{mdDown:!0,children:Object(r.jsx)(v.a,{variant:"permanent",className:Object(m.a)(l.sidebarWrapper,e.variant),open:a,classes:{paper:Object(m.a)(l.sidebar,e.variant,"left"===e.position?l.leftSidebar:l.rightSidebar)},children:Object(r.jsx)(f,Object(s.a)({},e))})})]})}var y=Object(x.forwardRef)(g),I=n(381),N=200,T=Object(I.a)((function(e){var t;return{"@global":{"#fuse-main":{height:function(e){return e.innerScroll&&"100vh"}}},root:{display:"flex",flexDirection:"row",minWidth:0,minHeight:"100%",position:"relative",flex:"1 1 auto",height:"auto",backgroundColor:e.palette.background.main},innerScroll:{height:"100%"},topBg:Object(i.a)({position:"absolute",left:0,right:0,top:0,height:N,pointerEvents:"none",backgroundSize:"200px auto !important",backgroundRepeat:"no-repeat !important",backgroundPosition:"bottom 60px right 10px !important",backgroundColor:"".concat(e.palette.background.main," !important")},e.breakpoints.down("md"),{backgroundImage:"none !important"}),contentWrapper:(t={display:"flex",flexDirection:"column",padding:"0 3.2rem",flex:"1 1 100%",zIndex:2,maxWidth:"100%",minWidth:0,minHeight:0},Object(i.a)(t,e.breakpoints.down("sm"),{padding:"0 1.6rem"}),Object(i.a)(t,e.breakpoints.down("xs"),{padding:"0 0.5rem"}),t),header:{height:136,minHeight:136,maxHeight:136,display:"flex",color:e.palette.primary.contrastText},headerSidebarToggleButton:{color:e.palette.primary.contrastText},contentCard:{display:"flex",flex:"1 1 100%",flexDirection:"column",paddingTop:"20px",backgroundColor:e.palette.background.dark,boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",minHeight:0,borderRadius:"8px 8px 0 0"},toolbar:{display:"flex",minHeight:64,alignItems:"center",borderBottom:"1px solid ".concat(e.palette.utility.main)},content:{color:e.palette.text.main,flex:"1 1 auto",height:"100%",overflow:"auto","-webkit-overflow-scrolling":"touch"},sidebarWrapper:{position:"absolute",backgroundColor:"transparent",zIndex:5,overflow:"hidden","&.permanent":Object(i.a)({},e.breakpoints.up("lg"),{zIndex:1,position:"relative"})},sidebar:{position:"absolute","&.permanent":Object(i.a)({},e.breakpoints.up("lg"),{backgroundColor:"transparent",position:"relative",border:"none",overflow:"hidden"}),width:240,height:"100%"},leftSidebar:{},rightSidebar:{},sidebarHeader:{height:N,minHeight:N,color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.dark,"&.permanent":Object(i.a)({},e.breakpoints.up("lg"),{backgroundColor:"transparent"})},sidebarContent:Object(i.a)({display:"flex",flex:"1 1 auto",flexDirection:"column",backgroundColor:e.palette.background.default,color:e.palette.text.primary},e.breakpoints.up("lg"),{overflow:"auto","-webkit-overflow-scrolling":"touch"}),backdrop:{position:"absolute"}}})),w=O.a.forwardRef((function(e,t){var n=Object(x.useRef)(null),i=Object(x.useRef)(null),a=Object(x.useRef)(null),c=T(e),l=e.rightSidebarHeader||e.rightSidebarContent,o=e.leftSidebarHeader||e.leftSidebarContent;return O.a.useImperativeHandle(t,(function(){return{rootRef:a,toggleLeftSidebar:function(){n.current.toggleSidebar()},toggleRightSidebar:function(){i.current.toggleSidebar()}}})),Object(r.jsxs)("div",{className:Object(m.a)(c.root,e.innerScroll&&c.innerScroll),ref:a,children:[Object(r.jsx)("div",{className:c.topBg}
1),Object(r.jsxs)("div",{className:"flex container w-full",children:[o&&Object(r.jsx)(y,{position:"left",header:e.leftSidebarHeader,content:e.leftSidebarContent,variant:e.leftSidebarVariant||"permanent",innerScroll:e.innerScroll,classes:c,ref:n,rootRef:a}),Object(r.jsxs)("div",{className:Object(m.a)(c.contentWrapper,o&&(void 0===e.leftSidebarVariant||"permanent"===e.leftSidebarVariant)&&"lg:ltr:pl-0 lg:rtl:pr-0",l&&(void 0===e.rightSidebarVariant||"permanent"===e.rightSidebarVariant)&&"lg:pr-0"),children:[Object(r.jsx)(d,{header:e.header,classes:c}),Object(r.jsxs)("div",{className:Object(m.a)(c.contentCard,e.innerScroll&&"inner-scroll"),children:[e.contentToolbar&&Object(r.jsx)("div",{className:c.toolbar,children:e.contentToolbar}),e.content&&Object(r.jsx)(p.a,{className:c.content,enable:e.innerScroll,scrollToTopOnRouteChange:e.innerScroll,children:e.content})]})]}),l&&Object(r.jsx)(y,{position:"right",header:e.rightSidebarHeader,content:e.rightSidebarContent,variant:e.rightSidebarVariant||"permanent",innerScroll:e.innerScroll,classes:c,ref:i,rootRef:a})]})]})}));w.defaultProps={};t.a=O.a.memo(w)},1155:function(e,t,n){"use strict";var i=n(397),a=n(8),c=n(2);t.a=function(e){var t=e.columnName,n=e.content,l=e.hideColumnName,o=e.cellClass,r=Object(i.m)(e);return Object(c.jsxs)("div",{className:Object(a.a)(r.reactTableCell,l&&"flex justify-center",o),children:[!l&&Ob
1ject(c.jsx)("span",{className:"text-left pl-2",children:t}),n]})}},1163:function(e,t,n){"use strict";var i=n(3),a=n(381),c=n(1098),l=n(623),o=n(396),r=n(1127),d=n(1103),s=n(313),u=n(2),v=Object(a.a)((function(e){var t;return{root:{"& .title":Object(i.a)({fontFamily:"Inter-Bold, sans-serif",fontSize:"1.8rem"},e.breakpoints.down("md"),{fontSize:"1.4rem"}),"& .dialogContent":Object(i.a)({padding:"20px"},e.breakpoints.down("sm"),{padding:"12px"}),"& .dialog-toolbar":{display:"flex",alignItems:"center",height:"55px"},"& .button-back":Object(i.a)({paddingLeft:"10px",marginLeft:"10px"},e.breakpoints.down("md"),{paddingLeft:"5px",marginRight:0}),"& .button-right":Object(i.a)({minWidth:"70px"},e.breakpoints.down("md"),{margin:0,minWidth:0})},disabledFullHeight:Object(i.a)({height:"auto !important"},e.breakpoints.down("md"),{margin:0,width:"100%",maxHeight:"100%"}),paperFullWidth:Object(i.a)({height:"100%"},e.breakpoints.down("md"),{margin:0,width:"100%",maxHeight:"100%"}),paper:(t={},Object(i.a)(t,e.breakpoints.down("md"),{margin:"0 !important",width:"100% !important",height:"100% !important",maxHeight:"100% !important"}),Object(i.a)(t,e.breakpoints.up("lg"),{maxWidth:"1080px"}),t)}}));t.a=function(e){var t=Object(s.a)().t,n=v(),i=e.open,a=e.onClose,b=e.disabledBackButton,j=void 0!==b&&b,m=e.dialogId,x=e.dialogTitle,O=e.dialogContent,p=e.disabledFullHeight,h=void 0!==p&&p;return Object(u.jsxs)(c.a,{id:m,classes:{paperFullWidth:n.paperFullWidth,paper:h?n.disabledFullHeight:n.paper},className:n.root,fullWidth:!0,maxWidth:"md",open:i,onClose:a,children:[Object(u.jsx)("div",{className:"dialog-appBar bg-white",children:Object(u.jsxs)("div",{className:"dialog-toolbar",children:[Object(u.jsxs)(l.a,{id:"dialog_back",variant:"outlined",color:"primary",className:"button-back",onClick:a,disabled:j,children:[Object(u.jsx)(o.a,{className:"",fontSize:"medium",children:"arrow_back"}),Object(u.jsx)("span",{className:"py-2",children:t("Back")})]}),Object(u.jsx)("div",{className:"title ml-2 flex-1 text-center text-black",children:t(x)}),Object(u.jsx)("div",{className:"button-right"})]})}),Object(u.jsx)(r.a,{}),Object(u.jsx)(d.a,{className:"dialogContent",children:O})]})}},1171:function(e,t,n){"use strict";var i=n(1098),a=n(1111),c=n(1133),l=n(395),o=n(109),r=n(623),d=n(1127),s=n(381),u=n(1184),v=n(1185),b=n(8),j=n(313),m=n(2),x=Object(s.a)((function(e){return{header:{backgroundColor:e.palette.background.primary,color:e.palette.secondary.contrastText},dialog:{height:"100vh"}}}));t.a=function(e){var t=Object(j.a)().t,n=x(),s=e.preview,O=e.handleClose,p=e.fileLink,h=e.fileName,f=e.showDownload,g=void 0===f||f,y=e.showCloseButton,I=void 0!==y&&y;return Object(m.jsxs)(i.a,{fullWidth:!0,maxWidth:"xl",open:s,onClose:O,children:[Object(m.jsx)(a.a,{className:"relative",children:Object(m.jsxs)(c.a,{className:Object(b.a)(n.header,"flex justify-between"),children:[Object(m.jsx)(l.a,{className:"mr-16",color:"action",onClick:O,children:Object(m.jsx)(u.a,{color:"action"})}),Object(m.jsx)(o.a,{variant:"h6",className:"hidden sm:flex ml-2 flex-1",children:t("Preview")}),p&&g&&Object(m.jsx)(r.a,{role:"button",color:"primary",variant:"contained",href:p||"",download:h||"",endIcon:Object(m.jsx)(v.a,{}),children:t("Download")}),I&&Object(m.jsx)(r.a,{color:"inherit",variant:"outlined",onClick:O,children:t("Close")})]})}),Object(m.jsx)(d.a,{}),p?Object(m.jsx)("object",{type:"application/pdf",className:n.dialog,width:"100%",data:p,children:Object(m.jsxs)("div",{className:"p-10",children:[Object(m.jsx)("p",{children:t("Unfortunately, your device's operating system or web browser does not support previewing this file.")}),Object(m.jsx)(r.a,{color:"inherit",variant:"outlined",children:Object(m.jsx)("a",{href:p,download:h||"",children:t("Click here to Download.")})})]})}):Object(m.jsx)("div",{className:"p-10",children:t("Loading")})]})}},1178:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(2);function a(e){return Object(i.jsx)("span",{className:"hidden md:block",children:e.children})}},1179:function(e,t,n){"use strict";var i=n(8),a=n(313),c=n(2);t.a=function(e){var t=e.id,n=e.name,l=e.value,o=e.flexCol,r=void 0!==o&&o,d=e.cssDiv,s=void 0===d?"":d,u=e.cssName,v=void 0===u?"":u,b=e.cssValue,j=void 0===b?"":b,m=Object(a.a)().t,x=Object(c.jsx)("i",{children:m("(Not Found)")});return Object(c.jsxs)("div",{id:t||n,className:Object(i.a)("my-4 flex justify-between",r?"flex-col sm:min-w-128":"flex-row",s),children:[Object(c.jsx)("p",{className:Object(i.a)("truncate",r?"text-center":"mx-10",v),children:Object(c.jsx)("b",{children:m(n)})}),Object(c.jsx)("p",{className:Object(i.a)("truncate",r?"text-center":"",j),children:null!==l&&void 0!==l?l:x})]})}},1208:function(e,t,n){"use strict";n.r(t),n.d(t,"validateInvoiceField",(function(){return l})),n.d(t,"validateInvoiceItemsField",(function(){return o}
1)),n.d(t,"isInvoiceItemAllEmpty",(function(){return r})),n.d(t,"validateInvoiceItem",(function(){return d})),n.d(t,"validateInvoiceSetting",(function(){return s})),n.d(t,"validateInvoice",(function(){return u})),n.d(t,"invoiceErrorsCheck",(function(){return v})),n.d(t,"checkDisabledButtonInvoice",(function(){return b}));var i=n(79),a=n(11),c=n(10);function l(e,t,n){var l=n===c.w.I.name?i.m:i.l;switch(e){case"id":return""===t?a.a.t("Id")+" "+a.a.t("cannot be empty"):!i.I.test(t)&&a.a.t("Id")+" "+a.a.t("must be a number");case"invoiceDate":return""===t?a.a.t("Invoice Date")+" "+a.a.t("cannot be empty"):!i.v.test(t)&&a.a.t("Invoice Date")+" "+a.a.t("must be a Date");case"invoiceExtn.dueDuration":return""!==t&&i.J.test(t)?i.I.test(t)?t<l?a.a.t("Payment Term")+" "+a.a.t("cannot be less than {{number}}",{number:l}):t>i.f&&a.a.t("Payment Term")+" "+a.a.t("cannot be greater than {{number}}",{number:i.f}):a.a.t("Payment Term")+" "+a.a.t("must be a number"):a.a.t("Payment Term")+" "+a.a.t("must be a number with only {{number}} decimal",{number:0});case"dueDurationType":return""===t?a.a.t("Due Duration Type")+" "+a.a.t("cannot be empty"):!i.w.test(t)&&a.a.t("Due Duration Type")+" "+a.a.t("must be a Days, Weeks, Months or Years");case"billToId":return""===t?a.a.t("You forgot to select a customer."):!i.I.test(t)&&a.a.t("Customer")+" "+a.a.t("must be a number");case"taxPercent":return""===t?a.a.t("VAT Percent")+" "+a.a.t("cannot be empty"):!i.M.test(t)&&a.a.t("VAT Percent")+" "+a.a.t("must be a Percent");case"taxAmt":return""===t?a.a.t("Tax Amount")+" "+a.a.t("cannot be empty"):!i.I.test(t)&&a.a.t("Tax Amount")+" "+a.a.t("must be a number");default:return!1}}function o(e,t){switch(e){case"productName":return""===t?a.a.t("Product Name")+" "+a.a.t("cannot be empty"):t.length>i.h&&a.a.t("Max character length is {{number}}",{number:i.h});case"productDescription":return""===t?a.a.t("Product Description")+" "+a.a.t("cannot be empty"):t.length>i.g&&a.a.t("Max character length is {{number}}",{number:i.g});case"lineDate":return""===t?a.a.t("Line Date")+" "+a.a.t("cannot be empty"):!i.v.test(t)&&a.a.t("Line Date")+" "+a.a.t("must be a Date");case"unitCodeMasterId":return""===t?a.a.t("Unit")+" "+a.a.t("cannot be empty"):!i.I.test(t)&&a.a.t("Unit")+" "+a.a.t("must be a Piece, Hour, Days or Km");case"qty":return""===t?a.a.t("Quantity")+" "+a.a.t("cannot be empty"):i.I.test(t)?(parseFloat(t)<=0||parseFloat(t)>=i.d)&&a.a.t("Quantity")+" "+a.a.t("must be more than 0 and smaller than {{number}}",{number:i.d}):a.a.t("Quantity")+" "+a.a.t("must be a number with only {{number}} decimal",{number:i.c});case"inputUnitPrice":return""===t?a.a.t("Unit Price")+" "+a.a.t("cannot be empty"):i.I.test(t)?(parseFloat(t)<=0||parseFloat(t)>=i.d)&&a.a.t("Unit Price")+" "+a.a.t("must be more than 0 and smaller than {{number}}",{number:i.d}):a.a.t("Unit Price")+" "+a.a.t("must be a number with only {{number}} decimal",{number:i.c});case"isTaxIncluded":return""===t?a.a.t("Unit")+" "+a.a.t("cannot be empty"):!i.s.test(t)&&a.a.t("Unit")+" "+a.a.t("must be a Yes or No");default:return!1}}function r(e,t){var n=null===e||void 0===e?void 0:e.invoiceItems[t];return!(""!==n.productName&&null!==n.productName&&n.productName||""!==n.productDescription&&null!==n.productDescription&&n.productDescription||""!==n.qty&&null!==n.qty&&n.qty||""!==n.inputUnitPrice&&null!==n.inputUnitPrice&&n.inputUnitPrice)}var d=function(e){var t,n;return""===(null===e||void 0===e?void 0:e.productName)||null===(null===e||void 0===e?void 0:e.productName)||null===e||void 0===e||!e.productName||(null===e||void 0===e||null===(t=e.productName)||void 0===t?void 0:t.length)>i.h||(""===e.productDescription||null===e.productDescription||!e.productDescription||(null===(n=e.productDescription)||void 0===n?void 0:n.length)>i.g||(""===e.lineDate||null===e.lineDate||!e.lineDate||(""===e.unitCodeLovId||null===e.unitCodeLovId||!e.unitCodeLovId||(""===e.qty||null===e.qty||!e.qty||!i.I.test(e.qty)||parseFloat(e.qty)<=0||parseFloat(e.qty)>=i.d||(""===e.inputUnitPrice||null===e.inputUnitPrice||!e.inputUnitPrice||!i.I.test(e.inputUnitPrice)||parseFloat(e.inputUnitPrice)<=0||parseFloat(e.inputUnitPrice)>=i.d)))))},s=function(e){var t,n,l,o,r,d,s,u,v,b,j,m=(null===e||void 0===e||null===(t=e.billTo)||void 0===t?void 0:t.customerType)===c.w.I.name?i.m:i.l;return""!==e.invoiceDate&&e.invoiceDate&&null!==e.invoiceDate?null===(n=e.invoiceExtn)||void 0===n||!n.dueDuration||""===(null===(l=e.invoiceExtn)||void 0===l?void 0:l.dueDuration)||null===(null===(o=e.invoiceExtn)||void 0===o?void 0:o.dueDuration)||(null===(r=e.invoiceExtn)||void 0===r?void 0:r.dueDuration)<m||!i.J.test(null===(d=e.invoiceExtn)||void 0===d?void 0:d.dueDuration)?{isErrors:!0,message:"".concat(a.a.t("Payment Term")," ").concat(a.a.t("must be a number"))+";
1 "+a.a.t("cannot be less than {{number}}",{number:m})}:""!==(null===(s=e.invoiceExtn)||void 0===s?void 0:s.dueDuration)&&(null===(u=e.invoiceExtn)||void 0===u?void 0:u.dueDuration)>i.f?{isErrors:!0,message:"".concat(a.a.t("Payment Term"))+a.a.t("cannot be greater than {{number}}",{number:i.f})}:null!==(v=e.invoiceExtn)&&void 0!==v&&v.dueDurationType&&""!==(null===(b=e.invoiceExtn)||void 0===b?void 0:b.dueDurationType)&&null!==(null===(j=e.invoiceExtn)||void 0===j?void 0:j.dueDurationType)?{isErrors:!1}:{isErrors:!0,message:"".concat(a.a.t("Due Duration Type")," ").concat(a.a.t("cannot be empty"))}:{isErrors:!0,message:"".concat(a.a.t("Invoice Date")," ").concat(a.a.t("cannot be empty"))}},u=function(e){var t,n,i,c,l,o;return e.billToId&&""!==e.billToId&&null!==e.billToId?null!==(t=e.invoiceExtn)&&void 0!==t&&t.dueDuration&&""!==(null===(n=e.invoiceExtn)||void 0===n?void 0:n.dueDuration)&&null!==(null===(i=e.invoiceExtn)||void 0===i?void 0:i.dueDuration)?null!==(c=e.invoiceExtn)&&void 0!==c&&c.dueDurationType&&""!==(null===(l=e.invoiceExtn)||void 0===l?void 0:l.dueDurationType)&&null!==(null===(o=e.invoiceExtn)||void 0===o?void 0:o.dueDurationType)?!e.invoiceItems||e.invoiceItems.length<1?{isErrors:!0,message:a.a.t("Have you filled out all the invoice rows?")}:function(e){var t=[];return e.map((function(e){return""!==e.productDescription&&null!==e.productDescription&&e.productDescription&&""!==e.productDescription&&null!==e.productDescription&&e.productDescription&&""!==e.lineDate&&null!==e.lineDate&&e.lineDate&&""!==e.qty&&null!==e.qty&&e.qty&&""!==e.unitCodeLovId&&null!==e.unitCodeLovId&&e.unitCodeLovId&&""!==e.inputUnitPrice&&null!==e.inputUnitPrice&&e.inputUnitPrice?t.push(!1):t.push(!0),!1})),t}(e.invoiceItems).includes(!0)?{isErrors:!0,message:a.a.t("Something is missing on your invoice rows, can you please check them?")}:{isErrors:!1}:{isErrors:!0,message:"".concat(a.a.t("Due Duration Type")," ").concat(a.a.t("cannot be empty"))}:{isErrors:!0,message:"".concat(a.a.t("Payment Term")," ").concat(a.a.t("cannot be empty"))}:{isErrors:!0,message:a.a.t("You forgot to select a customer.")}},v=function(e){var t={isErrors:!1};return Object.keys(e).forEach((function(n){"invoiceItems"===n&&e[n].forEach((function(e){0!==Object.keys(e).length&&(t={isErrors:!0,message:a.a.t("Something is missing on your invoice rows, can you please check them?")})}))})),t},b=function(e,t){return u(e).isErrors||v(t).isErrors}},1244:function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var i=n(9),a=n(33),c=n(19),l=n(25),o=n(381),r=n(623),d=n(396),s=n(1051),u=n(1150),v=n(397),b=n(8),j=n(0),m=n.n(j),x=n(313),O=n(16),p=n(21),h=n(2),f=Object(o.a)({option:{padding:0},label:{padding:0}});function g(e){var t=Object(x.a)().t,n=f(),o=(Object(v.m)(),Object(O.c)((function(e){return e.auth.user})).role),j=e.userCustomersList,g=e.handleAddCustomer,y=e.searchCustomer,I=e.handleSearchCustomer,N=e.handleCheckCustomer,T=e.variant,w=void 0===T?"standard":T,A=e.defaultValue,C=void 0===A?null:A,D=e.className,k=void 0===D?"":D,E={nickname:t("---Add New Customer---")},S=m.a.useState(null),P=Object(c.a)(S,2),F=P[0],R=P[1];return Object(h.jsx)(u.a,{id:"select-customer",className:Object(b.a)(k,"w-full justify-start"),classes:{option:n.option},clearOnBlur:!1,inputValue:y,onInputChange:function(e,t){I(t)},value:C||F,onChange:function(e,t){t&&t.nickname!==E.nickname?(R(t),N(t)):I("")},getOptionSelected:function(e,t){return e.nickname===t.nickname},getOptionLabel:function(e){return e.nickname},renderOption:function(e){var i,a,c;return Object(h.jsx)("div",{className:"border-b-1 border-gray-400 flex w-full justify-between p-0",children:e.nickname===E.nickname?Object(h.jsxs)(r.a,{variant:"text",color:"primary",id:"addCustomer",classes:{label:n.label},className:"p-20 px-8 w-full justify-start",onClick:function(){return l.a.push(Object(p.bb)(o)?"/customers/all-employee/new":"/customers/new")},children:[Object(h.jsx)(d.a,{fontSize:"small",children:"add"})," ",Object(h.jsx)("span",{children:t("Add New Customer")})]}):Object(h.jsx)("div",{className:"p-12 flex-1",children:Object(h.jsxs)("div",{children:[Object(h.jsx)("span",{children:e.nickname}),Object(h.jsx)("span",{children:null!==(i=e.company)&&void 0!==i&&i.registrationNumber?" - ".concat(e.company.registrationNumber," - "):" - "}),Object(h.jsx)("span",{children:(null===e||void 0===e?void 0:e.invoiceEmail)||(null===e||void 0===e||null===(a=e.individualTrader)||void 0===a?void 0:a.invoiceEmail)}),Object(h.jsx)("span",{children:null!==(c=e.companyOvt)&&void 0!==c&&c.ovtCode?"".concat(e.companyOvt.ovtCode):""})]})})})},options:j.length>0?[].concat(Object(a.a)(j),[E]):[],noOptionsText:Object(h.jsxs)(h.Fragment,{children:[y.length>0?Object(h.jsxs)("div",{className:"p-8 text-black",onMouseDown:g,role:"presentation",children:[t("You have not any customer with search term:"),Object(h.jsxs)("span",{className:"obviously-bold",children:[' "',"".concat(y),'"']}),", "," ",t("please add new customer")]}):Object(h.jsx)("div",{className:"p-8 text-black",onMouseDown:g,role:"presentation",children:t("No Customer Found")}),Object(h.jsxs)(r.a,{variant:"contained",color:"primary",id:"addCustomer",onMouseDown:g,children:[Object(h.jsx)(d.a,{fontSize:"small",children:"add"})," ",Object(h.jsx)("span",{children:t("Add New Customer")})]})]}),renderInput:function(e){return Object(h.jsx)(s.a,Object(i.a)(Object(i.a)({},e),{},{label:t("Select Customer"),variant:w,InputProps:Object(i.a)({},e.InputProps)}))}})}},1330:function(e,t,n){"use strict";var i=n(19),a=n(3),c=n(15),l=n(109),o=n(623),r=n(396),d=n(1186),s=n(381),u=n(10),v=n(21),b=n(175),j=n(26),m=n(8),x=n(71),O=n(65),p=n.n(O),h=n(0),f=n(313),g=n(16),y=n(46),I=n(159),N=n(240),T=n(1171),w=n(403),A=n(410),C=n(1127),D=n(1051),k=n(397),E=n(1163),S=n(1179),P=n(95),F=n(2);var R=function(e){var t=Object(f.a)().t,n=Object(g.b)(),a=e.openReclamationReason,
1c=e.setOpenReclamationReason,r=e.billerUserId,d=e.invoiceId,s=Object(g.c)((function(e){return e.auth.user})).role,u=Object(g.c)((function(e){return e.oneFreeApp.userProfile})).userProfile,x=Object(h.useState)(""),O=Object(i.a)(x,2),p=O[0],y=O[1];return Object(h.useEffect)((function(){a&&n(Object(P.w)(r))}),[n,a]),Object(F.jsx)(F.Fragment,{children:Object(v.bb)(s)&&Object(F.jsx)(E.a,{open:a,onClose:function(){c(!1)},dialogId:"reclamationReason",disabledFullHeight:!0,dialogTitle:"Reclamation Reason",dialogContent:Object(F.jsxs)("div",{className:"mb-20",children:[u&&Object(F.jsxs)("div",{children:[Object(F.jsx)(S.a,{name:"User Id",value:u.id,cssDiv:"sm:justify-start",cssName:"sm:min-w-200"}),Object(F.jsx)(S.a,{name:"User Primary Email",value:u.primaryEmail,cssDiv:"sm:justify-start",cssName:"sm:min-w-200"}),Object(F.jsx)(S.a,{name:"User Default Lang",value:u.defaultLang,cssDiv:"sm:justify-start",cssName:"sm:min-w-200"}),Object(F.jsx)(C.a,{className:"my-10"}),Object(F.jsx)(l.a,{variant:"body2",className:"my-10",children:"".concat(t("Add Reclamation reason")," ").concat("fi"===u.defaultLang?t("in Finnish"):t("in English"))})]}),Object(F.jsx)(D.a,{className:"w-full my-20",type:"text",required:!0,label:t("Reason for reclamation?"),id:"reclamationReason",value:p,onChange:function(e){y(e.target.value)},InputLabelProps:{shrink:!0}}),Object(F.jsxs)("div",{className:k.j,children:[Object(F.jsx)(o.a,{type:"submit",className:Object(m.a)(k.a,"sm:mr-10"),id:"rejectAgreement",variant:"contained",color:"primary",disabled:!p,onClick:function(){Object(v.m)((function(){n(Object(b.bb)({id:d,customerComplaint:p})),n(Object(j.a)()),c(!1)}),"Are you sure to send reclamation email?",n)},children:t("Save")}),Object(F.jsx)(o.a,{className:k.a,id:"cancel",variant:"contained",color:"primary",onClick:function(){c(!1)},children:t("Cancel")})]})]})})})},L=n(1244),V=n(33),U=n(59),Y=n(395),B=n(625),H=n(1392),_=n(1393),M=n(1152),q=n(1046),W=n(42),z=n(1155),J=n(1178),X=n(1208);var Z=function(e){var t,n=e.invoiceErrors,i=e.handleInvoiceItemRowChange,a=e.handleSaveInvoiceItem,l=e.handleCancelChange,d=e.invoice,s=e.handleEditInvoiceItem,u=e.handleCopyInvoiceItem,j=e.handleDeleteInvoiceItem,m=e.vatsCurrent,x=e.row,O=Object(f.a)().t,y=Object(g.b)(),I=Object(W.useLocation)().path,N=Object(U.a)(),T=Object(g.c)((function(e){return e.i18n.language})),w=Object(g.c)((function(e){return e.oneFreeApp.utils.unitCodeActive})),C=Object(g.c)((function(e){return e.oneFreeApp.invoices})),k=C.editAdvancedInvoice,E=C.editInvoiceItemIndex,S=C.isEditInvoiceItem,P=null===n||void 0===n||null===(t=n.invoiceItems)||void 0===t?void 0:t[E],R=P&&Object.values(P)[0],L=P&&Object.keys(P)[0],Z=function(e){var t,n;return e&&(null===d||void 0===d||null===(t=d.expense)||void 0===t||null===(n=t.expenseItems)||void 0===n?void 0:n.find((function(t){return(null===t||void 0===t?void 0:t.invoiceItemId)===e})))};Object(h.useEffect)((function(){w||y(Object(A.c)())}),[y,w]),Object(h.useEffect)((function(){y(Object(b.i)()),y(Object(b.db)(!1))}),[I]);var G=Object(h.useMemo)((function(){return[{classHeader:!k&&"hidden",className:!k&&"hidden",accessor:"controls",Cell:function(e){var t=e.row;return Object(F.jsx)(z.a,{content:(null===t||void 0===t?void 0:t.index)!==E?Object(F.jsxs)("div",{className:"flex w-full justify-center gap-x-12",children:[Object(F.jsx)(Y.a,{id:"itemControls-".concat(t.index),color:"primary",variant:"primary",onClick:function(){return s(t.index)},disabled:!!Z(t.original.id)||(null===t||void 0===t?void 0:t.index)!==E&&S,children:Object(F.jsx)(H.a,{})}),Object(F.jsx)(Y.a,{id:"itemDelete-".concat(t.index),variant:"text",color:"primary",onClick:function(){return u(t.index)},disabled:!!Z(t.original.id)||(null===t||void 0===t?void 0:t.index)!==E&&S,children:Object(F.jsx)(r.a,{children:"content_copy"})}),Object(F.jsx)(Y.a,{id:"itemDelete-".concat(t.index),onClick:function(){return j(t.index)},disabled:!!Z(t.original.id)||(null===t||void 0===t?void 0:t.index)!==E&&S,children:Object(F.jsx)(_.a,{})})]}):Object(F.jsxs)("div",{className:"flex w-full justify-center gap-x-12 mt-10 lg:mt-0",children:[Object(F.jsx)(o.a,{variant:"contained",color:"primary",disabled:null===X||void 0===X?void 0:X.validateInvoiceItem(t.original),onClick:a,children:O("Save")}),Object(F.jsx)(o.a,{color:"secondary",variant:"outlined",onClick:l,children:O("Cancel")})]})})}},{Header:function(){return Object(F.jsx)(J.a,{children:O("Date")})},classHeader:"text-12",className:"p-2 sm:p-8",accessor:"lineDate",Cell:function(e){var t;return Object(F.jsx)(z.a,{columnName:O("Date"),content:k&&S&&(null===e||void 0===e?void 0:e.row.index)===E?Object(F.jsx)(D.a,{className:"md:min-w-96 w-160",variant:"outlined",id:"lineDate",name:"lineDate",type:"date",disabled:!!Z(null===e||void 0===e||null===(t=e.row)||void 0===t?void 0:t.id),required:!0,value:x.lineDate||e.value,onChange:i(E),InputLabelProps:{shrink:!0}}):Object(F.jsx)("span",{children:e.value?p()(e.value).format("DD.MM.YYYY"):O("(not set)")})})}},{Header:function(){return Object(F.jsx)(J.a,{children:O("Product")})},classHeader:"text-12",className:"p-2 sm:p-8",accessor:"productName",Cell:function(e){return Object(F.jsx)(z.a,{columnName:O("Product"),content:k&&S&&(null===e||void 0===e?void 0:e.row.index)===E?Object(F.jsx)(F.Fragment,{children:Object(F.jsx)(D.a,{className:"md:min-w-96 w-160",variant:"outlined",id:"productName",name:"productName",placeholder:O("(Required)"),value:x.productName||"",onChange:i(E),InputLabelProps:{shrink:!0}})}):Object(F.jsx)("span",{children:e.value})})}},{Header:function(){return Object(F.jsxs)(J.a,{children:[" ",O("Description")]})},classHeader:"text-12",className:"p-2 sm:p-8",accessor:"productDescription",Cell:function(e){return Object(F.jsx)(z.a,{columnName:O("Description"),autoFocus:!0,content:k&&S&&(null===e||void 0===e?void 0:e.row.index)===E?Object(F.jsx)(D.a,{className:"md:min-w-96 w-160",variant:"outlined",id:"productDescription",name:"productDescription",placeholder:O("(Required)"),value:x.productDescription||"",onChange:i(E),InputLabelProps:{shrink:!0}}):Object(F.jsx)("span",{children:e.value})})}},{Header:function(){return Object(F.jsx)(J.a,{children:O("Quantity")})},classHeader:"text-12",className:"p-2 sm:p-8",accessor:"qty",Cell:function(e){return Object(F.jsx)(z.a,{columnName:O("Quantity"),content:k&&S&&(null===e||void 0===e?void 0:e.row.index)===E?Object(F.jsx)(D.a,{className:"md:min-w-64 w-160",variant:"outlined",placeholder:O("(Required)"),id:"qty",name:"qty",value:x.qty.toString().replace(".",",")||"",onChange:i(E)}):Object(F.jsx)("span",{children:e.value.toString().replace(".",",")})})}},{Header:function(){return Object(F.jsx)(J.a,{children:O("Unit")})},classHeader:"text-12",className:"p-2 sm:p-8",accessor:"unitCodeLovId",Cell:function(e){return Object(F.jsx)(z.a,{columnName:O("Unit"),content:k&&S&&(null===e||void 0===e?void 0:e.row.index)===E?Array.isArray(w)&&Object(F.jsx)(D.a,{select:!0,variant:"outlined",required:!0,id:"unitCodeLovId",name:"unitCodeLovId",value:x.unitCodeLovId||e.value,onChange:i(E),InputLabelProps:{shrink:!0},children:w.map((function(e){return Object(F.jsx)(B.a,{value:e.id,children:O(c.a.capitalize(e.name))},e.id)}))}):Array.isArray(w)&&v.O(T,e.value,w)})}},{Header:function(){return Object(F.jsx)(J.a,{children:O("Unit Price")})},classHeader:"text-12",className:"p-2 sm:p-8",accessor:"unitPriceWithoutTax",Cell:function(e){return Object(F.jsx)(z.a,{columnName:O("Unit Price"),content:k&&S&&(null===e||void 0===e?void 0:e.row.index)===E?Object(F.jsx)(D.a,{className:"md:min-w-64 w-160",variant:"outlined",placeholder:O("(Required)"),id:"inputUnitPrice",name:"inputUnitPrice",value:x.inputUnitPrice.toString().replace(".",",")||"",onChange:i(E)}):Object(F.jsx)("span",{children:v.s((null===e||void 0===e?void 0:e.value)||0)})})}},{Header:function(){return Object(F.jsx)(J.a,{children:"".concat(O("VAT")," %")})},classHeader:"text-12",className:"p-2 sm:p-8",accessor:"taxPercent",Cell:function(e){var t;return Object(F.jsx)(z.a,{columnName:"".concat(O("VAT")," %"),content:k&&S&&(null===e||void 0===e?void 0:e.row.index)===E?Array.isArray(m)&&Object(F.jsx)(D.a,{select:!0,variant:"outlined",error:n&&!!n.taxPercent,helperText:n&&n.taxPercent,id:"taxPercent",name:"taxPercent",value:x.taxPercent||e.value,disabled:!!Z(null===(t=e.row)||void 0===t?void 0:t.id),onChange:i(E),InputLabelProps:{shrink:!0},children:m.map((function(t){var n=t.startDate?p()(t.startDate):null,i=t.endDate?p()(t.endDate):null,a=n&&p()(e.row.original.lineDate).isBefore(n)||i&&p()(e.row.original.lineDate).isAfter(i);return Object(F.jsx)(B.a,{id:t.id,value:t.taxPercent,disabled:a,children:O(t.label)},t.id)}))}):Object(F.jsx)("span",{children:v.qb((null===e||void 0===e?void 0:e.value)||0)})})}},{Header:function(){return Object(F.jsx)(J.a,{children:"".concat(O("VAT Included"))})},classHeader:"text-12",className:"p-2 sm:p-8",accessor:"isTaxIncluded",Cell:function(e){return Object(F.jsx)(z.a,{columnName:"".concat(O("VAT Included")),content:k&&S&&(null===e||void 0===e?void 0:e.row.index)===E?Object(F.jsxs)(D.a,{select:!0,variant:"outlined",id:"isTaxIncluded",name:"isTaxIncluded",value:x.isTaxIncluded||(null===e||void 0===e?void 0:e.value),onChange:i(E),children:[Object(F.jsx)(B.a,{value:!0,children:O("Yes")},"true"),Object(F.jsx)(B.a,{value:!1,children:O("No")},"false")]}):Object(F.jsx)("span",{children:null!==e&&void 0!==e&&e.value?O("Yes"):O("No")})})}},{Header:function(){return Object(F.jsx)(J.a,{children:O("Net Amount")})},classHeader:"text-12",className:"p-2 sm:p-8 min-w-96",accessor:"lineWithoutTaxAmt",Cell:function(e){return Object(F.jsx)(z.a,{columnName:O("Net Amount"),content:v.s((x&&k&&S&&(null===e||void 0===e?void 0:e.row.index)===E?x.lineWithoutTaxAmt:null===e||void 0===e?void 0:e.value)||0)})}},{Header:function(){return Object(F.jsx)(J.a,{children:O("VAT Amount")})},classHeader:"text-12",className:"p-2 sm:p-8 min-w-96",accessor:"lineTaxAmt",Cell:function(e){return Object(F.jsx)(z.a,{columnName:O("VAT Amount"),content:v.s((x&&k&&S&&(null===e||void 0===e?void 0:e.row.index)===E?x.lineTaxAmt:null===e||void 0===e?void 0:e.value)||0)})}},{Header:function(){return Object(F.jsx)(J.a,{children:O("Total Amount")})},classHeader:"text-12",className:"p-2 sm:p-8 min-w-96",accessor:"lineTotalAmt",Cell:function(e){return Object(F.jsx)(z.a,{columnName:O("Total Amount"),content:v.s((x&&k&&S&&(null===e||void 0===e?void 0:e.row.index)===E?x.lineTotalAmt:null===e||void 0===e?void 0:e.value)||0)})}}]}),[k,S,E,i,null===d||void 0===d?void 0:d.invoiceItems.length,!S&&j,w,X]),K=null===d||void 0===d?void 0:d.invoiceItems,Q=Object(h.useMemo)((function(){return(K?Object(V.a)(K):[]).sort((function(e,t){return Object(q.a)(null===t||void 0===t?void 0:t.lineDate)-Object(q.a)(null===e||void 0===e?void 0:e.lineDate)}))}),[K]);return Object(F.jsx)(M.a,{columns:G,data:k?K:Q,error:R,editInvoiceItemId:L,editInvoiceItemIndex:E,rowProps:function(e){return(null===e||void 0===e?void 0:e.index)===E&&S&&{style:{backgroundColor:N.palette.background.default,he
1ight:"110px"}}}})},G=n(9),K=n(212),Q=n(234),$=n(143),ee=n(398),te=n(237),ne=n(238),ie=n(120),ae=n(14),ce=n(1150),le=n(244),oe="SELECT_REASON",re="INFO",de="CHANGE_VAT_NUMBER",se=function(e){var t,n,a=Object(f.a)().t,r=Object(g.c)((function(e){return e.i18n.language})),d=Object(g.b)(),s=Object(g.c)((function(e){return e.oneFreeApp.location.euCountries})),v=Object(h.useState)(oe),b=Object(i.a)(v,2),j=b[0],m=b[1],x=Object(h.useState)(""),O=Object(i.a)(x,2),p=O[0],y=O[1],I=e.openVatReasonDialog,N=e.filteredZeroVatsOptions,T=e.closeVatReasonDialog,A=e.handleSelectVatZero,C=e.invoice,k=e.setInvoice,S=e.setOpenVatReasonDialog;Object(h.useEffect)((function(){0===s.length&&d(Object(le.e)())}),[d,s]);var P=null===s||void 0===s?void 0:s.find((function(e){var t,n;return(null===e||void 0===e?void 0:e.code)===(null===C||void 0===C||null===(t=C.billTo)||void 0===t||null===(n=t.company)||void 0===n?void 0:n.registeredCountryCode)})),R=P?N:null===N||void 0===N?void 0:N.filter((function(e){return(null===e||void 0===e?void 0:e.name)!==u.pd.TAXFREE_SALES_INSIDE_EU})),L=null===C||void 0===C||null===(t=C.billTo)||void 0===t||null===(n=t.company)||void 0===n?void 0:n.vatNumber;return Object(h.useEffect)((function(){m(oe)}),[I]),Object(F.jsx)(E.a,{open:I,onClose:T,dialogId:"dialogZeroVats",dialogTitle:"Reason for invoicing VAT 0%",dialogContent:Object(F.jsxs)("div",{children:[j===oe&&Object(F.jsx)(F.Fragment,{children:Array.isArray(R)?Object(F.jsx)(ce.a,{id:"zeroVats",name:"zeroVats",options:R,getOptionLabel:function(e){var t;return Array.isArray(null===e||void 0===e?void 0:e.lovLangs)&&(null===(t=e.lovLangs.find((function(e){return(null===e||void 0===e?void 0:e.lang)===r})))||void 0===t?void 0:t.label)||""},onChange:function(e,t){!function(e){e.name!==u.pd.TAXFREE_SALES_INSIDE_EU||L?A(e):m(re)}(t)},renderInput:function(e){return Object(F.jsx)(D.a,Object(G.a)(Object(G.a)({},e),{},{label:a("Select"),InputLabelProps:{shrink:!0}}))}}):a("Loading")}),j===re&&Object(F.jsxs)("div",{children:[Object(F.jsx)(l.a,{variant:"h5",className:"mb-10 mt-10 text-center",children:a("Please add valid customer VAT number to the customer or alternatively select a different VAT percent or reasoncode.")}),Object(F.jsxs)("div",{className:"flex gap-8",children:[Object(F.jsx)(o.a,{onClick:function(){m(de)},className:"p-8 my-16 w-full mr-10",variant:"contained",color:"primary",children:Object(F.jsx)("span",{children:a("Change VAT number")})}),Object(F.jsx)(o.a,{onClick:function(){S(!1)},className:"p-8 my-16 w-full mr-10",variant:"contained",color:"secondary",children:Object(F.jsx)("span",{children:a("Reselect VAT percent")})}),Object(F.jsx)(o.a,{onClick:function(){m(oe)},className:"p-8 my-16 w-full mr-10",variant:"contained",color:"primary",children:Object(F.jsx)("span",{children:a("Reselect VAT reasoncode")})})]})]}),j===de&&Object(F.jsxs)("div",{className:"text-center max-w-400 flex flex-col gap-20 mx-auto",children:[Object(F.jsxs)("div",{className:"flex flex-col gap-10",children:[Object(F.jsx)(l.a,{variant:"h5",children:a("Please enter valid VAT number")}),Object(F.jsxs)(l.a,{variant:"body2",children:[a("Country"),": ",Object(F.jsx)("strong",{children:null===P||void 0===P?void 0:P.name})]})]}),Object(F.jsx)(D.a,{id:"newVATNumber",name:"newVATNumber",label:"New VAT number",value:p,fullWidth:!0,onChange:function(e){return y(e.target.value)}}),Object(F.jsx)(o.a,{onClick:function(){var e;d(Object(w.m)({userCustomerId:null===C||void 0===C||null===(e=C.billTo)||void 0===e?void 0:e.id,dataToSend:{vatNumber:p}})).unwrap().then((function(e){k((function(t){return c.a.set(Object(G.a)({},t),"billTo",e)})),A(R.find((function(e){return e.name===u.pd.TAXFREE_SALES_INSIDE_EU})))}))},className:"p-8 px-0 my-16 mr-8",variant:"contained",color:"primary",children:Object(F.jsx)("span",{children:a("Change VAT number")})})]})]})})};var ue=function(e){var t,n,a,l=Object(f.a)().t,d=Object(g.b)(),s=Object(k.m)(e),j=e.invoice,x=e.setInvoice,O=e.invoiceErrors,y=e.setInvoiceErrors,I=e.confirmDialog,N=e.calculateInvoiceValues,T=e.removeInvoiceItem,w=Object(ee.a)(),C=Object(g.c)((function(e){return e.oneFreeApp.utils.unitCodeActive})),D=Object(g.c)((function(e){return e.oneFreeApp.utils.vatsCurrent})),E=Object(g.c)((function(e){return e.oneFreeApp.utils.zeroVats})),S=Object(g.c)((function(e){return e.oneFreeApp.invoices})),P=S.isEditInvoiceItem,R=(S.editInvoiceItemIndex,Object(g.c)((function(e){return e.oneFreeApp.invoices.comingFromAddNewRow}))),L=null===j||void 0===j||null===(t=j.billTo)||void 0===t||null===(n=t.billingAddress)||void 0===n?void 0:n.countryCode;E=Object(h.useMemo)((function(){return w===u.Pc.FREE_KEVYTYRITTAJA.name&&Array.isArray(E)?E.filter((function(e){return![u.pd.TAX_LAW_3,u.pd.TAX_LAW_35].includes(null===e||void 0===e?void 0:e.name)})):E}),[E,w]);var U=Object(h.useState)(!1),Y=Object(i.a)(U,2),B=Y[0],H=Y[1],_=Object(h.useState)(0),M=Object(i.a)(_,2),q=M[0],W=M[1],z=null===j||void 0===j?void 0:j.invoiceItems[q];Object(h.useEffect)((function(){d(Object(b.gb)({totalAmt:j.totalAmt,subTotalAmt:j.subTotalAmt,taxAmt:j.taxAmt}))}),[j.totalAmt,j.subTotalAmt,j.taxAmt]),Object(h.useEffect)((function(){C||d(Object(A.c)())}),[d,C]),Object(h.useEffect)((function(){D||d(Object(A.d)())}),[d,D]),Object(h.useEffect)((function(){E||d(Object(A.e)())}),[d,E]),Object(h.useEffect)((function(){R&&j&&Array.isArray(j.invoiceItems)&&(null===j||void 0===j?void 0:j.invoiceItems.length)>0&&(J(),Q(1))}),[null===j||void 0===j?void 0:j.id,R]);var J=function(){var e=c.a.cloneDeep(K.e),t=Object(V.a)(null===j||void 0===j?void 0:j.invoiceItems);t.push(Object(G.a)(Object(G.a)({},e),{},{lineDate:null===j||void 0===j?void 0:j.invoiceDate,unitCodeLovId:Array.isArray(C)&&C.find((function(e){return"piece"===e.name.toLowerCase()})).id,taxPercent:u.Db.TAX_PERCENT})),x(c.a.set(Object(G.a)({},j),"invoiceItems",t)),W(t.length-1)},Q=function(e){d(Object(b.fb)(e)),d(Object(b.hb)(!0)),W(e)},$=function(e){H(!1),x((function(t){return c.a.set(Object(G.a)({},t),"invoiceItems[".concat(q,"].zeroVatLovId"),(null===e||void 0===e?void 0:e.id)||null)}))},te=Object(h.useCallback)((function(){x((function(e){return c.a.set(Object(G.a)({},e),"invoiceItems[".concat(q,"].zeroVatLovId"),null)}))}),[q]),ne=Object(h.useCallback)((function(e){return function(t){!function(e,t,n){!1!==X.validateInvoiceItemsField(t,n)?y(c.a.set(Object(G.a)({},O),"invoiceItems[".concat(e,"].").concat(t),X.validateInvoiceItemsField(t,n))):y(c.a.omit(Object(G.a)({},O),"invoiceItems[".concat(e,"].").concat(t)))}
1(e,t.target.name,"inputUnitPrice"===t.target.name||"qty"===t.target.name?t.target.value.replace(",",".").replace(/[^0-9,.]/g,""):t.target.value);var n=p()(t.target.value).isSameOrAfter(u.Bd)?u.Ad:u.zd;"lineDate"===t.target.name&&x((function(t){var i=c.a.set(Object(G.a)({},t),"invoiceItems[".concat(e,"].taxPercent"),n);return N(i),i})),"taxPercent"===t.target.name&&0===t.target.value?H(!0):"taxPercent"===t.target.name&&0!==t.target.value&&te(),x((function(n){var i=c.a.set(Object(G.a)({},n),"invoiceItems[".concat(e,"].").concat(t.target.name),"inputUnitPrice"===t.target.name||"qty"===t.target.name?t.target.value.replace(",",".").replace(/[^0-9,.]/g,""):t.target.value);return"qty"!==t.target.name&&"inputUnitPrice"!==t.target.name&&"isTaxIncluded"!==t.target.name&&"taxPercent"!==t.target.name||N(i),i}))}}),[te]),ie=Object(h.useMemo)((function(){var e;return L===u.Y?null===(e=E)||void 0===e?void 0:e.filter((function(e){return![u.pd.INTRA_COMMUNITY_SUPPLY_OF_GOODS,u.pd.TAXFREE_SALES_OUTSIDE_EU_VAT].includes(e.name)})):E}),[L,E]);return Object(F.jsxs)("div",{id:"invoiceItem",className:Object(m.a)(s.columnWrapper,"mt-16"),children:[Object(F.jsx)("div",{className:Object(m.a)(s.rightColumn,"w-full m-0"),children:Object(F.jsxs)("div",{className:(null===j||void 0===j?void 0:j.invoiceItems.length)>0?s.guideContainerActive:s.guideContainer,children:[(null===j||void 0===j||null===(a=j.invoiceItems)||void 0===a?void 0:a.length)>0&&Object(F.jsx)(F.Fragment,{children:Object(F.jsx)(Z,{invoiceErrors:O,handleInvoiceItemRowChange:ne,handleSaveInvoiceItem:function(){X.validateInvoiceItem(z)||(!function(){var e=null===j||void 0===j?void 0:j.invoiceItems[q],t=Object(G.a)(Object(G.a)({},e),{},{invoiceId:null===j||void 0===j?void 0:j.id,tenantId:j.tenantId});j&&!j.id?d(Object(b.p)({invoice:j,invoiceItemVo:t})):null!==e&&void 0!==e&&e.id?d(Object(b.v)({invoice:j,invoiceItemId:e.id,invoiceItemIndex:q,invoiceItemVo:t})):d(Object(b.q)({invoice:j,invoiceItemIndex:q,invoiceItemVo:t}))}(),d(Object(b.i)())),d(Object(b.db)(!1))},handleCancelChange:function(){y({}),d(Object(b.i)()),null!==j&&void 0!==j&&j.id?d(Object(b.y)({invoiceId:null===j||void 0===j?void 0:j.id})):T(q),d(Object(b.db)(!1))},invoice:j,handleEditInvoiceItem:Q,handleCopyInvoiceItem:function(e){X.validateInvoiceItem(null===j||void 0===j?void 0:j.invoiceItems[e])?Object(v.Db)(d,null,"Cannot copy this invoice row","Please fill all required fields first",null,"OK"):function(e){var t=null===j||void 0===j?void 0:j.invoiceItems[e],n=j.invoiceItems,i=c.a.cloneDeep(Object(G.a)(Object(G.a)({},K.e),t));if(i.id=null,i.lineDate=p()(t.lineDate,"YYYY-MM-DD").format("YYYY-MM-DD"),n.push(i),x((function(e){var t=c.a.set(Object(G.a)({},e),"invoiceItems",n);return N(t),t})),!X.validateInvoiceItem(i)){var a=Object(G.a)(Object(G.a)({},i),{},{invoiceId:null===j||void 0===j?void 0:j.id});d(Object(b.q)({invoice:j,invoiceItemIndex:n.length-1,invoiceItemVo:a}))}}(e)},handleDeleteInvoiceItem:function(e){console.log("INDEX handleDeleteInvoiceItem",e),Array.isArray(null===j||void 0===j?void 0:j.invoiceItems)&&1===j.invoiceItems.length?Object(v.Db)(d,null,"Cannot delete this row","You need to have at least one row",null,"OK"):I("invoice",e)},vatsCurrent:D,row:z,handleSelectVatZero:$})}),Object(F.jsxs)(o.a,{id:"invoiceItemAddRow",className:"mt-12",variant:"outlined",color:"default",onClick:function(){var e=X.invoiceErrorsCheck(O),t=X.validateInvoice(j);0===(null===j||void 0===j?void 0:j.invoiceItems.length)?J():e.isErrors?d(Object(ae.c)({message:e.message,variant:"error"})):t.isErrors?d(Object(ae.c)({message:t.message,variant:"error"})):(J(),Q(null===j||void 0===j?void 0:j.invoiceItems.length))},disabled:P,children:[Object(F.jsx)(r.a,{className:"mr-2",fontSize:"small",children:"add"})," ",l("Add Row")]})]})}),Object(F.jsx)(se,{openVatReasonDialog:B,filteredZeroVatsOptions:ie,invoice:j,setInvoice:x,closeVatReasonDialog:function(){var e=p()(z.lineDate).isSameOrAfter(u.Bd)?u.Ad:u.zd;H(!1),te(),x((function(t){return c.a.set(Object(G.a)({},t),"invoiceItems[".concat(q,"].taxPercent"),e)}))},handleSelectVatZero:$,setOpenVatReasonDialog:H})]})};var ve=Object($.a)("oneFreeApp",Q.a)((function(){var e,t=Object(g.b)(),n=Object(W.useParams)(),a=n.type,l=void 0===a?"edit":a,o=n.invoiceId,r=n.userCustomerId,d=Object(ee.a)(),s=Object(g.c)((function(e){return e.oneFreeApp.invoices.comingFromAddNewRow})),m=Object(g.c)((function(e){return e.auth.user.data})),x=m.id,O=m.tenantId,p=Object(g.c)((function(e){return e.auth.user})).role,f=Object(g.c)((function(e){return e.oneFreeApp.setup})).setupFlow,y=Object(g.c)((function(e){return e.oneFreeApp.company.userCompanies})),I=Object(g.c)((function(e){return e.oneFreeApp.invoices.editInvoice})),N=Object(g.c)((function(e){return e.oneFreeApp.customers.userCustomer})),T=Object(h.useState)(c.a.cloneDeep(K.d)),A=Object(i.a)(T,2),C=A[0],D=A[1],k=Object(h.useState)({}),E=Object(i.a)(k,2),S=E[0],P=E[1],R=Object(h.useState)(c.a.cloneDeep(K.a)),L=Object(i.a)(R,2),V=(L[0],L[1]),U=Object(h.useState)(null),Y=Object(i.a)(U,2),B=Y[0],H=(Y[1],Ob
1ject(h.useState)(null)),_=Object(i.a)(H,2),M=_[0];_[1],Object(h.useEffect)((function(){"new"!==l||Object(v.bb)(p)||(t(Object(b.D)({size:1,sort:"id,desc"})),r&&t(Object(w.r)(r)))}),[t,l,p,r]),Object(h.useEffect)((function(){return"new"===l&&!Object(v.bb)(p)&&N&&D((function(e){return Object(G.a)(Object(G.a)({},e),{},{billToId:N.id,billTo:N,invoiceExtn:Object(G.a)(Object(G.a)({},null===e||void 0===e?void 0:e.invoiceExtn),{},{isEInvoice:null===N||void 0===N?void 0:N.isEInvoice})})})),function(){t(Object(w.h)())}}),[t,l,p,N]),Object(h.useEffect)((function(){"edit"!==l||s||t(Object(b.y)({invoiceId:o}))}),[t,l,o]),Object(h.useEffect)((function(){return"edit"!==l&&(Object(v.bb)(p)?Object(v.bb)(p)&&M?t(Object(w.t)({tenantId:null===M||void 0===M?void 0:M.tenantId,isActive:!0,sort:"id,desc"})):Object(v.bb)(p)&&B&&t(Object(w.t)({tenantId:null===B||void 0===B?void 0:B.tenantId,isActive:!0,sort:"id,desc"})):t(Object(w.t)({isActive:!0,sort:"id,desc"}))),function(){t(Object(b.Y)()),t(Object(ne.C)())}}),[t,l,M,B,p]),Object(h.useEffect)((function(){"edit"!==l&&(Object(v.bb)(p)?Object(v.bb)(p)&&M?D((function(e){return Object(G.a)(Object(G.a)({},e),{},{tenantId:null===M||void 0===M?void 0:M.tenantId,billerCompanyId:null===M||void 0===M?void 0:M.companyId,payToId:1})})):Object(v.bb)(p)&&B&&(D((function(e){return Object(G.a)(Object(G.a)({},e),{},{tenantId:null===B||void 0===B?void 0:B.tenantId,billerUserId:null===B||void 0===B?void 0:B.id,payToId:1})})),V((function(e){return Object(G.a)(Object(G.a)({},e),{},{tenantId:null===B||void 0===B?void 0:B.tenantId,claimerId:null===B||void 0===B?void 0:B.id})}))):D((function(e){return Object(G.a)(Object(G.a)({},e),{},{tenantId:O,payToId:1})})))}),[D,O,l,p,M,B]),Object(h.useEffect)((function(){!Object(v.bb)(p)&&d&&(d===u.Pc.FREE_YRITTAJA_TMI.name||d===u.Pc.FREE_YRITTAJA_OY.name?f||t(Object(ie.i)(x)):d===u.Pc.FREE_KEVYTYRITTAJA.name&&(D((function(e){return Object(G.a)(Object(G.a)({},e),{},{billerUserId:x})})),V((function(e){return Object(G.a)(Object(G.a)({},e),{},{tenantId:O,claimerId:x})}))))}),[t,O,x,f,p,d]),Object(h.useEffect)((function(){var e;"edit"!==l&&(!Object(v.bb)(p)&&f&&(!Array.isArray(y)||y.length<1?null!==f&&void 0!==f&&null!==(e=f.aspaStatuses)&&void 0!==e&&e.isSetupComplete?t(Object(te.k)({userId:x})):t(Object(te.k)({userId:x,isActive:!1})):D((function(e){var t;return Object(G.a)(Object(G.a)({},e),{},{billerCompanyId:null===(t=y[0])||void 0===t?void 0:t.companyId})}))))}),[t,y,x,l,p,f]),Object(h.useEffect)((function(){I&&D((function(e){return Object(G.a)(Object(G.a)({},e),c.a.cloneDeep(I))}))}),[I]);var q=function(e){var t=0,n=0,i=0;e.invoiceItems&&e.invoiceItems.forEach((function(e,a){var l=e.inputUnitPrice?parseFloat(e.inputUnitPrice.toString().replace(",",".")):0,o=e.qty?parseFloat(e.qty.toString().replace(",",".")):0,r=e.taxPercent;e.isTaxIncluded?(e.unitPriceTax=l*(1-1/(1+r)),e.unitPriceWithoutTax=l/(1+r),e.unitPriceWithTax=l,e.lineTaxAmt=o*l*(1-1/(1+r)),e.lineWithoutTaxAmt=o*l/(1+r),e.lineTotalAmt=o*l):(e.unitPriceTax=l*r,e.unitPriceWithoutTax=l,e.unitPriceWithTax=l*(1+r),e.lineWithoutTaxAmt=o*l,e.lineTaxAmt=o*l*e.taxPercent,e.lineTotalAmt=o*l*(1+e.taxPercent)),t+=e.lineWithoutTaxAmt,i+=e.lineTaxAmt,n+=e.lineTotalAmt,D(c.a.set(Object(G.a)({},C),"invoiceItems[".concat(a,"]"),e))})),D(Object(G.a)(Object(G.a)({},C),{},{totalAmt:n,subTotalAmt:t,taxAmt:i}))},z=function(e){var n;!function(e){P(c.a.omit(Object(G.a)({},S),"invoiceItems[".concat(e,"]")))}(e);var i=C.invoiceItems;null!==(n=i[e])&&void 0!==n&&n.id&&t(Object(b.t)({invoice:C,invoiceItemId:i[e].id})),i.splice(e,1),D((function(e){var t=c.a.set(Object(G.a)({},e),"invoiceItems",i);return q(t),t}))};return Object(F.jsx)(F.Fragment,{children:!(null!==(e=X.validateInvoiceSetting(C))&&void 0!==e&&e.isErrors)&&Object(F.jsx)(F.Fragment,{children:Object(F.jsx)(ue,{invoice:C,setInvoice:D,invoiceErrors:S,setInvoiceErrors:P,confirmDialog:function(e,n){Object(v.m)((function(){!function(e,n){"invoice"===e&&z(n),t(Object(j.a)())}(e,n)}),"Are you sure to delete this row?",t)},calculateInvoiceValues:q,removeInvoiceItem:z})})})})),be=n(1136),je=n(1142),me=n(1361),xe=n(1394),Oe=n(1362),pe=function(e){var t,n,i=e.invoice,a=e.showFileId,c=e.confirmDialog,l=e.removeActiveAttachment,d=e.closeDialog,s=e.showInvoiceAttachment,u=e.setShowInvoiceAttachment,v=e.handleInvoiceAttachment,b=e.setPreview,j=e.removeInvoiceAttachment,m=e.preview,x=e.setPreviewActiveFile,O=e.previewActiveFile,p=e.cleanPreviewFile,h=e.previewFileId,y=e.newFileAdded,I=Object(f.a)().t,N=Object(g.b)();return Object(F.jsxs)("div",{children:[(null===i||void 0===i?void 0:i.activeAttachment)&&!y&&Object(F.jsxs)("div",{className:"flex flex-wrap sm:flex-nowrap mb-10",children:[Object(F.jsxs)("span",{className:"pt-20 flex-1 mr-4 sm:mr-8 hidden self-end sm:flex",children:[I("Preview Previous Invoice File"),":"]}),null!==i&&void 0!==i&&null!==(t=i.activeAttachment)&&void 0!==t&&t.fileUrl?Object(F.jsxs)("a",{className:"no-underline flex justify-center items-center mt-10 sm:mt-0 px-8",target:"_blank",rel:"noopener noreferrer",href:null===i||void 0===i||null===(n=i.activeAttachment)||void 0===n?void 0:n.fileUrl,children:[Object(F.jsx)(r.a,{className:"mr-6",fontSize:"small",children:"pageview"}),I("Preview Previous")]}):Object(F.jsxs)(o.a,{id:"previewActiveFile",variant:"text",color:"primary",className:"mt-10 sm:mt-0 px-8",onClick:function(){return a(null===i||void 0===i?void 0:i.id)},children:[Object(F.jsx)(r.a,{className:"mr-6",fontSize:"small",children:"pageview"}),I("Preview Previous")]}),Object(F.jsx)(Y.a,{className:"p-0 mt-10 sm:mt-0 m-0",onClick:function(){return c((function(){l(null===i||void 0===i?void 0:i.id),N(d())}),"Are you sure to delete this attachment?",N)},children:Object(F.jsx)(r.a,{children:"delete"})})]}),Object(F.jsxs)("div",{className:"flex flex-wrap sm:flex-nowrap items-center pt-8 sm:pt-0",children:[s?Object(F.jsx)(D.a,{className:"flex-1 mr-4 sm:mr-8",type:"file",required:!0,label:I("File"),id:"invoiceFileAttachment",name:"invoiceFileAttachment",onChange:v,inputProps:{accept:"application/pdf, image/jpg, image/jpeg, image/png"},InputLabelProps:{shrink:!0}}):Object(F.jsx)(o.a,{variant:"outlined",id:"showInvoiceAttachment",color:"primary",onClick:function(){return u(!s)},children:null!==i&&void 0!==i&&i.activeAttachment?I("New Attachment"):I("Add Attachment")}),(null===i||void 0===i?void 0:i.invoiceFileAttachment)&&Object(F.jsxs)(F.Fragment,{children:[Object(F.jsxs)(o.a,{id:"preview",variant:"contained",color:"primary",className:"mt-10 sm:mt-0 px-8 sm:w-full sm:max-w-128",onClick:function(){return b(!0)},children:[Object(F.jsx)(r.a,{className:"mr-6",fontSize:"small",children:"pageview"}
1),Object(F.jsx)("span",{className:"hidden sm:flex",children:I("Preview")})]}),Object(F.jsx)(Y.a,{className:"mt-10 sm:m-0 p-0 sm:ml-5",onClick:j,children:Object(F.jsx)(r.a,{children:"delete"})})]})]}),m&&Object(F.jsx)(T.a,{preview:m,handleClose:function(){N(p()),b(!1)},fileLink:URL.createObjectURL(null===i||void 0===i?void 0:i.invoiceFileAttachment),showDownload:!1,showCloseButton:!0}),O&&Object(F.jsx)(T.a,{preview:O,handleClose:function(){N(p()),x(!1)},fileLink:h})]})},he=Object(s.a)((function(e){return{text:{color:e.palette.text.light}}}));var fe=function(e){var t,n,l,o,r,d=Object(f.a)().t,s=Object(k.m)(e),x=he(),O=Object(g.b)(),y=e.updatedInvoice,I=null===y||void 0===y||null===(t=y.billTo)||void 0===t?void 0:t.customerType,N=Object(h.useState)({}),T=Object(i.a)(N,2),w=T[0],A=T[1],C=Object(g.c)((function(e){return e.oneFreeApp.invoices.previewFileId})),E=Object(g.c)((function(e){return e.auth.user})).role,S=Object(h.useState)(!1),P=Object(i.a)(S,2),R=P[0],L=P[1],V=Object(h.useState)(!1),U=Object(i.a)(V,2),Y=U[0],B=U[1],H=Object(h.useState)(!1),_=Object(i.a)(H,2),M=_[0],W=_[1],z=Object(h.useState)(!1),J=Object(i.a)(z,2),Z=(J[0],J[1]),K=function(e){if(Q(e.target.name,e.target.value),"invoiceExtn.dueDuration"===e.target.name){var t,n,i=y.invoiceDate?p()(y.invoiceDate).add(e.target.value,null===(t=y.invoiceExtn)||void 0===t?void 0:t.dueDurationType.toLowerCase()).format("YYYY-MM-DD"):p()().add(e.target.value,null===(n=y.invoiceExtn)||void 0===n?void 0:n.dueDurationType.toLowerCase()).format("YYYY-MM-DD");O(Object(b.kb)(Object(G.a)(Object(G.a)({},y),{},{dueDate:i,invoiceExtn:Object(G.a)(Object(G.a)({},y.invoiceExtn),{},{dueDuration:e.target.value})})))}else{if("invoiceDate"===e.target.name){if(-1===Object(me.a)(Object(q.a)(e.target.value),Object(xe.a)((new Date).setHours(0,0,0,0),u.Pb)))return O(Object(ae.c)({message:d("Date of invoice can not be earlier than {{number}} days from now",{number:u.Pb}),variant:"error"})),void O(Object(b.kb)(Object(G.a)(Object(G.a)({},y),{},{invoiceDate:Object(Oe.a)(new Date,{representation:"date"})})));O(Object(b.kb)(Object(G.a)(Object(G.a)({},y),{},{invoiceDate:e.target.value})))}"checkbox"===e.target.type&&O(Object(b.kb)(Object(G.a)(Object(G.a)({},y),{},{invoiceExtn:Object(G.a)(Object(G.a)({},y.invoiceExtn),{},Object(a.a)({},e.target.name,!y.invoiceExtn[e.target.name]))})))}},Q=function(e,t){var n=X.validateInvoiceField(e,t,I);A(!1!==n?c.a.set(Object(G.a)({},w),e,n):c.a.omit(Object(G.a)({},w),e))};return Object(F.jsxs)(F.Fragment,{children:[Object(F.jsxs)("div",{className:"flex gap-x-20",children:[Object(F.jsx)(v.a,{className:Object(m.a)(x.text,"md:w-1/3 w-136"),label:d("Invoice Date"),info:d("Select date (e.g. the date the work was done)"),dispatch:O}),Object(F.jsx)(D.a,{className:"mb-20",error:w&&!!w.invoiceDate,helperText:w&&w.invoiceDate,label:d("Invoice Date"),required:!0,id:"invoiceDate",name:"invoiceDate",type:"date",value:null===y||void 0===y?void 0:y.invoiceDate,onChange:K,InputLabelProps:{shrink:!0},InputProps:{required:!1,inputProps:{min:Object(Oe.a)(Object(xe.a)(new Date,u.Pb),{representation:"date"}),max:Object(v.bb)(E)?Object(Oe.a)(new Date,{representation:"date"}):void 0}}})]}),Object(F.jsxs)("div",{className:"flex gap-x-20",children:[Object(F.jsx)(v.a,{className:Object(m.a)(x.text,"md:w-1/3 w-136"),label:d("Payment Term"),info:d("Next you choose the payment term"),dispatch:O}),Object(F.jsx)(D.a,{className:Object(m.a)(s.guideItemInput,s.guideItemInputHalfLeft),error:(null===w||void 0===w?void 0:w.invoiceExtn)&&!!w.invoiceExtn.dueDuration,helperText:(null===w||void 0===w?void 0:w.invoiceExtn)&&w.invoiceExtn.dueDuration,label:"".concat(d("Payment Term"),"  (").concat(d(u.Bb.DUE_DURATION_TYPE),")"),required:!0,id:"invoiceExtn.dueDuration",name:"invoiceExtn.dueDuration",type:"number",value:null===(n=y.invoiceExtn)||void 0===n?void 0:n.dueDuration,onChange:K})]}),Object(F.jsxs)("div",{className:"flex gap-x-20",children:[Object(F.jsx)(v.a,{className:Object(m.a)(x.text,"md:w-1/3 w-136"),label:d("Due Date"),info:d("Invoice Due Date"),dispatch:O}),Object(F.jsx)(D.a,{className:Object(m.a)(s.guideItemInput,s.guideItemInputHalfLeft),label:d("Due Date"),disabled:!0,id:"dueDate",name:"dueDate",type:"date",value:y.dueDate||"",InputLabelProps:{shrink:!0}})]}),Object(F.jsxs)("div",{className:"flex gap-x-20 min-h-64",children:[Object(F.jsx)(v.a,{className:Object(m.a)(x.text,"md:w-1/3 w-136"),label:d("Auto Overdue Notice"),info:d("FREE! handle sending overdue notice automatically"),dispatch:O}),Object(F.jsx)(be.a,{control:Object(F.jsx)(je.a,{id:"automaticallyAssignOverdueStatus",name:"automaticallyAssignOverdueStatus",type:"checkbox",color:"primary",checked:!0===(null===y||void 0===y||null===(l=y.invoiceExtn)||void 0===l?void 0:l.automaticallyAssignOverdueStatus),onChange:K}),label:d("Auto Overdue Notice")})]}),Object(F.jsxs)("div",{className:"flex gap-x-20 min-h-64",children:[Object(F.jsx)(v.a,{className:Object(m.a)(x.text,"md:w-1/3 w-136"),label:d("Auto Withdrawal"),info:d("*Did you know that you can split your salary and lift it up in installments? If you want to split your salary: Click Auto Withdrawal: OFF"),dispatch:O}),Object(F.jsx)(be.a,{control:Object(F.jsx)(je.a,{id:"isAutoSalary",name:"isAutoSalary",type:"checkbox",color:"primary",checked:!0===(null===y||void 0===y||null===(o=y.invoiceExtn)||void 0===o?void 0:o.isAutoSalary),onChange:K}),label:d("Auto Withdrawal")})]}),Object(F.jsxs)("div",{className:"flex gap-x-20 min-h-64",children:[Object(F.jsx)(v.a,{className:Object(m.a)(x.text,"md:w-1/3 w-136"),label:d("Instant Transfer"),info:"".concat(d("Instant Transfer enables your salary to be transferred to your bank account within an hour, without the normal bank delay (normally 1-2 days)."),"\n          ").concat(d("Our improved Instant Transfer service will enable you to receive your money within an at any time of the day!"),"\n          ").concat(d("Once the invoice is paid, the payment request will be made immediately, normally arriving within a few minutes."),"\n          ").concat(d("Recipients bank must be SEPA Instant compliant for the money to be transferred within minutes."),"\n          ").concat(d("Please note that this does not work for advanced salary."),"\n          ").concat(d("For Advanced Salary:"),"\n          ").concat(d("Advanced Salary Instant Transfer enables your salary to be transferred to your bank account within a few hours, without the normal bank delay (normally 1-2 days)."),"\n          ").concat(d("Our customer service will handle your request immediately so that you are able to enjoy your salary faster than ever! The Instant Transfer requests are processed every weekday between 9-16."),"\n          ").concat(d("Be sure to make your request before 16.00 on a weekday to receive your money during the same day."),"\n          ").concat(d("Later requests will be processed the next business day. Get your money within a few hours!"),"\n          ").concat(d("An Instant transfer costs 25\u20ac (incl. VAT) per salary.")),dispatch:O}),Object(F.jsx)(be.a,{control:Object(F.jsx)(je.a,{id:"fastPayment",name:"fastPayment",type:"checkbox",color:"primary",checked:!0===(null===y||void 0===y||null===(r=y.invoiceExtn)||void 0===r?void 0:r.fastPayment),onChange:K}),label:d("Instant Transfer")})]}),Object(F.jsxs)("div",{className:Object(m.a)("flex gap-x-20",M&&"flex-col md:flex-row"),children:[Object(F.jsx)(v.a,{className:Object(m.a)(x.text,"md:w-1/3 w-136"),label:d("Attachment"),info:d("*Did you know that you can send attachment with this invoice"),dispatch:O}),Object(F.jsx)(pe,{invoice:y,showFileId:function(e){B(!0),O(Object(b.z)({invoiceId:e}))},confirmDialog:v.m,removeActiveAttachment:function(e){O(Object(b.ib)(!0)),O(Object(b.kb)(Object(G.a)(Object(G.a)({},y),{},{invoiceFileAttachment:null,activeAttachment:null})))},closeDialog:j.a,showInvoiceAttachment:M,setShowInvoiceAttachment:W,handleInvoiceAttachment:function(e){e.target.files[0]&&(Z(!0),!Object(v.f)(e.target.files[0],O,d))||O(Object(b.kb)(Object(G.a)(Object(G.a)({},y),{},{invoiceFileAttachment:0===e.target.files.length?null:e.target.files[0]})))},setPreview:L,removeInvoiceAttachment:function(){W(!1),O(Object(b.kb)(Object(G.a)(Object(G.a)({},y),{},{invoiceFileAttachment:null,activeAttachment:null})))},preview:R,setPreviewActiveFile:B,previewActiveFile:Y,cleanPreviewFile:b.l,previewFileId:C})]})]})},ge=Object(s.a)((function(e){return{col:{color:e.palette.text.main,flexDirection:"column",flex:1},row:{flexDirection:"row",display:"flex",flexWrap:"wrap",flex:1,justifyContent:"space-between"},titleText:{color:"#0065a5",fontSize:18,fontWeight:"bold",marginBottom:4},labelText:{color:"#67717e",fontSize:14,fontWeight:"bold",marginTop:4,marginBottom:2},normalText:{fontSize:14,marginTop:4,marginBottom:4},mobileTextRight:Object(a.a)({},e.breakpoints.down("sm"),{textAlign:"right"}),summaryContainer:{backgroundColor:"#0065a5",marginTop:0},informationContainer:{marginTop:12},informationText:{textAlign:"center",fontSize:10,fontWeight:"bold",color:"#656d7b"},summaryText:{textAlign:"center",marginTop:4,marginBottom:4,fontSize:18,fontWeight:"bold",color:"#ffffff"},paymentInfo:{borderColor:e.palette.utility.main,color:e.palette.text.light,borderWidth:1,padding:4,minHeight:69}}})),ye=function(e){var t=Object(f.a)().t,n=ge(),i=e.labelText,a=e.children,c=e.containerClass;return Object(F.jsxs)("div",{className:Object(m.a)(n.row,c),children:[Object(F.jsx)("div",{className:n.col,children:Object(F.jsxs)("div",{className:n.labelText,children:[" ",t(i)]})}),Object(F.jsx)("div",{className:n.col,children:Object(F.jsx)("div",{id:(null===e||void 0===e?void 0:e.id)||i,className:Object(m.a)(n.normalText,n.mobileTextRight),children:a})})]})},Ie=function(e){var t=e.biller,n=ge();return t.registeredName?Object(F.jsx)("div",{className:n.col,children:null===t||void 0===t?void 0:t.registeredName}):Object(F.jsxs)(F.Fragment,{children:[(null===t||void 0===t?void 0:t.marketingName)&&Object(F.jsx)("div",{className:n.col,children:(null===t||void 0===t?void 0:t.marketingName)||""}),(null===t||void 0===t?void 0:t.firstName)&&!(null!==t&&void 0!==t&&t.marketingName)&&Object(F.jsx)("div",{className:n.col,children:"".concat(null===t||void 0===t?void 0:t.firstName," ").concat(null===t||void 0===t?void 0:t.lastName)})]})};t.a=function(e){var t,n,a,s,O,C,D,k,E,S,P,V,U,Y,B,H,_,M,q,W,z,J,X,G,K,Q,$,ee,te,ne,ie,ae,ce,le,oe,re,de,se,ue,be,je,me,xe,Oe,pe,he,Ne,Te,we,Ae,Ce,De,ke,Ee,Se,Pe,Fe,Re,Le,Ve,Ue,Ye,Be,He,_e,Me,qe,We,ze,Je,Xe,Ze,Ge,Ke,Qe,$e,et,tt,nt,it,at,ct,lt,ot,rt,dt,st,ut,vt,bt,jt,mt,xt=Object(f.a)().t,Ot
1=Object(g.b)(),pt=ge(),ht=e.invoice,ft=e.handleAction,gt=(null===ht||void 0===ht?void 0:ht.billTo)||{},yt=(null===ht||void 0===ht?void 0:ht.billerCompany)||(null===ht||void 0===ht?void 0:ht.billerUser)||{},It=null===ht||void 0===ht?void 0:ht.payTo,Nt=Object(g.c)((function(e){return e.auth.user})).role,Tt=Object(g.c)((function(e){return e.i18n.language})),wt=Object(g.c)((function(e){return e.oneFreeApp.utils.zeroVats})),At=Object(g.c)((function(e){return e.oneFreeApp.invoices.previewFileId})),Ct=Object(g.c)((function(e){return e.oneFreeApp.invoices})),Dt=Ct.editAdvancedInvoice,kt=Ct.selectedCustomer,Et=Ct.updatedInvoice,St=Object(g.c)((function(e){return e.oneFreeApp.invoices})).invoiceAmt,Pt=Object(g.c)((function(e){return e.oneFreeApp.customers.userCustomers})),Ft=Array.isArray(null===Pt||void 0===Pt?void 0:Pt.content)&&Pt.content.filter((function(e){return!1===(null===e||void 0===e?void 0:e.grupi)}))||[],Rt=Object(g.c)((function(e){return e.oneFreeApp.invoices.comingFromAddNewRow})),Lt=Object(h.useState)(!1),Vt=Object(i.a)(Lt,2),Ut=Vt[0],Yt=Vt[1],Bt=Object(h.useState)(!1),Ht=Object(i.a)(Bt,2),_t=Ht[0],Mt=Ht[1],qt=Object(h.useState)(!1),Wt=Object(i.a)(qt,2),zt=(Wt[0],Wt[1]),Jt=Object(h.useState)(""),Xt=Object(i.a)(Jt,2),Zt=Xt[0],Gt=Xt[1],Kt=Object(h.useState)(null),Qt=Object(i.a)(Kt,2),$t=Qt[0],en=Qt[1];Object(h.useEffect)((function(){if(!Rt)return function(){Ot(Object(b.eb)(!1))};Ot(Object(b.eb)(!0))}),[null===ht||void 0===ht?void 0:ht.id,Rt]),Object(h.useEffect)((function(){Dt&&(Ot(Object(w.t)({isActive:!0,sort:"id,desc",tenantId:null===ht||void 0===ht?void 0:ht.tenantId})).then((function(e){if(e.payload.content.length){var t=e.payload.content.find((function(e){var t;return e.billingAddressId===(null===Et||void 0===Et||null===(t=Et.billTo)||void 0===t?void 0:t.billingAddressId)}));nn(t),en(t)}})),ht&&Ot(Object(b.kb)(c.a.cloneDeep(ht))))}),[Dt,Ot,null===ht||void 0===ht?void 0:ht.billToId]);var tn=Array.isArray(null===ht||void 0===ht?void 0:ht.invoiceItems)&&c.a.uniqBy(ht.invoiceItems.filter((function(e){return null===e||void 0===e?void 0:e.zeroVatLovId})),"zeroVatLovId");Object(h.useEffect)((function(){!wt&&Array.isArray(tn)&&tn.length>0&&Ot(Object(A.e)())}),[Ot,wt,tn]);var nn=function(e){Ot(Object(b.jb)(e))};return Object(F.jsxs)("div",{className:"p-16 sm:p-24 w-full",children:[null===ht&&Object(F.jsx)("p",{children:xt("Invoice not found")}),ht&&Object(F.jsxs)("div",{className:"mb-16",children:[Dt?Object(F.jsx)(F.Fragment,{children:Object(F.jsx)(x.b,{children:Object(F.jsxs)("div",{className:"flex md:flex-row flex-col w-full lg:justify-start justify-between gap-y-40",children:[Object(F.jsxs)("div",{className:"md:w-2/5 w-full",children:[Object(F.jsx)(l.a,{className:Object(m.a)(pt.titleText,"mb-20"),children:xt("Customer")}),Ft&&Object(F.jsx)(L.a,{className:"@max-w-288 max-w-400",userCustomersList:Ft,handleAddCustomer:function(){zt(!0)},handleCheckCustomer:nn,searchCustomer:Zt,handleSearchCustomer:function(e){Gt(e)},defaultValue:$t,variant:"outlined"}),(kt||Et)&&Object(F.jsxs)("div",{className:Object(m.a)(pt.col,"mt-20"),children:[Object(F.jsxs)("div",{className:"flex flex-wrap",children:[Object(F.jsx)(l.a,{className:"font-bold",children:(null===kt||void 0===kt?void 0:kt.nickname)||(null===Et||void 0===Et||null===(t=Et.billTo)||void 0===t?void 0:t.nickname)||"(not set)"}),Object(F.jsx)(l.a,{children:" - ".concat((null===kt||void 0===kt||null===(n=kt.company)||void 0===n?void 0:n.registrationNumber)||(null===Et||void 0===Et||null===(a=Et.billTo)||void 0===a||null===(s=a.company)||void 0===s?void 0:s.registrationNumber)||"(not set)"," - ").concat((null===kt||void 0===kt?void 0:kt.invoiceEmail)||(null===Et||void 0===Et||null===(O=Et.billTo)||void 0===O?void 0:O.invoiceEmail)||"(not set)")})]}),Object(F.jsxs)("div",{className:"flex gap-x-4 flex-wrap",children:[Object(F.jsxs)(l.a,{className:"font-bold",children:[xt("Contact"),":"]}),Object(F.jsx)(l.a,{children:"".concat((null===kt||void 0===kt||null===(C=kt.companyContact)||void 0===C?void 0:C.contactName)||(null===Et||void 0===Et||null===(D=Et.billTo)||void 0===D||null===(k=D.companyContact)||void 0===k?void 0:k.contactName)||"(not set)"," - ").concat((null===kt||void 0===kt||null===(E=kt.companyContact)||void 0===E?void 0:E.email)||(null===Et||void 0===Et||null===(S=Et.billTo)||void 0===S||null===(P=S.companyContact)||void 0===P?void 0:P.email)||"(not set)")})]}),Object(F.jsxs)("div",{className:"flex gap-x-4 flex-wrap",children:[Object(F.jsxs)(l.a,{className:"font-bold",children:[xt("Address"),":"]}),Object(F.jsx)(l.a,{children:"".concat((null===kt||void 0===kt||null===(V=kt.billingAddress)||void 0===V?void 0:V.addressLine1)||(null===Et||void 0===Et||null===(U=Et.billTo)||void 0===U||null===(Y=U.billingAddress)||void 0===Y?void 0:Y.addressLine1)||"(not set)",", ").concat((null===kt||void 0===kt||null===(B=kt.billingAddress)||void 0===B?void 0:B.addressLine2)||(null===Et||void 0===Et||null===(H=Et.billTo)||void 0===H||null===(_=H.billingAddress)||void 0===_?void 0:_.addressLine2)||"(not set)")})]})]}),Object(F.jsx)("div",{className:Object(m.a)(pt.titleText,"mt-20"),children:xt("Biller")}),Object(F.jsx)(Ie,{biller:yt})]}),Object(F.jsx)("div",{className:"md:w-1/2 w-full",children:Et&&Object(F.jsx)(fe,{updatedInvoice:Et})})]})})}):Object(F.jsx)("div",{className:"flex",children:Object(F.jsxs)("div",{className:pt.row,children:[Object(F.jsxs)("div",{className:pt.col,children:[Object(F.jsx)("div",{className:pt.titleText,children:xt("Customer")}),Object(F.jsx)("div",{className:pt.labelText,children:(null===gt||void 0===gt||null===(M=gt.company)||void 0===M?void 0:M.registeredCountryCode)!==u.Y?null===gt||void 0===gt||null===(q=gt.company)||void 0===q?void 0:q.vatNumber:null===gt||void 0===gt?void 0:gt.nickname}),Object(F.jsx)("div",{className:pt.normalText,children:(null===gt||void 0===gt||null===(W=gt.company)||void 0===W?void 0:W.registrationNumber)||""}),Object(F.jsx)("div",{className:pt.normalText,children:null===gt||void 0===gt||null===(z=gt.billingAddress)||void 0===z?void 0:z.addressLine1}),Object(F.jsx)("div",{className:pt.normalText,children:null===gt||void 0===gt||null===(J=gt.billingAddress)||void 0===J?void 0:J.addressLine2}),Object(F.jsx)("div",{className:pt.normalText,children:(null===gt||void 0===gt?void 0:gt.invoiceEmail)||""}),Object(F.jsx)("div",{className:Object(m.a)(pt.titleText,"mt-20"),children:xt("Biller")}),Object(F.jsx)(Ie,{biller:yt})]}),Object(F.jsxs)("div",{className:pt.col,children:[Object(F.jsx)(ye,{labelText:"Invoice Date",children:p()(null===ht||void 0===ht?void 0:ht.invoiceDate).format("DD.MM.YYYY")}),Object(F.jsx)(ye,{labelText:"Payment terms",children:"".concat(null===(X=ht.invoiceExtn)||void 0===X?void 0:X.dueDuration," ").concat(xt(null===(G=ht.invoiceExtn)||void 0===G||null===(K=G.dueDurationType)||void 0===K?void 0:K.toLowerCase()))}),(null===ht||void 0===ht?void 0:ht.dueDate)&&Object(F.jsx)(ye,{labelText:"Due Date",children:p()(null===ht||void 0===ht?void 0:ht.dueDate).format("DD.MM.YYYY")}),Object(F.jsx)(ye,{labelText:"Interest on delayed payment",children:u.Eb.INTEREST}),Object(F.jsxs)(ye,{labelText:"Invoice Number",children:[" ",null===ht||void 0===ht?void 0:ht.invoiceNumber]}),Object(F.jsx)(ye,{labelText:"Reference Number",id:"invoiceReference",children:null===ht||void 0===ht?void 0:ht.invoiceReference}),Object(F.jsx)(ye,{labelText:"E-Invoice",children:null!==ht&&void 0!==ht&&null!==(Q=ht.invoiceExtn)&&void 0!==Q&&Q.isEInvoice?"\u2705":"\u274c"}
1),Object(F.jsx)(ye,{labelText:"Overdue Notice",children:null!==ht&&void 0!==ht&&null!==($=ht.invoiceExtn)&&void 0!==$&&$.automaticallyAssignOverdueStatus?"\u2705":"\u274c"}),Object(F.jsx)(ye,{labelText:"Auto Withdrawal",children:null!==ht&&void 0!==ht&&null!==(ee=ht.invoiceExtn)&&void 0!==ee&&ee.isAutoSalary?"\u2705":"\u274c"}),Object(F.jsx)(ye,{labelText:"Instant Transfer",children:null!==ht&&void 0!==ht&&null!==(te=ht.invoiceExtn)&&void 0!==te&&te.fastPayment?"\u2705":"\u274c"}),(null===ht||void 0===ht?void 0:ht.activeAttachment)&&Object(F.jsxs)(F.Fragment,{children:[Object(F.jsx)(ye,{labelText:"Invoice Attachment",children:Object(F.jsxs)(o.a,{id:"previewActiveFile",variant:"text",color:"default",className:"m-0 p-0",onClick:function(){return e=null===ht||void 0===ht?void 0:ht.id,Yt(!0),void Ot(Object(b.z)({invoiceId:e}));var e},children:[Object(F.jsx)(r.a,{className:"mr-6",fontSize:"small",children:"pageview"}),xt("Preview")]})}),Ut&&Object(F.jsx)(T.a,{preview:Ut,handleClose:function(){Ot(Object(b.l)()),Yt(!1)},fileLink:At})]}),v.bb(Nt)&&Object(F.jsxs)(F.Fragment,{children:[(null===ht||void 0===ht||null===(ne=ht.invoiceExtn)||void 0===ne?void 0:ne.origDueDate)&&Object(F.jsxs)(F.Fragment,{children:[Object(F.jsx)("hr",{}),Object(F.jsx)(ye,{labelText:"Orig.DueDate",children:p()(null===ht||void 0===ht||null===(ie=ht.invoiceExtn)||void 0===ie?void 0:ie.origDueDate).format("DD.MM.YYYY")})]}),(null===ht||void 0===ht||null===(ae=ht.invoiceExtn)||void 0===ae?void 0:ae.origSubTotalAmt)&&Object(F.jsx)(ye,{labelText:"Orig.SubTotalAmt",children:v.s(null===ht||void 0===ht||null===(ce=ht.invoiceExtn)||void 0===ce?void 0:ce.origSubTotalAmt)}),Object(F.jsx)("hr",{}),Object(F.jsx)(ye,{labelText:"Invoice Biller Amount",children:v.s((null===ht||void 0===ht?void 0:ht.billerAmount)||0)}),Object(F.jsx)(ye,{labelText:"Service Fee Amount",children:v.s((null===ht||void 0===ht||null===(le=ht.invoiceExtn)||void 0===le?void 0:le.serviceFeeAmt)||0)}),Object(F.jsx)(ye,{labelText:"Service Fee Percent",children:v.qb((null===ht||void 0===ht||null===(oe=ht.invoiceExtn)||void 0===oe?void 0:oe.serviceFeePercent)||0)}),Object(F.jsx)("hr",{}),Object(F.jsx)(ye,{labelText:"Status",children:Object(F.jsx)("div",{className:Object(m.a)(pt.normalText,pt.mobileTextRight),style:{color:"".concat(Object(I.e)(null===ht||void 0===ht?void 0:ht.status))},children:null===ht||void 0===ht?void 0:ht.status})}),Object(F.jsx)(ye,{labelText:"Sub Status",children:Object(F.jsx)("div",{className:pt.col,children:Object(F.jsx)("div",{className:Object(m.a)(pt.normalText,pt.mobileTextRight),style:{color:"".concat(Object(I.e)(null===ht||void 0===ht||null===(re=ht.invoiceExtn)||void 0===re?void 0:re.subStatus))},children:null===ht||void 0===ht||null===(de=ht.invoiceExtn)||void 0===de?void 0:de.subStatus})})}),Object(F.jsx)(ye,{labelText:"Aspa Check Before Send Requested ",children:null!==ht&&void 0!==ht&&null!==(se=ht.invoiceExtn)&&void 0!==se&&se.aspaCheckBeforeSendRequested?"\u2705":"\u274c"}),(null===gt||void 0===gt?void 0:gt.directPayPartner)&&Object(F.jsx)(ye,{labelText:"DirectPay Partner ",children:null===gt||void 0===gt||null===(ue=gt.directPayPartner)||void 0===ue?void 0:ue.name}),Object(F.jsx)("hr",{}),Object(F.jsx)(ye,{labelText:"Expense Id",children:(null===ht||void 0===ht?void 0:ht.expense)&&Object(F.jsxs)(F.Fragment,{children:[Object(F.jsx)(y.a,{to:"/expenses/".concat(null===ht||void 0===ht||null===(be=ht.expense)||void 0===be?void 0:be.id),target:"_blank",children:Object(F.jsx)(l.a,{variant:"button",children:null===ht||void 0===ht||null===(je=ht.expense)||void 0===je?void 0:je.id})}),Object(F.jsx)(N.a,{message:null===ht||void 0===ht||null===(me=ht.expense)||void 0===me?void 0:me.id})]})}),(null===ht||void 0===ht?void 0:ht.expense)&&Object(F.jsx)(F.Fragment,{children:Object(F.jsx)(ye,{labelText:"Expense Total Amt.",children:v.s((null===ht||void 0===ht||null===(xe=ht.expense)||void 0===xe?void 0:xe.totalAmt)||0)})}),Object(F.jsx)("hr",{}),Object(F.jsx)(ye,{labelText:"Invoice Payment",children:Object(F.jsx)(y.a,{to:"/invoice-payments?invoiceId=".concat(null===ht||void 0===ht?void 0:ht.id),target:"_blank",children:Object(F.jsx)(l.a,{variant:"button",children:xt("View")})})}),Object(F.jsx)(ye,{labelText:"Salaries",children:Object(F.jsx)(y.a,{to:"/salaries/all-employee?invoiceId=".concat(null===ht||void 0===ht?void 0:ht.id).concat(null!==ht&&void 0!==ht&&ht.billerCompanyId?"&tenantType=".concat(null!==(Oe=null===ht||void 0===ht?void 0:ht.tenantType)&&void 0!==Oe?Oe:u.kd.company.value):""),target:"_blank",children:Object(F.jsx)(l.a,{variant:"button",children:xt("View")})})}),Object(F.jsx)(ye,{labelText:"Salary Request",children:Object(F.jsx)(y.a,{to:"/withdrawals/all-employee?invoiceId=".concat(null===ht||void 0===ht?void 0:ht.id).concat(null!==ht&&void 0!==ht&&ht.billerCompanyId?"&tenantType=".concat(null!==(pe=null===ht||void 0===ht?void 0:ht.tenantType)&&void 0!==pe?pe:u.kd.company.value):""),target:"_blank",children:Object(F.jsx)(l.a,{variant:"button",children:xt("View")})})}),Object(F.jsx)("hr",{}),Object(F.jsx)(ye,{labelText:"Parent Invoice Id",children:(null===ht||void 0===ht?void 0:ht.parentId)&&Object(F.jsx)(y.a,{to:"/invoices/".concat(null===ht||void 0===ht?void 0:ht.parentId),target:"_blank",children:Object(F.jsx)(l.a,{variant:"button",children:null===ht||void 0===ht?void 0:ht.parentId})})}),(null===ht||void 0===ht||null===(he=ht.invoiceExtn)||void 0===he?void 0:he.substituteMainInvoiceId)&&Object(F.jsx)(ye,{labelText:"Substitution Main Invoice Id",children:Object(F.jsx)(y.a,{to:"/invoices/".concat(null===ht||void 0===ht||null===(Ne=ht.invoiceExtn)||void 0===Ne?void 0:Ne.substituteMainInvoiceId),target:"_blank",children:Object(F.jsx)(l.a,{variant:"button",children:null===ht||void 0===ht||null===(Te=ht.invoiceExtn)||void 0===Te?void 0:Te.substituteMainInvoiceId})})}),(null===ht||void 0===ht?void 0:ht.voucherId)&&Object(F.jsx)(ye,{labelText:"Voucher Id",children:null===ht||void 0===ht?void 0:ht.voucherId}),(null===ht||void 0===ht?void 0:ht.voucherStatus)&&Object(F.jsx)(ye,{labelText:"Voucher Status",children:Object(F.jsx)("div",{className:Object(m.a)(pt.normalText,pt.mobileTextRight),style:{color:"".concat(Object(I.e)(null===ht||void 0===ht?void 0:ht.voucherStatus))},children:null===ht||void 0===ht?void 0:ht.voucherStatus})})]})]}),v.bb(Nt)&&Object(F.jsxs)("div",{className:pt.col,children:[Object(F.jsxs)(ye,{labelText:"isActive",children:[" ",null!==ht&&void 0!==ht&&ht.isActive?"\u2705":"\u274c"]}),Object(F.jsx)(ye,{labelText:"Bad debt",children:null!==ht&&void 0!==ht&&null!==(we=ht.invoiceExtn)&&void 0!==we&&we.badDebt?"\u2705":"\u274c"}
1),Object(F.jsx)(ye,{labelText:"In Debt Collection",containerClass:"items-center",children:Object(F.jsx)(d.a,{id:"inDebtCollection",checked:null===ht||void 0===ht||null===(Ae=ht.invoiceExtn)||void 0===Ae?void 0:Ae.inDebtCollection,onClick:function(){return ft({action:"inDebtCollection"})},color:"primary"})}),Object(F.jsx)(ye,{labelText:"Reclamated",containerClass:"items-center",children:Object(F.jsx)(d.a,{id:"reclamated",checked:null===ht||void 0===ht||null===(Ce=ht.invoiceExtn)||void 0===Ce?void 0:Ce.reclamationEmailSentAt,onClick:function(){return function(){var e;(null===ht||void 0===ht?void 0:ht.status)===u.Fb.SENT.value?null!==ht&&void 0!==ht&&null!==(e=ht.invoiceExtn)&&void 0!==e&&e.reclamationEmailSentAt?v.T({t:xt,dispatch:Ot,title:"",HTMLMessage:function(){return Object(F.jsx)("p",{children:"The reclamation email has already been sent"})},handleOk:function(){Ot(Object(j.a)())},okText:"Ok",cancelText:null}):Mt(!0):v.T({t:xt,dispatch:Ot,title:"",HTMLMessage:function(){return Object(F.jsx)("p",{children:"Sorry, you can send reclamation email only for invoices with status SENT"})},handleOk:function(){Ot(Object(j.a)())},okText:"Ok",cancelText:null})}()},color:"primary"})}),Object(F.jsx)(ye,{labelText:"Service Agreement",children:null!==ht&&void 0!==ht&&null!==(De=ht.invoiceExtn)&&void 0!==De&&De.commissionAgreementId?Object(F.jsx)(y.a,{to:"/customers/".concat(null===ht||void 0===ht?void 0:ht.billToId,"/?agreement=").concat(null===ht||void 0===ht||null===(ke=ht.invoiceExtn)||void 0===ke?void 0:ke.commissionAgreementId),className:"p-4",children:Object(F.jsx)(l.a,{variant:"button",children:null===ht||void 0===ht||null===(Ee=ht.invoiceExtn)||void 0===Ee?void 0:Ee.commissionAgreementId})}):"\u274c"}),Object(F.jsxs)(ye,{labelText:"Tenant Id",children:[" ",null===ht||void 0===ht?void 0:ht.tenantId]}),Object(F.jsx)("hr",{}),Object(F.jsxs)(ye,{labelText:"PayTo Id",children:[" ",null===ht||void 0===ht?void 0:ht.payToId]}),Object(F.jsx)(ye,{labelText:"PayTo Reg. Name",children:null===ht||void 0===ht||null===(Se=ht.payTo)||void 0===Se?void 0:Se.registeredName}),Object(F.jsx)(ye,{labelText:"PayTo Bic",children:null===ht||void 0===ht||null===(Pe=ht.payTo)||void 0===Pe||null===(Fe=Pe.bankAccount)||void 0===Fe?void 0:Fe.swiftBic}),Object(F.jsx)(ye,{labelText:"PayTo Iban",children:null===ht||void 0===ht||null===(Re=ht.payTo)||void 0===Re||null===(Le=Re.bankAccount)||void 0===Le?void 0:Le.iban}),Object(F.jsx)("hr",{}),Object(F.jsx)(ye,{labelText:"Biller UserId",children:(null===ht||void 0===ht?void 0:ht.billerUserId)&&Object(F.jsxs)(F.Fragment,{children:[Object(F.jsx)(y.a,{to:"/user-profiles/".concat(ht.billerUserId),target:"_blank",children:Object(F.jsx)(l.a,{variant:"button",children:ht.billerUserId})}),Object(F.jsx)(N.a,{message:ht.billerUserId})]})}),(null===ht||void 0===ht?void 0:ht.billerUserId)&&Object(F.jsxs)(F.Fragment,{children:[Object(F.jsx)(ye,{labelText:"Biller User Name",children:"".concat(null===ht||void 0===ht||null===(Ve=ht.billerUser)||void 0===Ve?void 0:Ve.firstName," ").concat(null===ht||void 0===ht||null===(Ue=ht.billerUser)||void 0===Ue?void 0:Ue.lastName)}),Object(F.jsx)(ye,{labelText:"Biller User SSN",children:null===ht||void 0===ht||null===(Ye=ht.billerUser)||void 0===Ye?void 0:Ye.personalIdentificationNumber})]}),Object(F.jsx)("hr",{}),Object(F.jsx)(ye,{labelText:"Biller CompanyId",children:(null===ht||void 0===ht?void 0:ht.billerCompanyId)&&Object(F.jsxs)(F.Fragment,{children:[Object(F.jsx)(y.a,{to:"/company/tmi?company.id=".concat(ht.billerCompanyId),target:"_blank",children:Object(F.jsx)(l.a,{variant:"button",children:ht.billerCompanyId})}),Object(F.jsx)(N.a,{message:ht.billerCompanyId})]})}),(null===ht||void 0===ht?void 0:ht.billerCompanyId)&&Object(F.jsxs)(F.Fragment,{children:[Object(F.jsx)(ye,{labelText:"Biller Reg. Name",children:null===ht||void 0===ht||null===(Be=ht.billerCompany)||void 0===Be?void 0:Be.registeredName}),Object(F.jsx)(ye,{labelText:"Biller Reg. Number",children:null===ht||void 0===ht||null===(He=ht.billerCompany)||void 0===He?void 0:He.registrationNumber})]}),Object(F.jsx)("hr",{}),Object(F.jsxs)(ye,{labelText:"BillTo CustomerId",children:[Object(F.jsx)(y.a,{to:"/customers/".concat(null===ht||void 0===ht?void 0:ht.billToId),target:"_blank",children:Object(F.jsx)(l.a,{variant:"button",children:null===ht||void 0===ht?void 0:ht.billToId})}),Object(F.jsx)(N.a,{message:null===ht||void 0===ht?void 0:ht.billToId})]}),Object(F.jsx)(ye,{labelText:"BillTo CustomerType",children:null===gt||void 0===gt?void 0:gt.customerType}),Object(F.jsx)(ye,{labelText:"BillTo CompanyId",children:null===gt||void 0===gt?void 0:gt.companyId}),Object(F.jsx)(ye,{labelText:"BillTo Indi.TraderId",children:null===gt||void 0===gt?void 0:gt.individualTraderId}),Object(F.jsx)(ye,{labelText:"BillTo TenantId",children:null===gt||void 0===gt?void 0:gt.tenantId}),Object(F.jsx)(ye,{labelText:"BillTo isEInvoice",children:null!==gt&&void 0!==gt&&gt.isEInvoice?"\u2705":"\u274c"}
1),Object(F.jsx)(ye,{labelText:"BillTo InvoiceEmail",children:null===gt||void 0===gt?void 0:gt.invoiceEmail}),Object(F.jsx)(ye,{labelText:"BillTo Ovt",children:(null===gt||void 0===gt||null===(_e=gt.companyOvt)||void 0===_e?void 0:_e.ovtCode)||""}),(null===gt||void 0===gt||null===(Me=gt.companyOvt)||void 0===Me?void 0:Me.operatorOvt)&&Object(F.jsxs)(F.Fragment,{children:[Object(F.jsx)(ye,{labelText:"OperatorOvt Name",children:(null===gt||void 0===gt||null===(qe=gt.companyOvt)||void 0===qe||null===(We=qe.operatorOvt)||void 0===We?void 0:We.name)||""}),Object(F.jsx)(ye,{labelText:"OperatorOvt ovtCode",children:(null===gt||void 0===gt||null===(ze=gt.companyOvt)||void 0===ze||null===(Je=ze.operatorOvt)||void 0===Je?void 0:Je.ovtCode)||""})]}),Object(F.jsx)("hr",{}),Object(F.jsx)(ye,{labelText:"Project Id",children:null===ht||void 0===ht?void 0:ht.projectId})]})]})}),Object(F.jsx)("div",{className:Object(m.a)(pt.titleText,"mt-20"),children:xt("Invoice Items")}),Object(F.jsx)("div",{className:"my-20",children:Dt?Object(F.jsx)(ve,{invoice:ht}):Object(F.jsx)(Z,{invoice:ht})}),Array.isArray(tn)&&tn.map((function(e,t){var n,i;return Object(F.jsx)("div",{className:"text-center",children:Array.isArray(wt)&&(null===e||void 0===e?void 0:e.zeroVatLovId)&&(null===(n=wt.find((function(t){return t.id===(null===e||void 0===e?void 0:e.zeroVatLovId)})))||void 0===n||null===(i=n.lovLangs.find((function(e){return(null===e||void 0===e?void 0:e.lang)===Tt})))||void 0===i?void 0:i.label)},t)})),Object(F.jsx)("div",{className:pt.summaryContainer,children:Object(F.jsxs)("div",{className:pt.row,children:[Object(F.jsxs)("div",{className:[pt.col],children:[Object(F.jsx)("div",{className:pt.summaryText,children:xt("Amount without VAT")}),Object(F.jsx)("div",{id:"subTotalAmt",className:pt.summaryText,children:v.s(Dt?null===St||void 0===St?void 0:St.subTotalAmt:ht.subTotalAmt)})]}),Object(F.jsxs)("div",{className:pt.col,children:[Object(F.jsx)("div",{className:pt.summaryText,children:xt("VAT")}),Object(F.jsx)("div",{id:"taxAmt",className:pt.summaryText,children:v.s(Dt?null===St||void 0===St?void 0:St.taxAmt:ht.taxAmt)})]}),Object(F.jsxs)("div",{className:pt.col,children:[Object(F.jsx)("div",{className:pt.summaryText,children:xt("Total Amount")}),Object(F.jsx)("div",{id:"totalAmt",className:pt.summaryText,children:v.s(Dt?null===St||void 0===St?void 0:St.totalAmt:ht.totalAmt)})]})]})}),Object(F.jsx)("div",{className:pt.informationContainer,children:Object(F.jsxs)("div",{className:pt.row,children:[Object(F.jsxs)("div",{className:pt.col,children:[Object(F.jsx)("div",{className:pt.informationText,children:null===It||void 0===It?void 0:It.registeredName}),Object(F.jsx)("div",{className:pt.informationText,children:null===It||void 0===It?void 0:It.registrationNumber})]}),Object(F.jsx)("div",{className:pt.col,children:Array.isArray(null===yt||void 0===yt?void 0:yt.companyLocations)?Object(F.jsxs)(F.Fragment,{children:[Object(F.jsx)("div",{className:pt.informationText,children:null===yt||void 0===yt||null===(Xe=yt.companyLocations[0])||void 0===Xe||null===(Ze=Xe.address)||void 0===Ze?void 0:Ze.addressLine1}),Object(F.jsx)("div",{className:pt.informationText,children:null===yt||void 0===yt||null===(Ge=yt.companyLocations[0])||void 0===Ge||null===(Ke=Ge.address)||void 0===Ke?void 0:Ke.addressLine2})]}):Object(F.jsxs)(F.Fragment,{children:[Object(F.jsx)("div",{className:pt.informationText,children:null===It||void 0===It||null===(Qe=It.companyLocations[0])||void 0===Qe||null===($e=Qe.address)||void 0===$e?void 0:$e.addressLine1}),Object(F.jsx)("div",{className:pt.informationText,children:null===It||void 0===It||null===(et=It.companyLocations[0])||void 0===et||null===(tt=et.address)||void 0===tt?void 0:tt.addressLine2})]})}),Object(F.jsxs)("div",{className:pt.col,children:[Object(F.jsxs)("div",{className:pt.informationText,children:[xt("Interest"),": ",u.Eb.INTEREST]}),Object(F.jsxs)("div",{className:pt.informationText,children:[xt("Reminder Fee"),":"," ","I"===(null===gt||void 0===gt?void 0:gt.customerType)?u.Eb.REMINDER_FEE_INDIVIDUAL:u.Eb.REMINDER_FEE_COMPANY]})]})]})}),Object(F.jsxs)("div",{children:[Object(F.jsxs)("div",{className:pt.row,children:[Object(F.jsxs)("div",{className:Object(m.a)(pt.col,pt.paymentInfo),children:[Object(F.jsx)("div",{className:"font-13",children:xt("Recipient's")}),Object(F.jsx)("div",{className:"font-13",children:xt("Account Number")})]}),Object(F.jsxs)("div",{className:Object(m.a)(pt.col,pt.paymentInfo),children:[Object(F.jsx)("div",{className:"font-13",children:xt("IBAN")}),Object(F.jsx)("div",{children:null===It||void 0===It||null===(nt=It.bankAccount)||void 0===nt?void 0:nt.iban})]}),Object(F.jsxs)("div",{className:Object(m.a)(pt.col,pt.paymentInfo),children:[Object(F.jsx)("div",{className:"font-13",children:xt("BIC")}),Object(F.jsx)("div",{children:Object(F.jsx)("div",{children:null===It||void 0===It||null===(it=It.bankAccount)||void 0===it?void 0:it.swiftBic})})]})]}),Object(F.jsxs)("div",{className:pt.row,children:[Object(F.jsxs)("div",{className:Object(m.a)(pt.col,pt.paymentInfo),children:[Object(F.jsx)("div",{className:"font-13",children:xt("Recipient's name")}),Object(F.jsx)("div",{className:"font-13",children:xt("Address")}),Object(F.jsx)("div",{children:"\xa0"})]}),Object(F.jsxs)("div",{className:Object(m.a)(pt.col,pt.paymentInfo),children:[Object(F.jsx)("div",{children:null===It||void 0===It?void 0:It.registeredName}),Object(F.jsx)("div",{children:null===It||void 0===It||null===(at=It.companyLocations[0])||void 0===at||null===(ct=at.address)||void 0===ct?void 0:ct.addressLine1}),Object(F.jsx)("div",{children:null===It||void 0===It||null===(lt=It.companyLocations[0])||void 0===lt||null===(ot=lt.address)||void 0===ot?void 0:ot.addressLine2})]}),Object(F.jsx)("div",{className:Object(m.a)(pt.col,pt.paymentInfo),children:Object(F.jsxs)("div",{className:pt.row,children:[Object(F.jsx)("div",{className:Object(m.a)(pt.col,"font-13"),children:xt("Invoice Number")}),Object(F.jsx)("div",{className:pt.col,children:ht.invoiceNumber})]})})]}),Object(F.jsxs)("div",{className:pt.row,children:[Object(F.jsxs)("div",{className:Object(m.a)(pt.col,pt.paymentInfo),children:[Object(F.jsx)("div",{className:"font-13",children:xt("Payer's name")}),Object(F.jsx)("div",{className:"font-13",children:xt("Address")}),Object(F.jsx)("div",{children:"\xa0"})]}),Object(F.jsxs)("div",{className:Object(m.a)(pt.col,pt.paymentInfo),children:[Object(F.jsx)("div",{children:Dt?null===kt||void 0===kt?void 0:kt.nickname:null===gt||void 0===gt?void 0:gt.nickname}),Object(F.jsx)("div",{children:null===gt||void 0===gt||null===(rt=gt.billingAddress)||void 0===rt?void 0:rt.addressLine1}),Object(F.jsx)("div",{children:null===gt||void 0===gt||null===(dt=gt.billingAddress)||void 0===dt?void 0:dt.addressLine2})]}),Object(F.jsx)("div",{className:Object(m.a)(pt.col,pt.paymentInfo),children:Object(F.jsxs)("div",{className:pt.row,children:[Object(F.jsx)("div",{className:Object(m.a)(pt.col,"font-13"),children:xt("Reference Number")}),Object(F.jsx)("div",{className:pt.col,children:ht.invoiceReference})]})})]}),Object(F.jsxs)("div",{className:pt.row,children:[Object(F.jsx)("div",{className:Object(m.a)(pt.col,pt.paymentInfo,"font-13"),children:Object(F.jsx)("div",{children:xt("From Account No")})}),Object(F.jsx)("div",{className:Object(m.a)(pt.col,pt.paymentInfo)}),Object(F.jsxs)("div",{className:Object(m.a)(pt.col,pt.paymentInfo),children:[(null===ht||void 0===ht?void 0:ht.dueDate)&&Object(F.jsxs)("div",{className:pt.row,children:[Object(F.jsx)("div",{className:Object(m.a)(pt.col,"font-13"),children:xt("Due Date")}),Object(F.jsx)("div",{className:pt.col,children:p()(null===ht||void 0===ht?void 0:ht.dueDate).format("DD.MM.YYYY")})]}),Object(F.jsxs)("div",{className:pt.row,children:[Object(F.jsx)("div",{className:Object(m.a)(pt.col,"font-13"),children:xt("Total Amount")}),Object(F.jsx)("div",{className:pt.col,children:v.s(Dt?null===St||void 0===St?void 0:St.totalAmt:ht.totalAmt)})]})]})]})]}),v.bb(Nt)&&null!==(null===ht||void 0===ht?void 0:ht.invoiceOverdueReminder)&&Object(F.jsxs)("div",{children:[Object(F.jsx)(l.a,{className:Object(m.a)(pt.titleText,"mt-20"),children:xt("Invoice overdue reminders fees")}),Object(F.jsxs)("div",{className:Object(m.a)(pt.col,"sm:w-2/3 w-full"),children:[Object(F.jsx)(ye,{labelText:"First Reminder Sent At",children:p()(null===ht||void 0===ht||null===(st=ht.invoiceOverdueReminder)||void 0===st?void 0:st.firstReminderSentAt).format("DD.MM.YYYY")}),Object(F.jsx)(ye,{labelText:"First Reminder Penalty Amount",children:v.s((null===ht||void 0===ht||null===(ut=ht.invoiceOverdueReminder)||void 0===ut?void 0:ut.firstReminderPenaltyAmount)||0)}),Object(F.jsx)(ye,{labelText:"Second Reminder Sent At",children:null!==ht&&void 0!==ht&&null!==(vt=ht.invoiceOverdueReminder)&&void 0!==vt&&vt.secondReminderSentAt?p()(null===ht||void 0===ht||null===(bt=ht.invoiceOverdueReminder)||void 0===bt?void 0:bt.secondReminderSentAt).format("DD.MM.YYYY"):"not set"}),Object(F.jsx)(ye,{labelText:"Second Reminder Penalty Amount",children:null!==ht&&void 0!==ht&&null!==(jt=ht.invoiceOverdueReminder)&&void 0!==jt&&jt.secondReminderPenaltyAmount?v.s((null===ht||void 0===ht||null===(mt=ht.invoiceOverdueReminder)||void 0===mt?void 0:mt.secondReminderPenaltyAmount)||0):"not set"})]})]})]}),Object(F.jsx)(R,{openReclamationReason:_t,setOpenReclamationReason:Mt,billerUserId:null===ht||void 0===ht?void 0:ht.billerUserId,invoiceId:null===ht||void 0===ht?void 0:ht.id})]})}}}]);

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.