PageSourceSearch

https://parckdesign.be/static/js/7277.5ad69a8e.chunk.js

js parckdesign.be collected 2026-10-08 09:04:18 UTC 53,365 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[7277],{26269(e,t,s){s.d(t,{A:()=>y});var a=s(65043),i=s(25852),r=s(13718),l=s(87382),n=s(72926),o=s(96669),c=s(30267),d=s(67330),h=s(55470),m=s(70579);let p=0,u=0,x=0,A=0,j=0,g=0,b=0;class f extends a.Component{constructor(e){super(e),this.showFormData=async()=>{this.props.sendDataToPenalties(this.state.isFormData)},this.deletenewLineData=async e=>{try{e>-1&&(await this.setState(t=>{const s=[...t.newLineData];return s.splice(e,1),{newLineData:s}}),await this.setState({isFormData:this.state.newLineData}))}catch(t){console.log(t)}},this.handleChange=async(e,t,s)=>{if("amount"===t){s=s.replace(/,/g,".");if(!/^\d*\.?\d*$/.test(s))return;const e=s.split(".");2===e.length&&e[1].length>2&&(s=e[0]+"."+e[1].substring(0,2))}await this.setState(a=>{const i=[...a.newLineData];return i[e][t]=s,{newLineData:i}}),await this.setState({isFormData:this.state.newLineData});let a={lineData:this.state.isFormData,baseAmount:p,totalAmount:j,taxAmount:b};this.props.sendDataToPenalties(a)},this.state={newLineData:[{amount:"",description:"",isWithoutVat:!1}],isFormData:null,isDeposit:!!this.props.isDeposit&&this.props.isDeposit,finalCost:this.props.finalCost,newInvoiceDescription:""}}async addNewLineData(e){await this.setState(t=>({newLineData:[...t.newLineData,{amount:"",description:"",isWithoutVat:e}]}));let t={lineData:this.state.newLineData,baseAmount:p,totalAmount:j,taxAmount:b};this.props.sendDataToPenalties(t)}componentDidUpdate(e){if(e.finalCost!==this.props.finalCost){let e={lineData:[{amount:this.props.finalCost,description:this.props.newInvoiceDescription,isWithoutVat:!1}],baseAmount:this.props.baseAmount,totalAmount:this.props.totalAmount,taxAmount:this.props.taxAmount};this.setState({newLineData:[{amount:this.props.finalCost,description:this.props.newInvoiceDescription,isWithoutVat:!1}],finalCost:this.props.finalCost,newInvoiceDescription:this.props.newInvoiceDescription}),this.props.sendDataToPenalties(e)}}rendernewLineData(){try{x=0,A=0,p=0,u=0,j=0,b=0,g=0;let e=this.state.newLineData.map((e,t)=>(e.amount&&""!==e.amount&&!e.isWithoutVat?(x=parseFloat(parseFloat(e.amount).toFixed(2)),p+=this.state.isDeposit?parseFloat(x):parseFloat(x/(1+h.IVA/100)),b=parseFloat((p*(h.IVA/100)).toFixed(2)),j+=this.state.isDeposit?parseFloat(parseFloat(p).toFixed(2)):parseFloat(parseFloat(e.amount))):e.amount&&""!==e.amount&&e.isWithoutVat&&(u=parseFloat(parseFloat(u)+parseFloat(e.amount).toFixed(2)),this.state.isDeposit,g=parseFloat(parseFloat(u).toFixed(2)),A=parseFloat(parseFloat(e.amount).toFixed(2)),j+=parseFloat(parseFloat(e.amount).toFixed(2))),(0,m.jsxs)(i.A,{className:"",children:[(0,m.jsx)(r.A,{md:"12",sm:"12",children:(0,m.jsxs)(i.A,{className:"p-1",children:[(0,m.jsx)(r.A,{md:"6",className:"text-right",children:(0,m.jsxs)("strong",{children:[(0,m.jsx)(o.A,{id:"lineInvoice"})," ",t+1," ",!e.isWithoutVat&&(0,m.jsx)(o.A,{id:"WithVat"})]})}),(0,m.jsx)(r.A,{md:"6",className:"text-right",children:t>0&&(0,m.jsx)(l.A.Ripple,{color:"primary",onClick:()=>this.deletenewLineData(t),children:(0,m.jsx)(d.A,{size:14})})})]})}),(0,m.jsx)(r.A,{md:"12",sm:"12",children:(0,m.jsxs)(i.A,{className:"p-1",children:[(0,m.jsx)(r.A,{md:"3",className:"text-center",children:(0,m.jsxs)("strong",{children:[(0,m.jsx)(o.A,{id:"quantityInvoice"})," "]})}),(0,m.jsx)(r.A,{md:"9",children:(0,m.jsx)("input",{type:"text",name:"amount",required:!0,className:"form-control",value:e.amount,onChange:e=>this.handleChange(t,"amount",e.target.value)})})]})}),(0,m.jsx)(r.A,{md:"12",sm:"12",children:(0,m.jsxs)(i.A,{className:"p-1",children:[(0,m.jsx)(r.A,{md:"3",className:"text-center",children:(0,m.jsx)("strong",{children:(0,m.jsx)(o.A,{id:"concept"})})}),(0,m.jsx)(r.A,{md:"9",children:(0,m.jsx)("textarea",{className:"form-control",name:"description",required:!0,value:e.description,onChange:e=>this.handleChange(t,"description",e.target.value),rows:4,cols:40})})]})})]},t)));return p=parseFloat(p.toFixed(2)),j=parseFloat(j.toFixed(2)),e}catch(e){console.log(e)}}render(){return(0,m.jsxs)(a.Fragment,{children:[(0,m.jsx)(r.A,{md:"12",sm:"12",className:"text-center",children:!this.state.isDeposit&&(0,m.jsx)(n.A,{className:"m-1",color:"warning",children:(0,m.jsx)("span",{children:(0,m.jsx)(o.A,{id:"indicatingMessageForInvoiceCreation"})})})}),this.rendernewLineData(),(0,m.jsx)(r.A,{md:"12",sm:"12",className:"text-center",children:(0,m.jsx)("div",{style:{borderBottom:"1.5px solid gray"},children:!this.state.isDeposit&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(l.A,{className:"mb-1",color:"primary",outline:!0,onClick:()=>{this.addNewLineData(!1)},children:[(0,m.jsx)(c.A,{size:15,className:"ml-1"})," ",(0,m.jsx)(o.A,{id:"addNewLine"})]})," ",(0,m.jsxs)(l.A,{className:"mb-1",color:"primary",outline:!0,onClick:()=>{this.addNewLineData(!0)},children:[(0,m.jsx)(c.A,{size:15,className:"ml-1"})," ",(0,m.jsx)(o.A,{id:"addNewLineWithoutIva"})]})," "]})})}),(0,m.jsx)(r.A,{md:"12",sm:"12",className:"text-center mt-3",children:(0,m.jsxs)(i.A,{children:[!this.state.isDeposit&&(0,m.jsxs)(r.A,{md:"12",children:[(0,m.jsx)(r.A,{md:"12",children:(0,m.jsxs)("p",{className:"h6",children:[(0,m.jsx)(o.A,{id:"baseAmount"})," ",p,"\u20ac"]})}),(0,m.jsx)(r.A,{md:"12",children:(0,m.jsxs)("p",{className:"h6",children:[(0,m.jsx)(o.A,{id:"taxAmount",values:{percent:h.IVA}}),b,"\u20ac"]})})]}),(0,m.jsx)(r.A,{md:"12",children:(0,m.jsxs)("p",{className:"h6",children:[(0,m.jsx)(o.A,{id:"baseAmount"})," ",(0,m.jsx)(o.A,{id:"noIva"}),parseFloat(this.state.isDeposit?p:A).toFixed(2),"\u20ac"]})})]})}),(0,m.jsx)(r.A,{md:"12",sm:"12",className:"text-center mt-2",children:(0,m.jsxs)("p",{className:"text-bold total_Amount",children:[(0,m.jsx)(o.A,{id:"totalAmounts"}),j,"\u20ac"]})}),(0,m.jsx)(r.A,{md:"1",sm:"12",className:"text-center mt-2"}),(0,m.jsx)(r.A,{md:"12",sm:"12",className:"text-center mt-2"})]})}}const y=f},34908(e,t,s){s.d(t,{A:()=>A});var a=s(65043),i=s(82387),r=s(75304),l=s(44864),n=s(38477),o=s(45056),c=s(58786),d=s(12426),h=s(96669),m=(s(90933),s(55470)),p=s.n(m),u=s(70579);class x extends a.Component{constructor(){super(),this.currencyFormat=e=>{try{return new Intl.NumberFormat("en-US",{style:"currency",currency:e})}catch(t){return console.log(t),null}},this.printTable=(e,t)=>
1(0,u.jsx)("tbody",{children:e.map((e,s)=>(0,u.jsxs)("tr",{id:"print_row_"+s,className:s%2===0?"evenRow":"",children:[(0,u.jsx)("td",{className:"printRowStyle printRowStyle1",children:(0,u.jsx)("p",{className:"text-bold-500 text-truncate mb-0",children:e.number})}),(0,u.jsxs)("td",{className:"printRowStyle",children:[(0,u.jsx)("p",{className:"text-bold-500 text-truncate mb-0",children:e.name+" "+e.surname}),(0,u.jsx)("p",{className:"text-bold-500 text-truncate mb-0",children:e.customer_email}),(0,u.jsx)("p",{className:"text-bold-500 text-truncate mb-0",children:e.NIF})]}),(0,u.jsx)("td",{className:"printRowStyle",children:(0,u.jsx)("p",{className:"text-bold-500 text-truncate mb-0",children:this.currencyFormat(e.currency).format(e.subtotal/100)})}),(0,u.jsx)("td",{className:"printRowStyle",children:(0,u.jsx)("p",{className:"text-bold-500 text-truncate mb-0",children:this.currencyFormat(e.currency).format(e.VAT/100)})}),t&&(0,u.jsx)("td",{className:"printRowStyle retentionColumnPrint",children:(0,u.jsx)("p",{className:"text-bold-500 text-truncate mb-0",children:e.retention?this.currencyFormat(e.currency).format(e.retention/100):null})}),(0,u.jsx)("td",{className:"printRowStyle",children:(0,u.jsx)("p",{className:"text-bold-500 text-truncate mb-0",children:this.currencyFormat(e.currency).format(e.total/100)})}),(0,u.jsx)("td",{className:"printRowStyle",children:(0,u.jsx)(i.A,{color:"paid"===e.status?"light-success":"draft"===e.status?"light-warning":"open"===e.status?"light-info":"void"===e.status?"light-primary":"light-danger",pill:!0,children:"paid"===e.status?(0,u.jsx)(h.A,{id:"paid"}):"draft"===e.status?(0,u.jsx)(h.A,{id:"draft"}):"open"===e.status?(0,u.jsx)(h.A,{id:"openInvoice"}):"void"===e.status?(0,u.jsx)(h.A,{id:"void"}):(0,u.jsx)(h.A,{id:"uncollectible"})})}),(0,u.jsxs)("td",{className:"printRowStyle",children:[e.created&&(0,u.jsx)(d.XU,{value:new Date(Number.parseInt(e.created.toString()+"000")),year:"numeric",month:"long",day:"2-digit"})," ",e.created&&(0,u.jsx)(h.A,{id:"at"})," ",e.created&&(0,u.jsx)(d.ib,{value:new Date(Number.parseInt(e.created.toString()+"000"))})]})]},s))}),this.state={columns:[{name:(0,u.jsx)(h.A,{id:"number"}),selector:"number",minWidth:"110px",sortable:!0,cell:e=>(0,u.jsx)("p",{className:"text-bold-500 text-truncate mb-0",children:e.number})},{name:(0,u.jsx)(h.A,{id:"customer"}),selector:"customer_email",sortable:!0,minWidth:"300px",cell:e=>e.name&&(0,u.jsxs)("div",{children:[(0,u.jsx)("p",{className:"text-bold-500 text-truncate mb-0",children:e.name+" "+e.surname}),(0,u.jsx)("p",{className:"text-bold-500 text-truncate mb-0",children:e.customer_email}),(0,u.jsx)("p",{className:"text-bold-500 text-truncate mb-0",children:e.NIF})]})},{name:(0,u.jsx)(h.A,{id:"taxBase"}),selector:"taxBase",maxWidth:"50px",sortable:!0,cell:e=>(0,u.jsx)("p",{className:"text-bold-500 mb-0",children:e.currency&&(e.subtotal||0===e.subtotal)&&this.currencyFormat(e.currency).format(e.subtotal/100)})},{name:(0,u.jsx)(h.A,{id:"VAT"}),selector:"VAT",maxWidth:"50px",sortable:!0,cell:e=>e.VAT?(0,u.jsx)("p",{className:"text-bold-500 mb-0",children:e.currency&&(e.VAT||0===e.VAT)&&this.currencyFormat(e.currency).format(e.VAT/100)}):null},{name:(0,u.jsx)(h.A,{id:"retention"}),selector:"amount_due",maxWidth:"50px",sortable:!0,cell:e=>e.retention?(0,u.jsx)("p",{className:"text-bold-500 mb-0",children:e.currency&&(e.retention||0===e.retention)&&this.currencyFormat(e.currency).format(e.retention/100)}):null},{name:(0,u.jsx)(h.A,{id:"total"}),selector:"total",maxWidth:"50px",sortable:!0,cell:e=>(0,u.jsx)("p",{className:"text-bold-500 mb-0",children:e.currency&&(e.total||0===e.total)&&this.currencyFormat(e.currency).format(e.total/100)})},{name:(0,u.jsx)(h.A,{id:"status"}),selector:"status",sortable:!0,cell:e=>e.status&&(0,u.jsx)(i.A,{color:"paid"===e.status?"light-success":"draft"===e.status?"light-warning":"open"===e.status?"light-info":"void"===e.status?"light-primary":"light-danger",pill:!0,children:"paid"===e.status?(0,u.jsx)(h.A,{id:"paid"}):"draft"===e.status?(0,u.jsx)(h.A,{id:"draft"}):"open"===e.status?(0,u.jsx)(h.A,{id:"openInvoice"}):"void"===e.status?(0,u.jsx)(h.A,{id:"void"}):(0,u.jsx)(h.A,{id:"uncollectible"})})},{name:(0,u.jsx)(h.A,{id:"created"}),selector:"created",sortable:!0,cell:e=>(0,u.jsx)("p",{className:"text-bold-500 mb-0",children:(0,u.jsxs)(a.Fragment,{children:[e.created&&(0,u.jsx)(d.XU,{value:new Date(Number.parseInt(e.created.toString()+"000")),year:"numeric",month:"long",day:"2-digit"})," ",e.created&&(0,u.jsx)(h.A,{id:"at"})," ",e.created&&(0,u.jsx)(d.ib,{value:new Date(Number.parseInt(e.created.toString()+"000"))})]})})}],resumeColumns:[{name:(0,u.jsx)(h.A,{id:"invoicesNumber"}),selector:"taxBase",sortable:!0,cell:e=>(0,u.jsx)("p",{className:"text-bold-500 mb-0",children:e.invoicesNumber})},{name:(0,u.jsx)(h.A,{id:"taxBase"}),selector:"taxBase",sortable:!0,cell:e=>(0,u.jsx)("p",{className:"text-bold-500 mb-0",children:e.currency&&this.currencyFormat(e.currency).format(e.subtotal/100)})},{name:(0,u.jsx)(h.A,{id:"VAT"}),selector:"VAT",sortable:!0,cell:e=>e.VAT?(0,u.jsx)("p",{className:"text-bold-500 mb-0",children:this.currencyFormat(e.currency).format(e.VAT/100)}):null},{name:(0,u.jsx)(h.A,{id:"retention"}),selector:"amount_due",sortable:!0,cell:e=>e.retention?(0,u.jsx)("p",{className:"text-bold-500 mb-0",children:this.currencyFormat(e.currency).format(e.retention/100)}):null},{name:(0,u.jsx)(h.A,{id:"total"}),selector:"total",sortable:!0,cell:e=>(0,u.jsx)("p",{className:"text-bold-500 mb-0",children:e.currency&&this.currencyFormat(e.currency).format(e.total/100)})}],data:[]}}render(){let e=this.props.data;const t=this.props.showRetention;return t||this.state.resumeColumns.splice(3,1),(0,u.jsxs)("div",{children:[(0,u.jsxs)("div",{className:"info_div m-5 pl-3 pr-3 pt-2 pb-1",children:[(0,u.jsx)("p",{children:p().payments_companyName}),(0,u.jsxs)("p",{children:["CIF: ",p().payments_NIF]}),(0,u.jsx)("p",{children:this.props.date[0]&&this.props.date[1]?"FECHA: PERIODO DE "+this.props.date[0].toISOString().substr(0,10)+" AL "+this.props.date[1].toISOString().substr(0,10):"FECHA: TODAS"}),(0,u.jsx)("p",{children:"general"==this.props.type?"PARTICULARES Y EMPRESAS":"company"==this.props.type?"EMPRESAS":"PARTICULARES"})]}),(0,u.jsxs)("table",{children:[(0,u.jsx)("thead",{children:(0,u.jsxs)("tr",{children:[(0,u.jsx)("th",{className:"printRowStyle1 headerPrint",children:(0,u.jsx)(h.A,{id:"number"})}),(0,u.jsx)("th",{className:"headerPrint",children:(0,u.jsx)(h.A,{id:"customer"})}),(0,u.jsx)("th",{className:"headerPrint",children:(0,u.jsx)(h.A,{id:"taxBase"})}),(0,u.jsx)("th",{className:"headerPrint",children:(0,u.jsx)(h.A,{id:"VAT"})}),t&&(0,u.jsx)("th",{className:"headerPrint retentionColumnPrint",children:(0,u.jsx)(h.A,{id:"retention"})}),(0,u.jsx)("th",{className:"headerPrint",children:(0,u.jsx)(h.A,{id:"total"})}),(0,u.jsx)("th",{className:"headerPrint",children:(0,u.jsx)(h.A,{id:"status"})}),(0,u.jsx)("th",{className:"headerPrint",children:(0,u.jsx)(h.A,{id:"created"})})]})}),e&&this.printTable(e,t)]}),(0,u.jsxs)(r.A,{children:[(0,u.jsx)(n.A,{children:(0,u.jsx)(o.A,{children:(0,u.jsx)(h.A,{id:"resume"})})}),(0,u.jsx)(l.A,{className:"rdt_Wrapper",children:(0,u.jsx)(c.Ay,{className:"dataTable-custom",data:this.props.resumeData,columns:this.state.resumeColumns,noHeader:!0,noDataComponent:this.state.loading?(0,u.jsx)(h.A,{id:"loading..."}):(0,u.jsx)(h.A,{id:"noInvoicesFound"})})})]})]})}}const A=x},39427(){},43491(e,t,s){function a(e){try{if(1234===parseInt(e)||4321===parseInt(e)||123===parseInt(e)||9876===parseInt(e)||1234===parseInt(e))return!1;let s=!0,a=e.toString();for(var t=0;t<a.length;t++)a[0]!=a[t]&&(s=!1);return!s}catch(s){return console.log(s),!1}}function i(e,t){try{for(e=e.toString();e.length<t;)e="0"+e;return e}catch(s){return console.log(s),null}}s.d(t,{a:()=>a,c:()=>i})},50667(){}
1,51502(e,t,s){s.r(t),s.d(t,{default:()=>he});var a=s(89379),i=s(65043),r=s(28979),l=s(25852),n=s(13718),o=s(87382),c=s(80688),d=s(29704),h=s(19940),m=s(82387),p=s(75304),u=s(44864),x=s(38477),A=s(45056),j=s(65243),g=s(30360),b=s(64545),f=s(54798),y=s(64412),w=s(88225),N=s(89159),v=s(72926),S=s(53494),D=s(14124),C=s(52669),T=s(53285),I=s(42739),_=s(4993),F=s(68611),M=s(16054),k=s(15553),P=s(55727),L=s(12426),V=s(99106),E=s(96669),R=s(46575),B=s(26269),O=s(58786),W=s(27965),z=s(93141),U=s.n(z),J=s(94794),G=s(34518),H=s.n(G),Y=s(53227),q=s(78472),X=(s(25321),s(19876),s(82096),s(39427),s(50667),s(90933),s(34908)),$=s(99024),K=s(43491),Q=s(70579);const Z=s(55470),ee={"on hold":"warning",disponible:"success",pending:"primary",nodisponible:"warning",inactive:"secondary",blocked:"danger"},te=[{value:"1day",label:(0,Q.jsx)(E.A,{id:"1day"})},{value:"1week",label:(0,Q.jsx)(E.A,{id:"1week"})},{value:"1month",label:(0,Q.jsx)(E.A,{id:"1month"})},{value:"6months",label:(0,Q.jsx)(E.A,{id:"6months"})},{value:"1year",label:(0,Q.jsx)(E.A,{id:"1year"})},{value:"custom",label:(0,Q.jsx)(E.A,{id:"custom"})},{value:"all",label:(0,Q.jsx)(E.A,{id:"all"})}],se=Z.IVA/100,ae=[{value:"all",label:(0,Q.jsx)(E.A,{id:"all"})}],ie=[{value:"all",label:(0,Q.jsx)(E.A,{id:"all"})}],re=[{value:"all",label:(0,Q.jsx)(E.A,{id:"all"})},{value:"succeeded",label:(0,Q.jsx)(E.A,{id:"succeeded"}),color:"#80ff80"},{value:"abonada",label:(0,Q.jsx)(E.A,{id:"refunded"}),color:"#ffcc80"},{value:"inBalance",label:(0,Q.jsx)(E.A,{id:"inBalance"}),color:"#d9b3ff"}],le=[{value:"0",label:(0,Q.jsx)(E.A,{id:"selectanyone"})}],ne=[{value:"0",label:"Selecciona un trastero"}],oe={rowsPerPageText:(0,Q.jsx)(E.A,{id:"invoicesPerPage"}),rangeSeparatorText:" ",noRowsPerPage:!1},ce=e=>(0,Q.jsxs)("div",{className:"data-list-action d-flex align-items-center",children:["pending"===e.row.status&&(0,Q.jsxs)("a",{href:"#",className:"mr-2",id:"accept-".concat(e.row.id),children:[(0,Q.jsx)(I.A,{size:20,className:"text-success cursor-pointer",onClick:()=>{e.onAccept&&e.onAccept(e.row)}}),(0,Q.jsx)(D.A,{placement:"top",target:"accept-".concat(e.row.id),children:(0,Q.jsx)(E.A,{id:"accept"})})]}),(0,Q.jsxs)("a",{href:"#",id:"view-".concat(e.row.id),children:[(0,Q.jsx)(k.A,{size:20,onClick:()=>{if(e.resume)document.querySelector("#printButton").click();else{const t=e.pathname.replace("general","invoice");window.open(t+"/"+e.row.id,"_blank")}}}),(0,Q.jsx)(D.A,{placement:"top",target:"view-".concat(e.row.id),children:(0,Q.jsx)(E.A,{id:"watch"})})]})]});class de extends i.Component{constructor(){super(),this.handleAlert=(e,t)=>{this.setState({[e]:t})},this.toggleModalSend=()=>{this.setState(e=>({modalSend:!e.modalSend}))},this.toggleExportModalSend=()=>{this.setState(e=>({exportModalSend:!e.exportModalSend}))},this.toggleModalSetInvoice=()=>{this.setState(e=>({ModalSetInvoice:!e.ModalSetInvoice,setOpeningHoursResult:-1,invoiceCustomer:le[0],invoiceStorage:[{value:"0",label:"Selecciona un trastero"}],formValidate:!0}))},this.changeSelectedDate=async e=>
1{try{const t=await this.getStartAndEndDates(e);let s={startingAfter:t.startDate,endingBefore:t.endDate};this.setState({filterDates:e,filtersDate:s}),this.setState({filterDates:e})}catch(t){console.log(t)}},this.receiveDataFromPeanaltiesAddnewline=async e=>{const{invoiceCustomer:t,invoiceStorage:s,openingclosingEnabled:a,chargeToCustomer:i}=this.state,{value:r}=t,{value:l}=s;let n={centerId:this.props.match.params.centerId,emailId:r,storageId:l,isBalance:!0!==i&&a,lines:e.lineData,totalAmount:e.totalAmount,chargeToCustomer:i},o=this.state.formValidate;e.lineData&&e.lineData.length&&(o=await this.lineValidate(e.lineData)),t.value&&""!==s.value&&"number"==typeof s.value||(o=!0),await this.setState({createInvoiceData:n,formValidate:o,newLineData:e.lineData})},this.changeInvoiceStorage=async e=>{try{let t=await this.lineValidate(this.state.newLineData);await this.setState({invoiceStorage:e,formValidate:!(e.value&&!t)})}catch(t){console.log(t)}},this.lineValidate=async e=>{let t=this.state.formValidate;return e&&e.length?e.map(e=>{t=!e.amount||""===e.amount||!e.description||""===e.description}):t=!0,t},this.callApiGetStorages=async e=>{let t={centerId:e};try{let e;e=await fetch("/api/center/storage",{method:"POST",mode:"cors",headers:{Authorization:"Bearer "+JSON.parse(localStorage.getItem("token")),"Content-Type":"application/json"},body:JSON.stringify(t)}),console.log(e);const s=await e.json();if(200!==e.status)throw Error(s.message);return s}catch(s){console.log(s)}},this.handleCurrentData=e=>{try{this.setState({currentData:e}),this.handleSidebar(!0)}catch(t){console.log(t)}},this.currencyFormat=e=>{try{return new Intl.NumberFormat("en-US",{style:"currency",currency:e})}catch(t){return console.log(t),null}},this.handleInvoiceuser=async e=>{try{let t=this.state.createInvoiceData;this.handleAlert("loadingAlert",!0),e.preventDefault();let s=this.state.formValidate;if(this.state.invoiceCustomer.value&&""!==this.state.invoiceCustomer.value&&"0"!=this.state.invoiceCustomer.value||(document.getElementById("selectCus").focus(),s=!0),this.state.invoiceStorage&&0!==this.state.invoiceStorage&&""!==this.state.invoiceStorage||(s=!0),s)return this.setState({formValidate:s}),this.handleAlert("loadingAlert",!1),!1;let a=await fetch("/api/center/deposit",{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:"Bearer "+JSON.parse(localStorage.getItem("token"))},body:JSON.stringify(t)});const i=await a.json();return i?(this.handleAlert("loadingAlert",!1),this.handleAlert("successInvoiceCustomerAlert",!0),await this.setState({invoiceCustomer:le[0],invoiceStorage:ne[0],openingclosingEnabled:!0,ModalSetInvoice:!1})):(this.handleAlert("loadingAlert",!1),this.handleAlert("errorStatusInvoiceCustomerAlert",!0)),i}catch(t){this.handleAlert("loadingAlert",!1),this.handleAlert("errorStatusInvoiceCustomerAlert",!0)}},this.handleFilter=e=>{try{let t=e.target.value,s=this.state.data,a=this.state.filteredData;this.setState({value:t}),t.length&&(a=s.filter(e=>{let s=e.name.toLowerCase().startsWith(t.toLowerCase())||e.date.toLowerCase().startsWith(t.toLowerCase())||e.email.toLowerCase().startsWith(t.toLowerCase())||e.revenue.toLowerCase().startsWith(t.toLowerCase())||e.status.toLowerCase().startsWith(t.toLowerCase()),a=e.name.toLowerCase().includes(t.toLowerCase())||e.date.toLowerCase().includes(t.toLowerCase())||e.email.toLowerCase().includes(t.toLowerCase())||e.revenue.toLowerCase().includes(t.toLowerCase())||e.status.toLowerCase().includes(t.toLowerCase());return s||(!s&&a?a:null)}),this.setState({filteredData:a}))}catch(t){console.log(t)}},this.getStartAndEndDates=e=>{const t=new Date;let s=new Date,a=t;switch(e.value){case"custom":s=this.state.rangePicker[0],s&&(s=s?new Date(s.setDate(s.getDate()+1)):null),a=this.state.rangePicker[1]?new Date(this.state.rangePicker[1].setDate(this.state.rangePicker[1].getDate()+1)):null;break;case"1day":s.setDate(t.getDate()-1);break;case"1week":s.setDate(t.getDate()-6);break;case"1month":s.setMonth(t.getMonth()-1);break;case"6months":s.setMonth(t.getMonth()-6);break;case"1year":s.setFullYear(t.getFullYear()-1);break;case"all":s=null,a=null}return{startDate:s,endDate:a}},this.changeDate=async e=>{await this.setState({rangePicker:e})},this.callApiGetCustomerList=async()=>{let e=await fetch("/api/center/customers/list",{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:"Bearer "+JSON.parse(localStorage.getItem("token"))},body:JSON.stringify({centerId:this.props.match.params.centerId,getBasicData:!0,isYearData:!0,type:"deposits"})});const t=await e.json();if(200!==e.status)throw Error(t.message);return t},this.callApiRefreshCenterBillingList=async()=>{let e;e=await fetch("/api/center/billing/refresh",{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:"Bearer "+JSON.parse(localStorage.getItem("token"))},body:JSON.stringify({centerId:this.props.match.params.centerId,customerId:this.state.filterSelectedCustomer.value,billing:"refreshDeposits",mode:"general",status:this.state.filterDepositStatus.value})});return await e.json()},this.callApiGetCenterDepositList=async()=>
1{const e=await this.getStartAndEndDates(this.state.filterDates);let t;t=await fetch("/api/center/deposit/list",{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:"Bearer "+JSON.parse(localStorage.getItem("token"))},body:JSON.stringify({centerId:this.props.match.params.centerId,customerId:this.state.filterSelectedCustomer.value,startingAfter:e.startDate,endingBefore:e.endDate,limit:100,mode:"general",status:this.state.filterDepositStatus.value})});const s=await t.json();if(200!==t.status)throw Error(s.message);return s},this.callApiGenerateExcel=async()=>{let e;e=await fetch("/api/center/invoice/sendExcel",{method:"POST",mode:"cors",headers:{Authorization:"Bearer "+JSON.parse(localStorage.getItem("token")),"Content-Type":"application/json"},body:JSON.stringify({centerId:this.props.match.params.centerId,sendToEmail:this.state.emailFrom,date:this.state.selectedDate,mode:"general"})});const t=await e.json();if(200!==e.status)throw Error(t.message);return t},this.callApiExportDeposit=async()=>{let e;e=await fetch("/api/center/deposit/ExportDeposit",{method:"POST",mode:"cors",headers:{Authorization:"Bearer "+JSON.parse(localStorage.getItem("token")),"Content-Type":"application/json"},body:JSON.stringify({centerId:this.props.match.params.centerId,startingAfter:this.state.exportRangePicker[0],endingBefore:this.state.exportRangePicker[1]})});const t=await e.json();let s=t.publicPathName;s=s.replace("./frontend/public","");const a=document.createElement("a");return a.style.display="none",a.href=s,a.download=t.fileName+".csv",document.body.appendChild(a),a.click(),t},this.handleGenerateExcel=async()=>{try{if(""!==this.state.selectedDate&&""!==this.state.emailFrom){this.setState({loadingAlert:!0});const e=await this.callApiGenerateExcel();e.result?(this.setState({successAlert:!0}),this.toggleModalSend()):(this.setState({errorAlert:!0}),console.log(e.error))}}catch(e){this.setState({errorAlert:!0}),console.log(e)}this.setState({loadingAlert:!1})},this.handleExportDeposit=async()=>{try{if(""!==this.state.exportRangePicker[0]&&""!==this.state.exportRangePicker[1]){this.setState({loadingAlert:!0});const e=await this.callApiExportDeposit();console.log("response => ",e),e.success?(this.setState({exportSuccessAlert:!0}),this.toggleExportModalSend()):(this.setState({errorAlert:!0}),console.log(e.error))}}catch(e){this.setState({errorAlert:!0}),console.log(e)}this.setState({loadingAlert:!1})},this.filterByColumns=async()=>{try{let s=this.state.columns;var e=[];if(s.forEach(t=>{"customer_email"!==t.selector&&"number"!==t.selector||(null!=t&&("customer_email"===t.selector?(t.maxWidth="1rem",t.minWidth=this.state.width<380?"100px":this.state.width<440?"11rem":"14rem"):t.minWidth="40px"),e.push(t))}),e.length<=2){var t={selector:"modalCol",sortable:!0,minWidth:"30px",cell:e=>(0,Q.jsx)("div",{onClick:t=>this.openModal(e),className:"box-flex-end",children:(0,Q.jsx)(F.A,{})})};e.push(t)}this.setState({columns:e})}catch(s){console.log(s)}},this.mounted=!1,this.updateWidth=()=>{try{this.mounted&&this.setState(e=>({width:window.innerWidth}))}catch(e){console.log(e)}},this.openModal=e=>{try{this.state.width<576&&this.handleModal(e)}catch(t){console.log(t)}},this.handleModal=e=>{try{var t={resume:!1,pathname:this.props.location.pathname};if(t.resume)document.querySelector("#printButton").click();else{const s=t.pathname.replace("general","invoice");q.b.push(s+"/"+e.id)}}catch(s){console.log(s)}},this.textMod=e=>{try{var t={resume:!1,pathname:this.props.location.pathname,row:e,getData:this.props.getData,parsedFilter:this.props.parsedFilter,currentData:this.handleCurrentData};return null!=e?(0,Q.jsxs)("div",{className:"text-align-center",children:[(0,Q.jsxs)("p",{className:"ModalTable__Text",children:[(0,Q.jsx)("span",{className:"bold",children:(0,Q.jsx)(E.A,{id:"number"})}),(0,Q.jsx)("span",{className:"ml-1",children:e.number})]}),(0,Q.jsxs)("p",{className:"ModalTable__Text",children:[(0,Q.jsx)("span",{className:"bold",children:(0,Q.jsx)(E.A,{id:"name"})}),(0,Q.jsx)("span",{className:"ml-1",children:e.name})]}),(0,Q.jsxs)("p",{className:"ModalTable__Text",children:[(0,Q.jsx)("span",{className:"bold",children:(0,Q.jsx)(E.A,{id:"surname"})}),(0,Q.jsx)("span",{className:"ml-1",children:e.surname})]}),(0,Q.jsxs)("p",{className:"ModalTable__Text",children:[(0,Q.jsx)("span",{className:"bold",children:(0,Q.jsx)(E.A,{id:"NIF"})}),(0,Q.jsx)("span",{className:"ml-1",children:e.NIF})]}),(0,Q.jsxs)("p",{className:"ModalTable__Text",children:[(0,Q.jsx)("span",{className:"bold",children:(0,Q.jsx)(E.A,{id:"customerType"})}),(0,Q.jsx)("span",{className:"ml-1",children:(0,Q.jsx)(E.A,{id:e.customerType})})]}),(0,Q.jsxs)("p",{className:"ModalTable__Text",children:[(0,Q.jsx)("span",{className:"bold",children:(0,Q.jsx)(E.A,{id:"customer"})}),(0,Q.jsx)("span",{className:"ml-1",children:e.customer_email})]}),(0,Q.jsxs)("p",{className:"ModalTable__Text",children:[(0,Q.jsx)("span",{className:"bold",children:(0,Q.jsx)(E.A,{id:"taxBase"})}),(0,Q.jsx)("span",{className:"ml-1",children:this.currencyFormat(e.currency).format(e.subtotal/100)})]}),(0,Q.jsxs)("p",{className:"ModalTable__Text",children:[(0,Q.jsx)("span",{className:"bold",children:(0,Q.jsx)(E.A,{id:"VAT"})}),(0,Q.jsx)("span",{className:"ml-1",children:this.currencyFormat(e.currency).format(e.VAT/100)})]}),e.retention&&e.retention>0&&(0,Q.jsxs)("p",{className:"ModalTable__Text",children:[(0,Q.jsx)("span",{className:"bold",children:(0,Q.jsx)(E.A,{id:"retention"})}),(0,Q.jsx)("span",{className:"ml-1",children:this.currencyFormat(e.currency).format(e.retention/100)})]}),(0,Q.jsxs)("p",{className:"ModalTable__Text",children:[(0,Q.jsx)("span",{className:"bold",children:(0,Q.jsx)(E.A,{id:"total"})}),(0,Q.jsx)("span",{className:"ml-1",children:this.currencyFormat(e.currency).format(e.total/100)})]}),(0,Q.jsxs)("p",{className:"ModalTable__Text",children:[(0,Q.jsx)("span",{className:"bold",children:(0,Q.jsx)(E.A,{id:"createdAt"})}),(0,Q.jsx)("span",{className:"ml-1",children:(0,Q.jsxs)(i.Fragment,{children:[(0,Q.jsx)(L.XU,{value:new Date(Number.parseInt(e.created.toString())),year:"numeric",month:"long",day:"2-digit"})," ",(0,Q.jsx)(E.A,{id:"at"})," ",(0,Q.jsx)(L.ib,{value:new Date(Number.parseInt(e.created.toString()))})]})})]}),(0,Q.jsxs)("div",{className:"ModalTable__Text",children:[(0,Q.jsx)("span",{className:"bold",children:(0,Q.jsx)(E.A,{id:"status"})}),(0,Q.jsx)("span",{className:"ml-1",children:(0,Q.jsx)($.A,{className:"m-0",color:ee[e.status],text:(0,Q.jsx)(E.A,{id:e.status?e.status:"notData"})})})]}),(0,Q.jsx)(l.A,{className:"pam-0 mt-1",children:(0,Q.jsx)(n.A,{xs:"12",className:"ModalTable__Col MCol__Left",children:(0,Q.jsx)(o.A,{color:"primary",className:"w-100 h-100",onClick:()=>
1{if(t.resume)document.querySelector("#printButton").click();else{const e=t.pathname.replace("general","invoice");q.b.push(e+"/"+t.row.id)}},children:(0,Q.jsx)(P.A,{className:"cursor-pointer mr-1 t",size:20})})})})]}):"No hay datos disponibles para este trastero"}catch(s){console.log(s)}},this.changeCustomerEmailFilterValue=e=>{try{this.setState({filterSelectedCustomer:e})}catch(t){console.log(t)}},this.changeDepositStatusValue=e=>{try{this.setState({filterDepositStatus:e})}catch(t){console.log(t)}},this.handleAnyDate=async e=>{try{e.preventDefault(),await this.setState({rangePicker:[null,null]})}catch(t){console.log(t)}},this.exportHandleAnyDate=async e=>{try{e.preventDefault(),await this.setState({exportRangePicker:[null,null]})}catch(t){console.log(t)}},this.handleRefresh=async e=>{try{e.preventDefault(),await this.setState({loadingAlertMsg:"loadingDepositList..."}),await this.handleAlert("loadingAlert",!0);const t=await this.callApiRefreshCenterBillingList();console.log("resultado",t),await this.handleAlert("loadingAlert",!1)}catch(e){console.log(e)}},this.callApiUpdateDepositStatus=async(e,t)=>{try{let s=await fetch("/api/center/deposit/updateStatus",{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:"Bearer "+JSON.parse(localStorage.getItem("token"))},body:JSON.stringify({depositId:e,status:t})});const a=await s.json();if(200!==s.status)throw Error(a.message);return a}catch(s){throw console.log(s),s}},this.handleAcceptDeposit=async e=>{try{await this.handleAlert("loadingAlert",!0),await this.setState({loadingAlertMsg:"updatingDepositStatus..."});const t=await this.callApiUpdateDepositStatus(e.id,"succeeded");if(t.result||t.success){const t=this.state.data.map(t=>t.id===e.id?(0,a.A)((0,a.A)({},t),{},{status:"succeeded"}):t),s=[...this.state.resumeData];s.length,await this.setState({data:t,filteredData:t,resumeData:s}),await this.handleAlert("depositStatusUpdatedAlert",!0)}else await this.handleAlert("errorAlert",!0)}catch(t){console.log(t),await this.handleAlert("errorAlert",!0)}finally{await this.handleAlert("loadingAlert",!1)}},this.handleSearch=async e=>{try{e.preventDefault(),await this.setState({loadingAlertMsg:"loadingDepositList...",showPrintAll:!0}),await this.handleAlert("loadingAlert",!0);const t=await this.callApiGetCenterDepositList();if(console.log(t),t.invoiceList){let e=t.invoiceList;const s=[{currency:null,subtotal:0,VAT:0,retention:0,total:0,invoicesNumber:e.length}];for(let t of e)s[0].currency=t.currency,s[0].subtotal=s[0].subtotal+t.subtotal,s[0].total=s[0].total+t.total,Array.isArray(t.total_tax_amounts)&&t.total_tax_amounts[0]&&("privatePerson"===t.customerType?(t.VAT=t.total_tax_amounts[0].amount,t.retention=null,s[0].VAT=s[0].VAT+t.VAT):(t.VAT=t.subtotal*se,t.retention=t.VAT-t.total_tax_amounts[0].amount,s[0].VAT=s[0].VAT+t.VAT,s[0].retention=s[0].retention+t.retention));await this.setState({data:e,filteredData:e,resumeData:s})}else console.log(t.error)}catch(t){console.log(t)}await this.handleAlert("loadingAlert",!1)},this.changeYearFilterValue=e=>{this.setState({filterSelectedYear:e})},this.state={loadingAlert:!1,successAlert:!1,exportSuccessAlert:!1,depositStatusUpdatedAlert:!1,errorAlert:!1,loadingAlertMsg:"loading...",rangePicker:[new Date((new Date).setMonth((new Date).getMonth()-1)),new Date((new Date).setMonth((new Date).getMonth()))],exportRangePicker:[new Date((new Date).setMonth((new Date).getMonth()-1)),new Date((new Date).setMonth((new Date).getMonth()))],filtersDate:{startingAfter:new Date((new Date).setMonth((new Date).getMonth()-1)),endingBefore:new Date((new Date).setMonth((new Date).getMonth()))},columns:[{name:(0,Q.jsx)(E.A,{id:"number"}),selector:"number",minWidth:"150px",sortable:!0,cell:e=>(0,Q.jsx)("p",{className:"text-bold-500 text-truncate mb-0",children:e.number})},{name:(0,Q.jsx)(E.A,{id:"customer"}),selector:"customer_email",sortable:!0,minWidth:"300px",cell:e=>(0,Q.jsxs)("div",{children:[(0,Q.jsx)("p",{className:"text-bold-500 text-truncate mb-0",children:e.name+" "+e.surname}),(0,Q.jsx)("p",{className:"text-bold-500 text-truncate mb-0",children:e.customer_email}),(0,Q.jsx)("b",{className:"text-bold-500 text-truncate mb-0",children:e.NIF})]})},{name:(0,Q.jsx)(E.A,{id:"taxBase"}),selector:"taxBase",maxWidth:"80px",sortable:!0,cell:e=>(0,Q.jsx)("p",{className:"text-bold-500 mb-0",children:this.currencyFormat(e.currency).format(e.subtotal/100)})},{name:(0,Q.jsx)(E.A,{id:"retention"}),selector:"retention",maxWidth:"80px",sortable:!0,cell:e=>e.retention?(0,Q.jsx)("p",{className:"text-bold-500 mb-0",children:this.currencyFormat(e.currency).format(e.retention/100)}):null},{name:(0,Q.jsx)(E.A,{id:"status"}),selector:"status",minWidth:"140px",maxWidth:"180px",sortable:!0,cell:e=>{let t="light-danger";"succeeded"===e.status?t="light-success":"draft"===e.status||"abonada"===e.status||"refunded"===e.status||"refundedInBalance"===e.status?t="light-warning":"open"===e.status||"pending"===e.status?t="light-info":"void"===e.status?t="light-primary":"inBalance"===e.status&&(t="light-primary2");let s=null;switch(e.status){case"succeeded":s=(0,Q.jsx)(E.A,{id:"succeeded"});break;case"draft":s=(0,Q.jsx)(E.A,{id:"draft"});break;case"open":s=(0,Q.jsx)(E.A,{id:"openInvoice"});break;
1case"pending":s=(0,Q.jsx)(E.A,{id:"pendingStatus"});break;case"void":s=(0,Q.jsx)(E.A,{id:"void"});break;case"abonada":s=(0,Q.jsx)(E.A,{id:"invoiceRefund"});break;case"refunded":s=(0,Q.jsx)(E.A,{id:"refundedStatus"});break;case"refundedInBalance":s=(0,Q.jsx)(E.A,{id:"refundedInBalanceStatus"});break;case"inBalance":s=(0,Q.jsx)(E.A,{id:"inBalance"});break;default:s=(0,Q.jsx)(E.A,{id:"uncollectible"})}return(0,Q.jsx)("div",{style:{display:"flex",alignItems:"center",minHeight:"32px",padding:"4px 0"},children:(0,Q.jsx)(m.A,{color:t,pill:!0,style:{whiteSpace:"nowrap",display:"inline-block"},children:s})})}},{name:(0,Q.jsx)(E.A,{id:"paymentMethod"}),selector:"paymentMethodType",maxWidth:"180px",sortable:!0,cell:e=>(0,Q.jsx)("p",{className:"text-bold-500 mb-0",children:this.printPaymentMethodType(e.paymentMethodType)})},{name:(0,Q.jsx)(E.A,{id:"created"}),selector:"created",sortable:!0,cell:e=>(0,Q.jsx)("p",{className:"text-bold-500 mb-0",children:(0,Q.jsxs)(i.Fragment,{children:[(0,Q.jsx)(L.XU,{value:new Date(Number.parseInt(e.created.toString()+"000")),year:"numeric",month:"long",day:"2-digit"})," ",(0,Q.jsx)(E.A,{id:"at"})," ",(0,Q.jsx)(L.ib,{value:new Date(Number.parseInt(e.created.toString()+"000"))})]})})},{name:(0,Q.jsx)(E.A,{id:"actions"}),selector:"actions",maxWidth:"80px",cell:e=>(0,Q.jsx)(ce,{resume:!1,pathname:this.props.location.pathname,row:e,getData:this.props.getData,parsedFilter:this.props.parsedFilter,currentData:this.handleCurrentData,onAccept:this.handleAcceptDeposit})}],resumeColumns:[{name:(0,Q.jsx)(E.A,{id:"taxBase"}),selector:"taxBase",sortable:!0,cell:e=>(0,Q.jsx)("p",{className:"text-bold-500 mb-0",children:this.currencyFormat(e.currency).format(e.total_tax_amounts/100)})},{name:(0,Q.jsx)(E.A,{id:"VAT"}),selector:"VAT",sortable:!0,cell:e=>e.VAT?(0,Q.jsx)("p",{className:"text-bold-500 mb-0",children:this.currencyFormat(e.currency).format(e.VAT/100)}):null},{name:(0,Q.jsx)(E.A,{id:"retention"}),selector:"retention",sortable:!0,cell:e=>e.retention?(0,Q.jsx)("p",{className:"text-bold-500 mb-0",children:this.currencyFormat(e.currency).format(e.retention/100)}):null},{name:(0,Q.jsx)(E.A,{id:"total"}),selector:"total",sortable:!0,cell:e=>(0,Q.jsx)("p",{className:"text-bold-500 mb-0",children:this.currencyFormat(e.currency).format(e.total/100)})},{name:(0,Q.jsx)(E.A,{id:"printResume"}),selector:"actions",cell:e=>(0,Q.jsx)(ce,{resume:!0,pathname:this.props.location.pathname,row:e,getData:this.props.getData,parsedFilter:this.props.parsedFilter,currentData:this.handleCurrentData,this:this})}],data:[],resumeData:[],filteredData:[],value:"",perPage:10,newData:[],pathname:"",showPrintAll:!1,modalSend:!1,exportModalSend:!1,selectedDate:"",exportFromDate:"",exportToDate:"",emailFrom:Z.accountant_email,filterSelectedCustomer:ae[0],filterDepositStatus:re[0],filterSelectedYear:ie[0],ModalSetInvoice:!1,openingclosingEnabled:!0,chargeToCustomer:!0,invoiceCustomer:le[0],createInvoiceData:{},errorStatusInvoiceCustomerAlert:!1,successInvoiceCustomerAlert:!1,isDeposit:!0,filterDates:te[2]},this._filters=i.createRef(),this._modal=i.createRef()}printPaymentMethodType(e){try{switch(e){case"card":return(0,Q.jsx)(E.A,{id:"creditCard"});case"sepa_debit":return(0,Q.jsx)(E.A,{id:"sepa_debit"});case"transfer":return(0,Q.jsx)(E.A,{id:"transfer"})}}catch(t){return console.log(t),null}}async componentDidMount(){await this.props.auth?this.props.auth(this.props.allowedRoles,this.props.redirectTo):console.log("auth")}async componentDidMount(){const{intl:e}=this.props;try{this.mounted=!0,this.mounted&&(this.updateWidth(),"undefined"!==window&&window.addEventListener("resize",this.updateWidth,!1)),Z.USE_RETENTION||(this.state.columns.splice(this.state.columns.findIndex(e=>"retention"===e.selector),1),this.state.resumeColumns.splice(this.state.resumeColumns.findIndex(e=>"retention"===e.selector),1)),await this.setState({loadingAlertMsg:"loading..."}),await this.handleAlert("loadingAlert",!0),ae.length=0,ae.push({value:"all",label:(0,Q.jsx)(E.A,{id:"all"})}),this.state.width<776&&await this.filterByColumns();const t=await this.callApiGetCenterDepositList();if(t.invoiceList){let e=t.invoiceList;const s=[{currency:null,subtotal:0,VAT:0,retention:0,total:0,invoicesNumber:e.length}];for(let t of e)s[0].currency=t.currency,s[0].subtotal=s[0].subtotal+t.subtotal,s[0].total=s[0].total+t.total,Array.isArray(t.total_tax_amounts)&&t.total_tax_amounts[0]&&("privatePerson"===t.customerType?(t.VAT=t.total_tax_amounts[0].amount,t.retention=null,s[0].VAT=s[0].VAT+t.VAT):(t.VAT=t.subtotal*se,t.retention=t.VAT-t.total_tax_amounts[0].amount,s[
10].VAT=s[0].VAT+t.VAT,s[0].retention=s[0].retention+t.retention));await this.setState({data:e,filteredData:e,resumeData:s})}else console.log(t.error);await this.handleAlert("loadingAlert",!1);const s=await this.callApiGetCustomerList();if(s.result){s.customerList.sort(function(e,t){return e.email<t.email?-1:e.email>t.email?1:0}),le.length=0,le.push({value:"0",label:(0,Q.jsx)(E.A,{id:"selectanyone"})});for(const e of s.customerList)ae.push({value:e.emailId,label:e.email}),le.push({value:e.emailId,label:e.email});for(const e of s.yearsData){let t={value:e,label:e};ie.push(t)}}else console.log(s.error);const a=await this.callApiGetStorages(this.props.match.params.centerId);if(console.log("ghsidyufgsiuyfe",a),a.result)if(a.storageList.length>=1){1==ne.length&&ne.shift();for(const t of a.storageList){let s=e.formatMessage({id:t.availability});ne.push({value:t.number,label:t.groupName&&t.groupNumber?t.groupName+" n\xba"+t.groupNumber+"(".concat(s,")"):"Trastero n\xba"+t.number+"(".concat(s,")")})}}else 1==ne.length&&ne.shift(),ne.push({value:0,label:"No hay trasteros en proceso de baja"});else console.log(s.error)}catch(t){console.log(t)}await this.handleAlert("loadingAlert",!1)}render(){try{var{columns:e,filteredData:t}=this.state;const{intl:a}=this.props;oe.rangeSeparatorText=a.formatMessage({id:"of",defaultMessage:"of"});var s=!1;t.length>0&&(s=!0)}catch(m){console.log(m)}return(0,Q.jsxs)(i.Fragment,{children:[(0,Q.jsx)(E.A,{id:"title_listinvoices",children:e=>(0,Q.jsx)(E.A,{id:"meta_listinvoices",children:t=>(0,Q.jsxs)(T.m,{children:[(0,Q.jsx)("title",{children:e}),(0,Q.jsx)("meta",{name:"description",content:t})]})})}),(0,Q.jsxs)(p.A,{children:[(0,Q.jsxs)(x.A,{className:"Invoice__CardHeader bg-primary text-white",children:[(0,Q.jsx)(A.A,{className:"Invoice__CardTitle text-white mb-2 text-uppercase",children:(0,Q.jsx)(E.A,{id:"deposits"})}),(0,Q.jsx)("div",{className:"Invoice__ButtonExcelContainer mb-2",children:(0,Q.jsxs)(l.A,{children:[(0,Q.jsx)(n.A,{md:"6",children:(0,Q.jsxs)(S.A,{children:[(0,Q.jsxs)(h.A,{color:"primary",caret:!0,children:[(0,Q.jsx)(E.A,{id:"documentExport"}),(0,Q.jsx)(_.A,{size:15})]}),(0,Q.jsxs)(d.A,{children:[(0,Q.jsx)(c.A,{className:"border-bottom-dark",onClick:this.toggleExportModalSend,children:(0,Q.jsx)(E.A,{id:"exportDeposit"})}),(0,Q.jsx)(c.A,{onClick:this.toggleModalSend,children:(0,Q.jsx)(E.A,{id:"generateExcel"})})]})]})}),(0,Q.jsx)(n.A,{md:"6",children:(0,Q.jsxs)(o.A,{className:"float-right Button__Excel bg-white",onClick:this.toggleModalSetInvoice,children:[(0,Q.jsx)(E.A,{id:"newDeposit"}),(0,Q.jsx)(M.A,{size:18,className:"ml-1"})]})})]})})]}),(0,Q.jsxs)(u.A,{className:"rdt_Wrapper",children:[(0,Q.jsxs)(p.A,{className:"filters",children:[(0,Q.jsx)(x.A,{className:"filters__tittle mx-auto noPaddingTop",children:(0,Q.jsx)(l.A,{children:this.state.showPrintAll?(0,Q.jsx)("a",{href:"./depositList?customerId=".concat(this.state.filterSelectedCustomer.value,"&status=").concat(this.state.filterDepositStatus?this.state.filterDepositStatus.value:"all","&customerType=").concat(this.state.filterUsers?this.state.filterUsers.value:"all","&customerEmail=").concat(this.state.filterSelectedCustomer.label,"&startingAfter=").concat(this.state.filtersDate.startingAfter?this.state.filtersDate.startingAfter.getTime():"null","&endingBefore=").concat(this.state.filtersDate.endingBefore?this.state.filtersDate.endingBefore.getTime():"null","&mode=","general"),children:(0,Q.jsxs)("div",{id:"FileTextIcon",className:"PrintAll__Box mr-1 t ml-5",children:[(0,Q.jsx)(P.A,{className:"cursor-pointer ",size:20}),(0,Q.jsx)(D.A,{placement:"top",target:"FileTextIcon",children:(0,Q.jsx)(E.A,{id:"PrintAll"})})]})}):null})}),(0,Q.jsx)(u.A,{className:"pl-0 pr-0",children:(0,Q.jsx)("div",{className:"filters__options card-btns d-flex justify-content-between",children:(0,Q.jsxs)(r.A,{className:"filters__search",children:[(0,Q.jsxs)(l.A,{className:"filters__byOption justify-content-center",children:[(0,Q.jsxs)(n.A,{className:"filters__option filters__option-dropdown mb-xl-0",md:"2",style:{position:"relative",zIndex:"1000"},children:[(0,Q.jsx)("h5",{className:"filters_selectTittle",children:(0,Q.jsx)(E.A,{id:"status"})}),(0,Q.jsx)(E.A,{id:"status",children:e=>(0,Q.jsx)(J.Ay,{className:"React select-long select-outlineColor",classNamePrefix:"select",name:"users",options:re,isClearable:!1,value:this.state.filterDepositStatus,placeholder:e,onChange:e=>this.changeDepositStatusValue(e),components:{Option:e=>{let{innerProps:t,label:s,data:i}=e;return(0,Q.jsxs)("div",(0,a.A)((0,a.A)({},t),{},{className:"status-option",children:[(0,Q.jsx)("span",{className:"color-indicator",style:{backgroundColor:i.color}}),s]}))}}})})]}),(0,Q.jsxs)(n.A,{className:"filters__option filters__option-dropdown mb-xl-0",md:"3",style:{position:"relative",zIndex:"1000"},children:[(0,Q.jsx)("h5",{className:"filters_selectTittle",children:(0,Q.jsx)(E.A,{id:"filterUser"})}),(0,Q.jsx)(E.A,{id:"filterBy",children:e=>(0,Q.jsx)(J.Ay,{className:"React select-long select-outlineColor",classNamePrefix:"select",name:"users",options:ae,isClearable:!1,value:this.state.filterSelectedCustomer,placeholder:e,onChange:e=>this.changeCustomerEmailFilterValue(e)})})]}),(0,Q.jsxs)(n.A,{className:"filters__option filters__option-dropdown mb-xl-0",md:"2",children:[(0,Q.jsx)("h5",{className:"filters_selectTittle ml-1 hideDate",children:(0,Q.jsx)(E.A,{id:"filterDate"})}),(0,Q.jsx)(E.A,{id:"filterBy",children:e=>(0,Q.jsx)(J.Ay,{className:"React select-long select-outlineColor",classNamePrefix:"select",name:"date",options:te,isClearable:!1,value:this.state.filterDates,placeholder:e,onChange:e=>this.changeSelectedDate(e)})})]}),"custom"===this.state.filterDates.value&&(0,Q.jsx)(n.A,{className:"filters__option filters__option-dropdown mb-xl-0 mx-3",md:"2",style:{position:"relative",zIndex:"1002"},children:(0,Q.jsx)(W.A,{value:this.state.rangePicker,onChange:this.changeDate,className:"form-control",options:{mode:"range",locale:Y.
1Spanish}})})]}),(0,Q.jsx)(l.A,{children:(0,Q.jsxs)(n.A,{className:"d-flex justify-content-center mt-3 mb-xl-0",children:[(0,Q.jsx)(o.A.Ripple,{color:"primary",outline:!0,onClick:this.handleSearch,className:"mr-1",children:(0,Q.jsx)(E.A,{id:"search"})}),"SUPER_ADMIN"===JSON.parse(atob(localStorage.getItem("token").split(".")[1])).role&&(0,Q.jsx)(o.A.Ripple,{color:"primary",onClick:this.handleRefresh,children:(0,Q.jsx)(E.A,{id:"update"})})]})})]})})})]}),(0,Q.jsxs)("div",{children:[(0,Q.jsx)(U(),{trigger:()=>(0,Q.jsx)("button",{className:"notDisplay",id:"printButton"}),content:()=>this.componentRef}),(0,Q.jsx)("div",{className:"notDisplay",children:(0,Q.jsx)(X.A,{showRetention:!0,type:"general",date:this.state.rangePicker,data:this.state.data,resumeData:this.state.resumeData,columns:this.state.columns,resumeColumns:this.state.resumeColumns,ref:e=>this.componentRef=e})})]}),s?(0,Q.jsx)(i.Fragment,{children:(0,Q.jsx)(O.Ay,{className:"dataTable-custom",data:this.state.data,columns:e,noHeader:!0,pagination:!0,paginationPerPage:this.state.perPage,paginationRowsPerPageOptions:[this.state.perPage,20,50,100],paginationComponentOptions:oe})}):null]})]}),(0,Q.jsxs)(H(),{title:(0,Q.jsx)(E.A,{id:this.state.loadingAlertMsg}),show:this.state.loadingAlert,disabled:!0,showConfirm:!1,onConfirm:()=>null,children:[(0,Q.jsx)(C.A,{size:"lg",color:"primary"}),(0,Q.jsx)("br",{}),(0,Q.jsx)("br",{}),(0,Q.jsx)(E.A,{id:"thisProcessCouldExpendTime"})]}),(0,Q.jsxs)(j.A,{isOpen:this.state.modalSend,toggle:this.toggleModalSend,className:"modal-dialog-centered",fade:!1,children:[(0,Q.jsx)(g.A,{toggle:this.toggleModalSend,children:(0,Q.jsx)(E.A,{id:"generateExcel"})}),(0,Q.jsxs)(b.A,{children:[(0,Q.jsx)(l.A,{children:(0,Q.jsxs)(n.A,{md:"8",sm:"12",children:[(0,Q.jsx)(E.A,{id:"sendTo"}),(0,Q.jsx)(y.A,{value:this.state.emailFrom,type:"text",onChange:e=>{this.setState({emailFrom:e.target.value})}})]})}),(0,Q.jsx)("br",{}),(0,Q.jsx)(l.A,{children:(0,Q.jsxs)(n.A,{md:"8",sm:"12",children:[(0,Q.jsx)(E.A,{id:"selectMonth"}),(0,Q.jsx)(y.A,{value:this.state.selectedDate,type:"month",max:(new Date).getFullYear()+"-"+(0,K.c)((new Date).getMonth()+1,2),onChange:e=>{this.setState({selectedDate:e.target.value})}})]})})]}),(0,Q.jsxs)(f.A,{children:[(0,Q.jsx)(o.A,{color:"primary",onClick:this.handleGenerateExcel,children:(0,Q.jsx)(E.A,{id:"accept"})})," "]})]}),(0,Q.jsx)(H(),{success:!0,title:(0,Q.jsx)(E.A,{id:"successMailContableInvoice"}),show:this.state.successAlert,onConfirm:()=>this.handleAlert("successAlert",!1)}),(0,Q.jsx)(H(),{success:!0,title:(0,Q.jsx)(E.A,{id:"exportedSuccessDeposit"}),show:this.state.exportSuccessAlert,onConfirm:()=>this.handleAlert("exportSuccessAlert",!1)}),(0,Q.jsx)(H(),{success:!0,title:(0,Q.jsx)(E.A,{id:"depositStatusUpdatedSuccess"}),show:this.state.depositStatusUpdatedAlert,onConfirm:()=>this.handleAlert("depositStatusUpdatedAlert",!1)}),(0,Q.jsx)(H(),{error:!0,title:(0,Q.jsx)(E.A,{id:"errorMailContableInvoice"}),show:this.state.errorAlert,onConfirm:()=>this.handleAlert("errorAlert",!1)}),(0,Q.jsxs)(j.A,{isOpen:this.state.exportModalSend,toggle:this.toggleExportModalSend,className:"modal-dialog-centered",fade:!1,children:[(0,Q.jsx)(g.A,{toggle:this.toggleExportModalSend,children:(0,Q.jsx)(E.A,{id:"exportDeposit"})}),(0,Q.jsx)(b.A,{children:(0,Q.jsx)(l.A,{children:(0,Q.jsxs)(n.A,{md:"12",sm:"12",children:[(0,Q.jsx)(E.A,{id:"selectDatesToExportCSV"}),(0,Q.jsxs)(w.A,{children:[(0,Q.jsx)(N.A,{addonType:"prepend",children:(0,Q.jsx)(o.A,{color:"primary",onClick:this.exportHandleAnyDate,children:(0,Q.jsx)(E.A,{id:"anyDate"})})}),(0,Q.jsx)(W.A,{value:this.state.exportRangePicker,onChange:e=>{this.setState({exportRangePicker:e})},className:"form-control",options:{mode:"range",locale:Y.Spanish}})]})]})})}),(0,Q.jsxs)(f.A,{children:[(0,Q.jsx)(o.A,{color:"primary",onClick:this.handleExportDeposit,children:(0,Q.jsx)(E.A,{id:"Export"})})," "]})]}),(0,Q.jsxs)(j.A,{isOpen:this.state.ModalSetInvoice,toggle:this.toggleModalSetInvoice,className:"modal-dialog-centered",fade:!1,children:[(0,Q.jsx)(g.A,{toggle:this.toggleModalSetInvoice,children:(0,Q.jsx)(E.A,{id:"ModalSetDepositHeader"})}),(0,Q.jsx)(b.A,{children:(0,Q.jsxs)(l.A,{children:[(0,Q.jsxs)(n.A,{md:"12",sm:"12",className:"d-flex justify-content-center mt-2 mb-2",children:[(0,Q.jsxs)("label",{className:"react-toggle-wrapper d-inline-block align-middle d-flex align-items-center mr-3",children:[(0,Q.jsx)(R.A,{defaultChecked:this.state.chargeToCustomer,onChange:e=>{this.setState({chargeToCustomer:!this.state.chargeToCustomer}),!0===this.state.chargeToCustomer&&this.setState({openingclosingEnabled:!1})},name:"chargeToCustomer"}),(0,Q.jsx)("span",{className:"label-text align-middle",children:(0,Q.jsx)(E.A,{id:"chargeToCustomer"})})]}),(0,Q.jsxs)("label",{className:"react-toggle-wrapper d-inline-block align-middle d-flex align-items-center",children:[(0,Q.jsx)(R.A,{defaultChecked:!this.state.chargeToCustomer&&this.state.openingclosingEnabled,onChange:e=>{this.setState({openingclosingEnabled:!this.state.openingclosingEnabled})},name:"openingclosingEnabledSwitch",checked:!this.state.chargeToCustomer&&this.state.openingclosingEnabled}),(0,Q.jsx)("span",{className:"label-text align-middle",children:(0,Q.jsx)(E.A,{id:"openingClosingEnabled"})})]}),(0,Q.jsx)("br",{})]}),(0,Q.jsx)(n.A,{md:"12",sm:"12",children:this.state.isDeposit&&(0,Q.jsx)(v.A,{className:"m-1",color:"warning",children:(0,Q.jsx)("span",{children:(0,Q.jsx)(E.A,{id:"indicatingMessageForDepositCreation",children:e=>(0,Q.jsx)("span",{children:e.split("\n").map((e,t)=>(0,Q.jsxs)(i.Fragment,{children:[e,(0,Q.jsx)("br",{}),(0,Q.jsx)("br",{})]},t))})})})})}),(0,Q.jsx)(n.A,{md:"12",sm:"12",children:(0,Q.jsxs)(l.A,{className:"p-1",children:[(0,Q.jsx)(n.A,{md:"3",children:(0,Q.jsx)("strong",{children:"Customer"})}),(0,Q.jsx)(n.A,{md:"9",children:(0,Q.jsx)(J.Ay,{className:"React select-long select-outlineColor",classNamePrefix:"select",name:"users",id:"selectCus",options:le,isClearable:!1,required:"true",value:this.state.invoiceCustomer,onChange:e=>this.setState({invoiceCustomer:e})})})]})}),(0,Q.jsx)(n.A,{md:"12",sm:"12",children:(0,Q.jsxs)(l.A,{className:"p-1",children:[(0,Q.jsx)(n.A,{md:"3",children:(0,Q.jsx)("strong",{children:"Storage"})}),(0,Q.jsx)(n.A,{md:"9",children:(0,Q.jsx)(J.Ay,{className:"React select-long select-outlineColor",classNamePrefix:"select",name:"storage",options:ne,value:this.state.invoiceStorage,onChange:e=>this.changeInvoiceStorage(e)}
1)})]})}),(0,Q.jsx)(B.A,{centersList:this.state.centersList,sendDataToPenalties:this.receiveDataFromPeanaltiesAddnewline,isDeposit:!0})]})}),(0,Q.jsxs)(f.A,{children:[(0,Q.jsx)(o.A,{color:"primary",outline:!0,onClick:this.toggleModalSetInvoice,children:(0,Q.jsx)(E.A,{id:"back"})})," ",(0,Q.jsx)(o.A,{disabled:this.state.formValidate,color:"".concat(this.state.formValidate?"secondary":"primary"),onClick:this.handleInvoiceuser,children:(0,Q.jsx)(E.A,{id:"create"})})," "]})]}),(0,Q.jsx)(H(),{success:!0,title:(0,Q.jsx)(E.A,{id:"successInvoicemessage"}),show:this.state.successInvoiceCustomerAlert,onConfirm:()=>window.location.reload(!0)}),(0,Q.jsx)(H(),{error:!0,title:(0,Q.jsx)(E.A,{id:"errorStatusInvoiceCustomerAlert"}),show:this.state.errorStatusInvoiceCustomerAlert,onConfirm:()=>window.location.reload(!0)})]})}}const he=(0,V.Ay)(de)},82096(){},90933(){},99024(e,t,s){s.d(t,{A:()=>n});var a=s(65043),i=s(7875),r=s(70579);class l extends a.Component{constructor(){super(...arguments),this.closeChip=e=>{e.target.closest(".chip").remove()}}render(){return(0,r.jsx)("div",{className:"chip ".concat(this.props.className," ").concat(this.props.color?"chip-".concat(this.props.color):null),children:(0,r.jsxs)("div",{className:"chip-body",children:[!this.props.avatarImg&&this.props.avatarText||!this.props.avatarImg&&this.props.avatarIcon?(0,r.jsx)("div",{className:"avatar ".concat(this.props.avatarColor?"bg-".concat(this.props.avatarColor):null),children:(0,r.jsxs)("div",{className:"avatar-content",children:[this.props.avatarText?this.props.avatarText:null,this.props.avatarIcon?this.props.avatarIcon:null]})}):this.props.avatarImg?(0,r.jsx)("div",{className:"avatar",children:(0,r.jsx)("img",{src:this.props.avatarImg,alt:"chipImg",height:"20",width:"20"})}):null,(0,r.jsx)("div",{className:"chip-text",children:this.props.text}),this.props.closable?(0,r.jsx)("div",{className:"chip-closable",onClick:e=>this.closeChip(e),children:this.props.closableIcon?this.props.closableIcon:(0,r.jsx)(i.A,{})}):null]})})}}const n=l}}]);
2//# sourceMappingURL=7277.5ad69a8e.chunk.js.map

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.