(window.webpackJsonp=window.webpackJsonp||[]).push([[89],{1592:function(e,a,t){"use strict";t.r(a);var n=t(0),r=t.n(n),i=t(24),o=t.n(i),s=t(25),l=t.n(s),c=t(22),m=t.n(c),u=t(26),d=t.n(u),v=t(27),p=t.n(v),f=t(16),g=t.n(f),h=t(6),b=t.n(h),y=t(31),N=t(14),O=t(4),w=t(706),E=t.n(w),C=t(7),I=t.n(C),T=t(703),A=t(702),F=t(700),M=t(699),j=t(202),P=t(705),q=t(793),S=t(872),k=t(827),x=t(106);function R(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);a&&(n=n.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,n)}return t}function D(e){for(var a=1;a<arguments.length;a++){var t=null!=arguments[a]?arguments[a]:{};a%2?R(Object(t),!0).forEach((function(a){b()(e,a,t[a])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):R(Object(t)).forEach((function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(t,a))}))}return e}function L(e){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=g()(e);if(a){var r=g()(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return p()(this,t)}}I.a.locale("nl");var z=function(e){d()(t,e);var a=L(t);function t(e){var n;return o()(this,t),n=a.call(this,e),b()(m()(n),"handleInputChange",(function(e){var a=e.target,t="checkbox"===a.type?a.checked:a.value,r=a.name;n.setState(D(D({},n.state),{},{financialOverview:D(D({},n.state.financialOverview),{},b()({},r,t))}))})),b()(m()(n),"handleInputChangeDate",(function(e,a){n.setState(D(D({},n.state),{},{financialOverview:D(D({},n.state.financialOverview),{},b()({},a,e))}))})),b()(m()(n),"handleReactSelectChange",(function(e,a){n.setState(D(D({},n.state),{},{financialOverview:D(D({},n.state.financialOverview),{},b()({},a,e))}))})),b()(m()(n),"handleSubmit",(function(e){e.preventDefault();var a=n.state.financialOverview,t={},r={},i=!1;E.a.isEmpty(a.year+"")&&(t.year=!0,r.year="Jaar is een verplicht veld.",i=!0),a.year<2e3&&(t.year=!0,r.year="Jaar mag niet voor 2000 liggen.",i=!0),E.a.isEmpty(a.administrationId+"")&&(t.administrationId=!0,r.administrationId="Administratie is een verplicht veld.",i=!0),E.a.isEmpty(a.documentTemplateFinancialOverviewId+"")&&(t.documentTemplateFinancialOverviewId=!0,r.documentTemplateFinancialOverviewId="Document template is een verplicht veld.",i=!0),n.state.financialOverviews.map((function(e){e.year==a.year&&e.administrationId==a.administrationId&&(i=!0,t.year=t.administrationId=!0,r.year=r.administrationId="Waardestaat voor jaar "+e.year+" en administratie "+e.administration.name+" bestaat al.")})),n.setState(D(D({},n.state),{},{errors:t,errorMessage:r})),!i&&q.a.newFinancialOverview(a).then((function(e){O.f.push("/waardestaat/".concat(e.data.data.id))})).catch((function(e){alert("Er is iets mis gegaan met opslaan!")}))})),n.state={financialOverviews:[],financialOverview:{year:I()().subtract(1,"year").format("Y"),description:"",documentTemplateFinancialOverviewId:"",administrationId:"",definitive:!1,statusId:"",dateProcessed:null},documentTemplates:[],errorMessage:!1,errors:{year:!1,administrationId:!1,documentTemplateFinancialOverviewId:!1}},n}return l()(t,[{key:"componentDidMount",value:function(){var e=this;S.a.fetchFinancialOverviews().then((function(a){e.setState(D(D({},e.state),{},{financialOverviews:a.data.data}))})).catch((function(a){e.setState(D(D({},e.state),{},{hasError:!0}))})),x.a.fetchDocumentTemplatesPeekGeneral().then((function(a){var t=[];a.forEach((function(e){"financial-overview"==e.group&&t.push({id:e.id,name:e.name})})),e.setState({documentTemplates:t})}))}},{key:"render",value:function(){var e=this.state.financialOverview,a=e.year,t=e.administrationId,n=e.documentTemplateFinancialOverviewId;return r.a.createElement("form",{className:"form-horizontal",onSubmit:this.handleSubmit},r.a.createElement(M.a,null,r.a.createElement(F.a,null,r.a.createElement("div",{className:"row"},r.a.createElement(T.a,{label:"Jaar",type:"number",name:"year",value:a,min:2e3,onChangeAction:this.handleInputChange,required:"required",error:this.state.errors.year,errorMessage:this.state.errorMessage.year}),r.a.createElement(P.a,{label:"Administratie",name:"administrationId",value:t,options:this.props.administrations,optionName:"name",onChangeAction:this.handleInputChange,required:"required",error:this.state.errors.administrationId,errorMessage:this.state.errorMessage.administrationId})),r.a.createElement("div",{className:"row"},r.a.createElement(k.a,{label:"Document template",name:"documentTemplateFinancialOverviewId",options:this.state.documentTemplates,value:n,onChangeAction:this.handleReactSelectChange,required:"required",multi:!1,error:this.state.errors.documentTemplateFinancialOverviewId,errorMessage:this.state.errorMessage.documentTemplateFinancialOverviewId}))),r.a.createElement(F.a,null,r.a.createElement("div",{className:"pull-right btn-group",role:"group"},r.a.createElement(A.a,{buttonText:"Opslaan",onClickAction:this.handleSubmit,type:"submit",value:"Submit"})))))}}]),t}(n.Component),B=Object(y.b)((function(e){return{administrations:e.meDetails.administrations}}),(function(e){return Object(N.b)({fetchSystemData:j.a},e)}))(z),J=t(701),V=function(){return r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col-md-4"},r.a.createElement("div",{className:"btn-group btn-group-flex margin-small",role:"group"},r.a.createElement(J.a,{iconName:"glyphicon-arrow-left",onClickAction:O.e.goBack}))),r.a.createElement("div",{className:"col-md-4"},r.a.createElement("h4",{className:"text-center margin-small"},"Nieuwe waardestaat")),r.a.createElement("div",{className:"col-md-4"}))};a.default=function(){return r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col-md-9"},r.a.createElement("div",{className:"col-md-12 margin-10-top"},r.a.createElement(M.a,null,r.a.createElement(F.a,{className:"panel-small"},r.a.createElement(V,null)))),r.a.createElement("div",{className:"col-md-12 margin-10-top"},r.a.createElement(B,null))),r.a.createElement("div",{className:"col-md-3"}))}},699:function(e,a,t){"use strict";var n=t(0),r=t.n(n),i=t(8),o=t.n(i),s=function(e){var a=e.children,t=e.className,n=e.onMouseEnter,i=e.onMouseLeave;return r.a.createElement("div",{className:"panel panel-default ".concat(t),onMouseEnter:n,onMouseLeave:i},a)};s.defaultProps={className:"",onMouseEnter:function(){},onMouseLeave:function(){}},s.propTypes={className:o.a.string,onMouseEnter:o.a.func,onMouseLeave:o.a.func},a.a=s},700:function(e,a,t){"use strict";var n=t(0),r=t.n(n),i=t(8),o=t.n(i),s=function(e){var a=e.className,t=e.children;return r.a.createElement("div",{className:"panel-body ".concat(a)},t)};s.defaultProps={className:""},s.propTypes={className:o.a.string},a.a=s},701:function(e,a,t){"use strict";var n=t(0),r=t.n(n),i=t(8),o=t.n(i),s=function(e){var a=e.buttonClassName,t=e.iconName,n=e.onClickAction,i=e.title,o=e.disabled;return r.a.createElement("button",{type:"button",className:"btn ".concat(a),onClick:n,disabled:o,title:i},r.a.createElement("span",{className:"glyphicon ".concat(t)}))};s.defaultProps={buttonClassName:"btn-success btn-sm",title:"",disabled:!1},s.propTypes={buttonClassName:o.a.string,iconName:o.a.string.isRequired,onClickAction:o.a.func,title:o.a.string,disabled:o.a.bool},a.a=s},702:function(e,a,t){"use strict";var n=t(0),r=t.n(n),i=t(8),o=t.n(i),s=function(e){var a=e.buttonClassName,t=e.buttonText,n=e.onClickAction,i=e.type,o=e.value,s=e.loading,l=e.loadText,c=e.disabled;return s?r.a.createElement("button",{type:i,className:"btn btn-sm btn-loading ".concat(a),value:o,disabled:s},r.a.createElement("span",{className:"glyphicon glyphicon-refresh glyphicon-refresh-animate"})," ",l):r.a.createElement("button",{type:i,className:"btn btn-sm ".concat(a),onClick:n,value:o,disabled:c},t)};s.defaultProps={buttonClassName:"btn-success",type:"button",value:"",loading:!1,loadText:"Aan het laden",disabled:!1},s.propTypes={buttonClassName:o.a.string,buttonText:o.a.string.isRequired,onClickAction:o.a.func,type:o.a.string,value:o.a.string,loading:o.a.bool,loadText:o.a.string,disabled:o.a.bool},a.a=s},703:function(e,a,t){"use strict";var n=t(0),r=t.n(n),i=t(8),o=t.n(i),s=function(e){var a=e.label,t=e.type,n=e.className,i=e.size,o=e.id,s=e.placeholder,l=e.name,c=e.value,m=e.onClickAction,u=e.onChangeAction,d=e.onBlurAction,v=e.required,p=e.readOnly,f=e.maxLength,g=e.error,h=e.min,b=e.max,y=e.step,N=e.errorMessage,O=e.divSize,w=e.divClassName,E=e.autoComplete;return r.a.createElement("div",{className:"form-group ".concat(O," ").concat(w)},r.a.createElement("label",{htmlFor:o,className:"col-sm-6 ".concat(v)},a),r.a.createElement("div",{className:"".concat(i)},r.a.createElement("input",{type:t,className:"form-control input-sm ".concat(n)+(g?"has-error":""),id:o,placeholder:s,name:l,value:c||"",onClick:m,onChange:u,onBlur:d,readOnly:p,maxLength:f,min:h,max:b,autoComplete:E,step:y})),g&&r.a.createElement("div",{className:"col-sm-offset-6 col-sm-6"},r.a.createElement("span",{className:"has-error-message"}," ",N)))};s.defaultProps={divClassName:"",className:"",size:"col-sm-6",divSize:"col-sm-6",name:"",type:"text",value:"",required:"",readOnly:!1,maxLength:null,error:!1,min:"",max:"",step:"",errorMessage:"",autoComplete:"off",onBlurAction:function(){},onClickAction:function(){},onChangeAction:function(){}},s.propTypes={label:o.a.oneOfType([o.a.string,o.a.object]).isRequired,type:o.a.string,className:o.a.string,divClassName:o.a.string,size:o.a.string,divSize:o.a.string,id:o.a.string,placeholder:o.a.string,name:o.a.string.isRequired,value:o.a.oneOfType([o.a.string,o.a.number]),onClickAction:o.a.func,onChangeAction:o.a.func,onBlurAction:o.a.func,required:o.a.string,readOnly:o.a.bool,maxLength:o.a.string,error:o.a.bool,min:o.a.string,max:o.a.string,step:o.a.string,errorMessage:o.a.string,autoComplete:o.a.string},a.a=s},705:function(e,a,t){"use strict";var n=t(0),r=t.n(n),i=t(8),o=t.n(i),s=function(e){var a=e.label,t=e.className,n=e.size,i=e.id,o=e.name,s=e.value,l=e.options,c=e.onChangeAction,m=e.onBlurAction,u=e.required,d=e.error,v=e.errorMessage,p=e.optionValue,f=e.optionName,g=e.readOnly,h=e.placeholder,b=e.divClassName,y=e.emptyOption;return r.a.createElement("div",{className:"form-group ".concat(n," ").concat(b)},r.a.createElement("label",{htmlFor:i,className:"col-sm-6 ".concat(u)},a),r.a.createElement("div",{className:"col-sm-6"},r.a.createElement("select",{className:"form-control input-sm ".concat(t)+(d&&" has-error"),id:i,name:o,value:s||"",onChange:c,onBlur:m,readOnly:g},y&&r.a.createElement("option",{value:""},h),l.map((function(e){return r.a.createElement("option",{key:e[p],value:e[p]},e[f])})))),d&&r.a.createElement("div",{className:"col-sm-offset-6 col-sm-6"},r.a.createElement("span",{className:"has-error-message"}," ",v)))};s.defaultProps={divClassName:"",className:"",size:"col-sm-6",readOnly:!1,required:"",error:!1,errorMessage:"",value:"",optionValue:"id",optionName:"name",placeholder:"",emptyOption:!0},s.propTypes={label:o.a.string.isRequired,className:o.a.string,size:o.a.string,id:o.a.string,name:o.a.string.isRequired,options:o.a.array,value:o.a.oneOfType([o.a.string,o.a.number]),onChangeAction:o.a.func,onBlurAction:o.a.func,required:o.a.string,readOnly:o.a.bool,error:o.a.bool,errorMessage:o.a.string,emptyOption:o.a.bool,optionValue:o.a.string,optionName:o.a.string,placeholder:o.a.string},a.a=s},793:function(e,a,t){"use strict";var n=t(12);a.a={fetchFinancialOverviewDetails:function(e){var a="jory/financial-overview/".concat(e);return n.a.get(a,{params:{jory:{fld:["id","description","administrationId","year","definitive","statusId","dateProcessed","documentTemplateFinancialOverviewId","totalFinancialOverviewProjectsInProgress","totalFinancialOverviewProjectsConcept","totalFinancialOverviewProjectsDefinitive"],rlt:{administration:{fld:["id","name"]},documentTemplateFinancialOverview:{fld:["id","name"]}}}}})},newFinancialOverview:function(e){return e.jory=JSON.stringify({fld:["id"]}),n.a.post("financial-overview",e)},updateFinancialOverview:function(e){var a="".concat("financial-overview","/").concat(e.id);return n.a.post(a,e)},deleteFinancialOverview:function(e){var a="".concat("financial-overview","/").concat(e,"/delete");return n.a.post(a)},fetchNewProjectsForFinancialOverview:function(e){var a="".concat("financial-overview","/").concat(e.id,"/projects-for-financial-overview");return n.a.get(a,e)},fetchTotalsInfoFinancialOverview:function(e){var a="".concat("financial-overview","/").concat(e.id,"/totals-info-financial-overview");return n.a.get(a,e)}}},827:function(e,a,t){"use strict";var n=t(0),r=t.n(n),i=t(8),o=t.n(i),s=t(721),l=(t(722),function(e){var a=e.label,t=e.id,n=e.name,i=e.value,o=e.options,l=e.optionId,c=e.optionName,m=e.onChangeAction,u=e.required,d=e.multi,v=e.error,p=e.errorMessage,f=e.isLoading,g=e.disabled;return r.a.createElement("div",{className:"form-group col-sm-12"},r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col-sm-3"},r.a.createElement("label",{htmlFor:t,className:"col-sm-12 ".concat(u)},a)),r.a.createElement("div",{className:"col-sm-8"},r.a.createElement(s.a,{id:t,name:n,value:i,onChange:function(e){m(e||"",n)},options:o,valueKey:l,labelKey:c,placeholder:"",noResultsText:"Geen resultaat gevonden",multi:d,simpleValue:!0,removeSelected:!0,className:v?" has-error":"",isLoading:f,disabled:g})),v&&r.a.createElement("div",{className:"col-sm-offset-3 col-sm-8"},r.a.createElement("span",{className:"has-error-message"}," ",p))))});l.defaultProps={className:"",optionId:"id",optionName:"name",disabled:!1,required:"",error:!1,errorMessage:"",value:"",multi:!0,isLoading:!1},l.propTypes={label:o.a.string.isRequired,className:o.a.string,id:o.a.string,name:o.a.string.isRequired,options:o.a.array.isRequired,optionId:o.a.string,optionName:o.a.string,value:o.a.oneOfType([o.a.string,o.a.number]),onChangeAction:o.a.func,onBlurAction:o.a.func,required:o.a.string,disabled:o.a.bool,error:o.a.bool,errorMessage:o.a.string,multi:o.a.bool,isLoading:o.a.bool},a.a=l},872:function(e,a,t){"use strict";var n=t(12);a.a={fetchFinancialOverviews:function(){return n.a.get("jory/financial-overview",{params:{jory:{fld:["id","description","administrationId","year","definitive","statusId","dateProcessed"],rlt:{administration:{fld:["id","name"]}},sorts:["-year","administrationId"]}}})}}}}]);