text: (window.webpackJsonp=window.webpackJsonp||[]).push([[29],{1479:function(e,t,a){"use strict";a.r(t);var r=a(24),n=a.n(r),o=a(25),c=a.n(o),i=a(26),s=a.n(i),l=a(27),d=a.n(l),u=a(16),m=a.n(u),p=a(0),h=a.n(p),f=a(31),v=a(770),g=a(22),b=a.n(g),E=a(6),P=a.n(E),y=a(4),D=a(701),C=a(101),I=a(812),N=Object(f.b)(null,(function(e){return{deleteOrder:function(t){e(Object(I.c)(t))}}}))((function(e){return h.a.createElement(C.a,{buttonConfirmText:"Verwijder",buttonClassName:"btn-danger",closeModal:e.closeDeleteItemModal,confirmAction:function(){return e.deleteOrder(e.id),void e.closeDeleteItemModal()},title:"Verwijderen"},"Verwijder Order: ",h.a.createElement("strong",null," ",e.subject," "),"?")})),O=a(702);function w(e){var t=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 a,r=m()(e);if(t){var n=m()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return d()(this,a)}}var S=function(e){s()(a,e);var t=w(a);function a(e){var r;return n()(this,a),r=t.call(this,e),P()(b()(r),"toggleDelete",(function(){r.setState({showDelete:!r.state.showDelete})})),P()(b()(r),"preview",(function(){y.f.push("/order/inzien/".concat(r.props.orderDetails.id))})),P()(b()(r),"newInvoice",(function(){r.props.previewCreate([r.props.orderDetails.id]),y.f.push("/financieel/".concat(r.props.orderDetails.administrationId,"/orders/aanmaken"))})),r.state={showDelete:!1,showNewInvoice:!1},r}return c()(a,[{key:"render",value:function(){return h.a.createElement("div",{className:"row"},h.a.createElement("div",{className:"col-md-4"},h.a.createElement("div",{className:"btn-group btn-group-flex margin-small",role:"group"},h.a.createElement(D.a,{iconName:"glyphicon-arrow-left",onClickAction:y.e.goBack}),!this.props.orderDetails.canCreateInvoice&&h.a.createElement(D.a,{iconName:"glyphicon-eye-open",onClickAction:this.preview}),this.props.orderDetails.canCreateInvoice&&h.a.createElement(O.a,{buttonText:"Preview concept nota",onClickAction:this.newInvoice}),h.a.createElement(D.a,{iconName:"glyphicon-trash",onClickAction:this.toggleDelete}))),!this.props.isLoading&&h.a.createElement("div",{className:"col-md-4"},h.a.createElement("h4",{className:"text-center"},"Order: ",this.props.orderDetails.subject," / ",this.props.orderDetails.number)),h.a.createElement("div",{className:"col-md-4"}),this.state.showDelete&&h.a.createElement(N,{closeDeleteItemModal:this.toggleDelete,subject:this.props.orderDetails.subject,id:this.props.orderDetails.id,administrationId:this.props.administrationId}))}}]),a}(p.Component),k=Object(f.b)((function(e){return{orderDetails:e.orderDetails,administrationId:e.orderDetails.administrationId,isLoading:e.loadingData.isLoading}}),(function(e){return{previewCreate:function(t){e(Object(I.e)(t))}}}))(S),T=a(199),F=a(706),R=a.n(F),j=a(703),x=a(699),A=a(700),M=(a(760),a(705)),L=a(103),V=a(708),q=a(716),Y=a(7),B=a.n(Y),z=a(93);function W(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function _(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?W(Object(a),!0).forEach((function(t){P()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):W(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function G(e){var t=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 a,r=m()(e);if(t){var n=m()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return d()(this,a)}}var K=function(e){s()(a,e);var t=G(a);function a(e){var r;n()(this,a),r=t.call(this,e),P()(b()(r),"handleInputChange",(function(e){var t=e.target,a="checkbox"===t.type?t.checked:t.value,n=t.name;r.setState({order:_(_({},r.state.order),{},P()({},n,a))})})),P()(b()(r),"handleInputChangeParticipation",(function(e){var t,a=e.target,n="checkbox"===a.type?a.checked:a.value;t=(t=r.state.participations.filter((function(e){return e.id==n})))[0],r.setState({order:_(_({},r.state.order),{},{participationId:t.id})})})),P()(b()(r),"handleInputChangeDate",(function(e,t){r.setState({order:_(_({},r.state.order),{},P()({},t,e))})})),P()(b()(r),"handleInputChangeInvoiceDate",(function(e,t){r.setState({order:_(_({},r.state.order),{},P()({},t,e))},r.checkContactCollectMandate)})),P()(b()(r),"checkContactCollectMandate",(function(){var e=r.state.order.paymentTypeId,t=r.state.order.dateNextInvoice;t||(t=B()().format("YYYY-MM-DD"));var a=r.props.contactCollectMandateFirstRun,n=r.props.contactCollectMandate,o=1==n;n&&a>t&&(o=!1),o||(e="transfer"),r.setState({collectMandateActive:o,order:_(_({},r.state.order),{},{paymentTypeId:e})})})),P()(b()(r),"handleSubmit",(function(e){e.preventDefault();var t=r.state.order,a={},n=!1;R.a.isEmpty(t.paymentTypeId+"")&&(a.paymentTypeId=!0,n=!0),R.a.isEmpty(t.statusId+"")&&(a.statusId=!0,n=!0),R.a.isEmpty(t.subject+"")&&(a.subject=!0,n=!0),r.setState(_(_({},r.state),{},{errors:a})),n||r.props.updateOrder(t,r.props.switchToView)}));var o=e.orderDetails,c=o.id,i=o.contactId,s=o.statusId,l=o.subject,d=o.participationId,u=o.emailTemplateIdCollection,m=o.emailTemplateIdTransfer,p=o.emailTemplateReminderId,h=o.emailTemplateExhortationId,f=o.paymentTypeId,v=o.collectionFrequencyId,g=o.IBAN,E=o.ibanAttn,y=o.numberOfInvoiceReminders,D=o.poNumber,C=o.invoiceText,I=o.dateRequested,N=o.administrationId,O=o.dateNextInvoice;return r.state={emailTemplates:[],showExtraContactInfo:!1,collectMandateActive:!1,participations:[],order:{id:c,contactId:i||"",statusId:s||"",administrationId:N||"",subject:l||"",participationId:d||"",emailTemplateIdCollection:u||"",emailTemplateIdTransfer:m||"",emailTemplateReminderId:p||"",emailTemplateExhortationId:h||"",paymentTypeId:f||"",collectionFrequencyId:v||"once",IBAN:g||"",ibanAttn:E||"",numberOfInvoiceReminders:y||"",poNumber:D||"",invoiceText:C||"",dateRequested:I||"",dateNextInvoice:O||""},errors:{statusId:!1,subject:!1,IBAN:!1},peekLoading:{emailTemplates:!0}},r.handleReactSelectChange=r.handleReactSelectChange.bind(b()(r)),r}return c()(a,[{key:"componentDidMount",value:function(){var e=this;this.state.order.contactId&&z.a.fetchContactInfoForOrder(this.state.order.contactId).then((function(t){e.setState({participations:t.data.participations})})),L.a.fetchEmailTemplatesPeek().then((function(t){e.setState({emailTemplates:t,peekLoading:_(_({},e.state.peekLoading),{},{emailTemplates:!1})},e.checkContactCollectMandate)}))}},{key:"handleReactSelectChange",value:function(e,t){this.setState({order:_(_({},this.state.order),{},P()({},t,e))})}},{key:"render",value:function(){var e=this.state.order,t=e.statusId,a=e.subject,r=e.participationId,n=e.emailTemplateIdCollection,o=e.emailTemplateIdTransfer,c=e.emailTemplateReminderId,i=e.emailTemplateExhortationId,s=e.paymentTypeId,l=e.collectionFrequencyId,d=(e.IBAN,e.ibanAttn,e.numberOfInvoiceReminders),u=e.poNumber,m=e.invoiceText,p=e.dateRequested,f=e.administrationId,v=e.dateNextInvoice,g=this.props.orderDetails.invoiceCount;return h.a.createElement("form",{className:"form-horizontal",onSubmit:this.handleSubmit},h.a.createElement(x.a,null,h.a.createElement(A.a,null,h.a.createElement("div",{className:"row"},h.a.createElement(j.a,{label:"Order op naam van",value:this.props.orderDetails.contact?this.props.orderDetails.contact.fullName:"",name:"contact",readOnly:!0}),g>0?h.a.createElement(j.a,{label:"Administratie",value:this.props.orderDetails.administration?this.props.orderDetails.administration.name:"",name:"administration",readOnly:!0}):h.a.createElement(M.a,{label:"Administratie",name:"administrationId",options:this.props.administrations,value:f,onChangeAction:this.handleInputChange})),h.a.createElement("div",{className:"row"},h.a.createElement(j.a,{label:"Contact persoon",value:this.props.contactPerson,name:"contactPerson",readOnly:!0}),h.a.createElement(j.a,{label:"Nota wordt gemaild naar",value:this.props.contactEmail,name:"contactEmail",readOnly:!0})),h.a.createElement("div",{className:"row"},h.a.createElement(M.a,{label:"Deelname",id:"ParticipationId",name:"ParticipationId",options:this.state.participations,value:r,onChangeAction:this.handleInputChangeParticipation,optionValue:"id",optionName:"project_name"}),h.a.createElement(j.a,{label:"Betreft",name:"subject",value:a,onChangeAction:this.handleInputChange,required:"required",error:this.state.errors.subject})),h.a.createElement("div",{className:"row"},h.a.createElement(q.a,{label:"E-mail template nota incasso",name:"emailTemplateIdCollection",options:this.state.emailTemplates,value:n,onChangeAction:this.handleReactSelectChange,isLoading:this.state.peekLoading.emailTemplates,multi:!1}),h.a.createElement(M.a,{label:"Betaalwijze",id:"paymentTypeId",name:"paymentTypeId",options:this.state.collectMandateActive?this.props.orderPaymentTypes:this.props.orderPaymentTypes.filter((function(e){return"transfer"===e.id})),emptyOption:!1,value:s,onChangeAction:this.handleInputChange,required:"required",error:this.state.errors.paymentTypeId})),h.a.createElement("div",{className:"row"},h.a.createElement(q.a,{label:"E-mail template nota overboeken",name:"emailTemplateIdTransfer",options:this.state.emailTemplates,value:o,onChangeAction:this.handleReactSelectChange,isLoading:this.state.peekLoading.emailTemplates,multi:!1}),h.a.createElement(M.a,{label:"Nota frequentie",id:"collectionFrequencyId",name:"collectionFrequencyId",options:this.props.orderCollectionFrequencies,value:l,onChangeAction:this.handleInputChange,emptyOption:!1})),h.a.createElement("div",{className:"row"},h.a.createElement(q.a,{label:"E-mail template herinnering",name:"emailTemplateReminderId",options:this.state.emailTemplates,value:c,onChangeAction:this.handleReactSelectChange,isLoading:this.state.peekLoading.emailTemplates,multi:!1}),h.a.createElement(M.a,{label:"Status",id:"statusId",name:"statusId",options:this.props.orderStatuses,value:t,onChangeAction:this.handleInputChange,required:"required",error:this.state.errors.statusId})),h.a.createElement("div",{className:"row"},h.a.createElement(q.a,{label:"E-mail template aanmaning",name:"emailTemplateExhortationId",options:this.state.emailTemplates,value:i,onChangeAction:this.handleReactSelectChange,isLoading:this.state.peekLoading.emailTemplates,multi:!1}),h.a.createElement(M.a,{label:"Aantal keer herinneringen nota",id:"numberOfInvoiceReminders",size:"col-sm-6",name:"numberOfInvoiceReminders",options:[{id:"1",name:"1x"},{id:"2",name:"2x"},{id:"3",name:"3x"}],value:d,onChangeAction:this.handleInputChange})),h.a.createElement("div",{className:"row"},h.a.createElement("div",{className:"col-sm-6"}),h.a.createElement(j.a,{label:"Opdracht nummer klant",name:"poNumber",value:u,onChangeAction:this.handleInputChange})),h.a.createElement("div",{className:"row"},h.a.createElement("div",{className:"form-group col-sm-12"},h.a.createElement("div",{className:"row"},h.a.createElement("div",{className:"col-sm-3"},h.a.createElement("label",{htmlFor:"invoiceText",className:"col-sm-12"},"Opmerking")),h.a.createElement("div",{className:"col-sm-8"},h.a.createElement("textarea",{name:"invoiceText",value:m,onChange:this.handleInputChange,className:"form-control input-sm",maxLength:"1000"}))))),h.a.createElement("div",{className:"row"},h.a.createElement(V.a,{label:"Aanvraag datum",name:"dateRequested",value:p,onChangeAction:this.handleInputChangeDate}),h.a.createElement(V.a,{label:"Volgende nota datum",value:v,name:"dateNextInvoice",onChangeAction:this.handleInputChangeInvoiceDate})),h.a.createElement("div",{className:"row"},h.a.createElement(j.a,{label:"Totaal bedrag incl. BTW",value:"€"+this.props.orderDetails.totalInclVatInclReductionPerYear.toLocaleString("nl",{minimumFractionDigits:2,maximumFractionDigits:2}),name:"totalInclVatInclReduction",readOnly:!0}))),h.a.createElement(A.a,null,h.a.createElement("div",{className:"pull-right btn-group",role:"group"},h.a.createElement(O.a,{buttonClassName:"btn-default",buttonText:"Sluiten",onClickAction:this.props.switchToView}),h.a.createElement(O.a,{buttonText:"Opslaan",onClickAction:this.handleSubmit,type:"submit",value:"Submit"})))))}}]),a}(p.Component),X=Object(f.b)((function(e){return{orderStatuses:e.systemData.orderStatuses,orderPaymentTypes:e.systemData.orderPaymentTypes,orderCollectionFrequencies:e.systemData.orderCollectionFrequencies,orderDetails:e.orderDetails,administrations:e.meDetails.administrations}}),(function(e){return{updateOrder:function(t,a){e(Object(v.b)(t,a))}}}))(K),H=a(704),U=Object(f.b)((function(e){return{orderDetails:e.orderDetails}}))((function(e){var t=e.orderDetails,a=t.contact,r=t.project,n=t.administration,o=t.status,c=t.subject,i=t.emailTemplateCollection,s=t.emailTemplateTransfer,l=t.emailTemplateReminder,d=t.emailTemplateExhortation,u=t.paymentType,m=t.collectionFrequency,p=(t.IBAN,t.ibanAttn,t.numberOfInvoiceReminders),f=t.poNumber,v=t.invoiceText,g=t.dateRequested,b=t.totalInclVatInclReductionPerYear,E=t.dateNextInvoice;return h.a.createElement("div",{onClick:e.switchToEdit},h.a.createElement(x.a,null,h.a.createElement(A.a,null,h.a.createElement("div",{className:"row"},h.a.createElement(H.a,{label:"Order op naam van",value:a?a.fullName:"",link:a?"contact/"+a.id:""}),h.a.createElement(H.a,{label:"Administratie",value:n.name,link:n?"administratie/"+n.id:""})),h.a.createElement("div",{className:"row"},h.a.createElement(H.a,{label:"Contact persoon",value:e.contactPerson}),h.a.createElement(H.a,{label:"Nota wordt gemaild naar",value:e.contactEmail})),h.a.createElement("div",{className:"row"},h.a.createElement(H.a,{label:"Deelname",value:r?r.name:""}),h.a.createElement(H.a,{label:"Betreft",value:c||""})),h.a.createElement("div",{className:"row"},h.a.createElement(H.a,{label:"E-mail template nota incasso",value:i?i.name:""}),h.a.createElement(H.a,{label:"Betaalwijze",value:u?u.name:""})),h.a.createElement("div",{className:"row"},h.a.createElement(H.a,{label:"E-mail template nota overboeken",value:s?s.name:""}),h.a.createElement(H.a,{label:"Nota frequentie",value:m?m.name:""})),h.a.createElement("div",{className:"row"},h.a.createElement(H.a,{label:"E-mail template herinnering",value:l?l.name:""}),h.a.createElement(H.a,{label:"Status",value:o?o.name:""})),h.a.createElement("div",{className:"row"},h.a.createElement(H.a,{label:"E-mail template aanmaning",value:d?d.name:""}),h.a.createElement(H.a,{label:"Aantal keer herinneringen nota",value:1===p?"1x":2===p?"2x":3===p?"3x":""})),h.a.createElement("div",{className:"row"},h.a.createElement("div",{className:"col-sm-6"}),h.a.createElement(H.a,{label:"Opdracht nummer klant",value:f})),h.a.createElement("div",{className:"row"},h.a.createElement("div",{className:"col-sm-3"},h.a.createElement("label",{htmlFor:"invoiceText",className:"col-sm-12"},"Opmerking")),h.a.createElement("div",{className:"col-sm-9",id:"invoiceText"},v)),h.a.createElement("div",{className:"row"},h.a.createElement(H.a,{label:"Aanvraag datum",value:g?B()(g).format("DD-MM-Y"):""}),h.a.createElement(H.a,{label:"Volgende nota datum",value:E?B()(E).format("DD-MM-Y"):""})),h.a.createElement("div",{className:"row"},h.a.createElement(H.a,{label:"Totaal bedrag incl. BTW",value:"€"+b.toLocaleString("nl",{minimumFractionDigits:2,maximumFractionDigits:2})})))))})),Q=a(203);function J(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function Z(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?J(Object(a),!0).forEach((function(t){P()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):J(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function $(e){var t=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 a,r=m()(e);if(t){var n=m()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return d()(this,a)}}var ee=function(e){s()(a,e);var t=$(a);function a(e){var r;return n()(this,a),r=t.call(this,e),P()(b()(r),"switchToEdit",(function(){r.props.orderDetails.canEdit?r.setState({showEdit:!0}):r.props.setError(405,"Een order met daar aan gekoppeld een nota met de status “Te verzenden” kan niet worden aangepast(de order zit in de map “Order – Te verzenden”). Wil je deze order toch aanpassen? Verwijder dan eerst de “Te verzenden” nota. Dan kom deze order weer in de “Order – te factureren”.  Pas de order aan en maak vervolgens opnieuw de nota.")})),P()(b()(r),"switchToView",(function(){r.setState({showEdit:!1,activeDiv:""})})),r.state={contactPerson:"",contactEmail:"",contactCollectMandate:!1,contactCollectMandateFirstRun:"0000-00-00",showEdit:!1,activeDiv:""},r}return c()(a,[{key:"componentDidMount",value:function(){var e=this;this.props.orderDetails.contactId&&z.a.fetchContactInfoForOrder(this.props.orderDetails.contactId).then((function(t){e.setState(Z(Z({},e.state),{},{contactPerson:t.data.contactPerson,contactEmail:t.data.email,contactCollectMandate:t.data.collectMandate,contactCollectMandateFirstRun:t.data.collectMandateFirstRun}))}))}},{key:"componentDidUpdate",value:function(e){var t=this;this.props.orderDetails.id!==e.orderDetails.id&&this.props.orderDetails.contactId&&z.a.fetchContactInfoForOrder(nextProps.orderDetails.contactId).then((function(e){t.setState(Z(Z({},t.state),{},{contactPerson:e.data.contactPerson,contactEmail:e.data.email,contactCollectMandate:e.data.collectMandate,contactCollectMandateFirstRun:e.data.collectMandateFirstRun}))}))}},{key:"onDivEnter",value:function(){this.setState({activeDiv:"panel-grey"})}},{key:"onDivLeave",value:function(){this.state.showEdit||this.setState({activeDiv:""})}},{key:"render",value:function(){var e=this,t=this.props.meDetails.permissions,a=void 0===t?{}:t;return h.a.createElement("div",{className:this.state.activeDiv,onMouseEnter:function(){return e.onDivEnter()},onMouseLeave:function(){return e.onDivLeave()}},this.state.showEdit&&this.props.orderDetails.canEdit&&a.manageFinancial?h.a.createElement(X,{switchToView:this.switchToView,contactPerson:this.state.contactPerson,contactEmail:this.state.contactEmail,contactCollectMandate:this.state.contactCollectMandate,contactCollectMandateFirstRun:this.state.contactCollectMandateFirstRun}):h.a.createElement(U,{switchToEdit:this.switchToEdit,contactPerson:this.state.contactPerson,contactEmail:this.state.contactEmail}))}}]),a}(p.Component),te=Object(f.b)((function(e){return{orderDetails:e.orderDetails,meDetails:e.meDetails}}),(function(e){return{setError:function(t,a){e(Object(Q.b)(t,a))}}}))(ee);B.a.locale("nl");var ae=Object(f.b)((function(e){return{orderDetails:e.orderDetails}}))((function(e){var t=e.orderDetails,a=t.createdAt,r=t.createdBy;return h.a.createElement("div",null,h.a.createElement("div",{className:"row"},h.a.createElement(H.a,{label:"Gemaakt door",value:r?r.fullName:"Onbekend",link:r?"gebruiker/"+r.id:""}),h.a.createElement(H.a,{label:"Gemaakt op",value:a?B()(a).format("L"):"Onbekend"})))})),re=a(707),ne=function(e){return h.a.createElement(x.a,null,h.a.createElement(re.a,null,h.a.createElement("span",{className:"h5 text-bold"},"Afsluiting gegevens")),h.a.createElement(A.a,null,h.a.createElement("div",{className:"col-md-12"},h.a.createElement(ae,null))))};B.a.locale("nl");var oe=Object(f.b)((function(e){return{permissions:e.meDetails.permissions,orderDetails:e.orderDetails}}))((function(e){var t=e.orderProduct,a=t.product,r=t.amount,n=t.amountInclReductionInclVat,o=t.dateStart,c=t.dateEnd,i=t.amountInclReductionInclVatPerYear,s=t.isOneTimeAndPaidProduct,l=t.period,d=B()(B()().format("YYYY-MM-DD")).isAfter(B()(c).format("YYYY-MM-DD")),u=s?"paid-order-product-row":"",m=d?"not-active-anymore-row":"",p=d?"not-active-anymore-text":"";return h.a.createElement("div",{className:"row border ".concat(e.highlightLine," ").concat(u," ").concat(m),onMouseEnter:function(){return e.onLineEnter()},onMouseLeave:function(){return e.onLineLeave()}},h.a.createElement("div",{onClick:e.openEdit},h.a.createElement("div",{className:"col-sm-1"},a&&a.code),h.a.createElement("div",{className:"col-sm-2"},a?a.invoiceText:""),h.a.createElement("div",{className:"col-sm-1"},r||""),h.a.createElement("div",{className:"col-sm-2"},n?"€"+n.toLocaleString("nl",{minimumFractionDigits:2,maximumFractionDigits:2}):"€0,00"),h.a.createElement("div",{className:"col-sm-2"},a.invoiceFrequency?a.invoiceFrequency.name:""),h.a.createElement("div",{className:"col-sm-1"},i?"€"+i.toLocaleString("nl",{minimumFractionDigits:2,maximumFractionDigits:2}):"€0,00"),h.a.createElement("div",{className:"col-sm-1"},o?B()(o).format("L"):""),h.a.createElement("div",{className:"col-sm-1 ".concat(p)},c?B()(c).format("L"):"")),h.a.createElement("div",{className:"col-sm-1"},e.showActionButtons&&e.permissions.manageFinancial?h.a.createElement("a",{role:"button",onClick:e.openEdit},h.a.createElement("span",{className:"glyphicon glyphicon-pencil mybtn-success"})," "):"",e.showActionButtons&&e.permissions.manageFinancial?h.a.createElement("a",{role:"button",onClick:e.toggleDelete},h.a.createElement("span",{className:"glyphicon glyphicon-trash mybtn-danger"})," "):""),l&&h.a.createElement("div",{className:"col-sm-12"},"Periode ",l))}));B.a.locale("nl");var ce=Object(f.b)((function(e){return{costCenters:e.systemData.costCenters}}))((function(e){var t=e.orderProduct,a=t.product,r=t.costCenterId,n=t.amount,o=t.amountReduction,c=t.percentageReduction,i=t.dateStart,s=t.dateEnd,l=t.dateLastInvoice,d=t.datePeriodStartFirstInvoice,u=t.variablePrice;return h.a.createElement("div",null,h.a.createElement("form",{className:"form-horizontal",onSubmit:e.handleSubmit},h.a.createElement(x.a,{className:"panel-grey"},h.a.createElement(A.a,null,h.a.createElement("div",{className:"row"},h.a.createElement(j.a,{label:"Ordernummer",name:"order",value:e.orderDetails?e.orderDetails.number:"",readOnly:!0}),h.a.createElement(j.a,{label:"Product",name:"product",value:a?a.name:"",readOnly:!0})),h.a.createElement("div",{className:"row"},h.a.createElement(M.a,{label:"Kostenplaats",id:"costCenterId",name:"costCenterId",options:e.costCenters,optionName:"description",value:r,onChangeAction:e.handleInputChange})),h.a.createElement("div",{className:"row"},h.a.createElement(j.a,{label:"Omschrijving",id:"description",name:"description",value:a.invoiceText,readOnly:!0}),h.a.createElement(j.a,{label:"Aantal",type:"number",id:"amount",name:"amount",value:n,onChangeAction:e.handleInputChange,required:"required",error:e.errors.amount})),h.a.createElement("div",{className:"row"},h.a.createElement(j.a,{label:"Kortingspercentage",type:"number",id:"percentageReduction",name:"percentageReduction",value:c,onChangeAction:e.handleInputChange}),null!==u?h.a.createElement(j.a,{label:"Prijs excl. BTW",name:"variablePrice",type:"number",value:u,onChangeAction:e.handleInputChangeVariablePrice,error:e.errors.variablePrice,required:null!==u&&"required"}):h.a.createElement(j.a,{label:e.orderProduct.product.currentPrice.inputInclVat?"Prijs incl. BTW":"Prijs excl. BTW",name:"price",value:e.orderProduct.product.currentPrice.inputInclVat?"€"+e.orderProduct.product.currentPrice.priceInclVat.toLocaleString("nl",{minimumFractionDigits:2,maximumFractionDigits:e.orderProduct.product.currentPrice.priceNumberOfDecimals}):"€"+e.orderProduct.product.currentPrice.price.toLocaleString("nl",{minimumFractionDigits:2,maximumFractionDigits:e.orderProduct.product.currentPrice.priceNumberOfDecimals}),readOnly:!0})),h.a.createElement("div",{className:"row"},h.a.createElement(j.a,{label:"Kortingsbedrag",type:"number",id:"amountReduction",name:"amountReduction",value:o,onChangeAction:e.handleInputChange}),h.a.createElement(j.a,{label:"Totaalbedrag incl. BTW",name:"totalPrice",value:"€"+e.totalPrice.toLocaleString("nl",{minimumFractionDigits:2,maximumFractionDigits:2}),readOnly:!0})),h.a.createElement("div",{className:"row"},h.a.createElement(V.a,{label:"Begin datum",name:"dateStart",value:i,onChangeAction:e.handleInputChangeStartDate,required:"required",error:e.errors.dateStart}),h.a.createElement(V.a,{label:"Eind datum",name:"dateEnd",readOnly:"none"===a.durationId,value:s,onChangeAction:e.handleInputChangeDate,error:e.errors.dateEnd})),!l&&"none"!==a.durationId&&h.a.createElement("div",{className:"row"},h.a.createElement(V.a,{label:"1ste notaperiode start op",name:"datePeriodStartFirstInvoice",value:d,onChangeAction:e.handleInputChangeDate})),h.a.createElement("div",{className:"pull-right btn-group",role:"group"},h.a.createElement(O.a,{buttonClassName:"btn-default",buttonText:"Annuleren",onClickAction:e.cancelEdit}),h.a.createElement(O.a,{buttonText:"Opslaan",onClickAction:e.handleSubmit,type:"submit",value:"Submit"}))))))})),ie=Object(f.b)(null,(function(e){return{fetchOrderDetails:function(t){e(Object(v.a)(t))}}}))((function(e){return h.a.createElement(C.a,{buttonConfirmText:"Verwijder",buttonClassName:"btn-danger",closeModal:e.closeDeleteItemModal,confirmAction:function(){z.a.deleteOrderProduct(e.id).then((function(t){e.fetchOrderDetails(e.orderId),e.closeDeleteItemModal()}))},title:"Verwijderen"},h.a.createElement("p",null,"Verwijder orderregel?"))}));function se(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function le(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?se(Object(a),!0).forEach((function(t){P()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):se(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function de(e){var t=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 a,r=m()(e);if(t){var n=m()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return d()(this,a)}}var ue=function(e){s()(a,e);var t=de(a);function a(e){var r;return n()(this,a),r=t.call(this,e),P()(b()(r),"handleInputChange",(function(e){var t=e.target,a="checkbox"===t.type?t.checked:t.value,n=t.name;r.setState(le(le({},r.state),{},{orderProduct:le(le({},r.state.orderProduct),{},P()({},n,a))}),r.updateOrderPrice)})),P()(b()(r),"handleLedgerChange",(function(e){r.setState(le(le({},r.state),{},{product:le(le({},r.state.product),{},{ledgerId:e})}),r.updateOrderPrice)})),P()(b()(r),"handleCostCenterChange",(function(e){var t=e.target,a="checkbox"===t.type?t.checked:t.value,n=t.name;r.setState(le(le({},r.state),{},{product:le(le({},r.state.product),{},P()({},n,a))}))})),P()(b()(r),"handleInputChangeProduct",(function(e){var t=e.target,a="checkbox"===t.type?t.checked:t.value,n=t.name;r.setState(le(le({},r.state),{},{product:le(le({},r.state.product),{},P()({},n,a))}))})),P()(b()(r),"updateOrderPrice",(function(){var e=!!r.state.product.currentPrice.inputInclVat&&r.state.product.currentPrice.inputInclVat,t=0;t=e?R.a.isFloat(r.state.product.currentPrice.priceInclVat+"")?r.state.product.currentPrice.priceInclVat:0:R.a.isFloat(r.state.product.currentPrice.price+"")?r.state.product.currentPrice.price:0;var a=R.a.isFloat(r.state.orderProduct.amount+"")?r.state.orderProduct.amount:0,n=R.a.isFloat(r.state.orderProduct.percentageReduction+"")?r.state.orderProduct.percentageReduction:0,o=R.a.isFloat(r.state.orderProduct.amountReduction+"")?r.state.orderProduct.amountReduction:0,c=0;t<0?c=t*a*((parseFloat(100)+parseFloat(n))/100)-o:c=t*a*((100-n)/100)-o;if(!e){var i=R.a.isFloat(r.state.product.currentPrice.vatPercentage+"")?r.state.product.currentPrice.vatPercentage:0;c*=(parseFloat(100)+parseFloat(i))/100}r.setState(le(le({},r.state),{},{totalPrice:parseFloat(c).toFixed(2)}))})),P()(b()(r),"handleSubmit",(function(e){e.preventDefault();var t=r.state.orderProduct,a={},n=!1;R.a.isEmpty(t.amount+"")&&(a.amount=!0,n=!0);var o=r.state.product;R.a.isEmpty(o.description)&&(a.description=!0,n=!0),r.props.usesTwinfield&&R.a.isEmpty(String(o.ledgerId))&&(a.ledgerId=!0,n=!0),r.setState(le(le({},r.state),{},{errors:a,errorMessage:!1})),!n&&z.a.updateOrderProductOneTime(t,o).then((function(e){r.props.fetchOrderDetails(r.props.orderProduct.orderId),r.props.cancelEdit()}))})),r.state={errorMessage:!1,orderPrice:e.product.currentPrice.inputInclVat?e.product.currentPrice.priceInclVat:e.product.currentPrice.price,totalPrice:"",orderProduct:{id:e.orderProduct.id,amount:e.orderProduct.amount,amountReduction:e.orderProduct.amountReduction,percentageReduction:e.orderProduct.percentageReduction,dateStart:e.orderProduct.dateStart,dateEnd:e.orderProduct.dateEnd,datePeriodStartFirstInvoice:e.orderProduct.datePeriodStartFirstInvoice},product:{id:e.product.id,description:e.product.invoiceText,ledgerId:e.product.ledgerId?e.product.ledgerId:"",costCenterId:e.product.costCenterId?e.product.costCenterId:"",currentPrice:e.product.currentPrice?e.product.currentPrice:""},errors:{amount:!1,ledgerId:!1,description:!1}},r}return c()(a,[{key:"componentDidMount",value:function(){this.updateOrderPrice()}},{key:"render",value:function(){var e=this,t=this.state.orderProduct,a=t.amount,r=t.amountReduction,n=t.percentageReduction,o=this.state.product,c=o.description,i=o.costCenterId,s=o.ledgerId,l=this.props.ledgers.filter((function(t){return t.vatCode?t.vatCode.percentage===e.state.product.currentPrice.vatPercentage:t.vatCode===e.state.product.currentPrice.vatPercentage}));return h.a.createElement("form",{className:"form-horizontal",onSubmit:this.handleSubmit},h.a.createElement(x.a,{className:"panel-grey"},h.a.createElement(A.a,null,h.a.createElement("div",{className:"row"},h.a.createElement("div",{className:"panel-heading"},h.a.createElement("span",{className:"h5 text-bold"},"Product"))),this.props.usesTwinfield?h.a.createElement("div",{className:"row"},h.a.createElement(q.a,{label:"Grootboek",name:"ledgerId",id:"ledgerId",options:l,optionName:"description",value:s,onChangeAction:this.handleLedgerChange,multi:!1,required:"required",error:this.state.errors.ledgerId}),h.a.createElement(M.a,{label:"Kostenplaats",id:"costCenterId",name:"costCenterId",options:this.props.costCenters,optionName:"description",value:i,onChangeAction:this.handleCostCenterChange})):null,h.a.createElement("div",{className:"row"},h.a.createElement("div",{className:"panel-part panel-heading"},h.a.createElement("span",{className:"h5 text-bold"},"Orderregel"))),h.a.createElement("div",{className:"row"},h.a.createElement(j.a,{label:"Omschrijving",id:"description",name:"description",value:c,onChangeAction:this.handleInputChangeProduct,required:"required",error:this.state.errors.description}),h.a.createElement(j.a,{label:"Aantal",type:"number",id:"amount",name:"amount",value:a,onChangeAction:this.handleInputChange,required:"required",error:this.state.errors.amount})),h.a.createElement("div",{className:"row"},h.a.createElement(j.a,{label:"Kortingspercentage",type:"number",id:"percentageReduction",name:"percentageReduction",value:n,onChangeAction:this.handleInputChange}),h.a.createElement(j.a,{label:this.state.product.currentPrice.inputInclVat?"Prijs incl. BTW":"Prijs excl. BTW",name:"orderPrice",value:"€"+this.state.orderPrice.toLocaleString("nl",{minimumFractionDigits:2,maximumFractionDigits:this.state.product.currentPrice.priceNumberOfDecimals}),readOnly:!0})),h.a.createElement("div",{className:"row"},h.a.createElement(j.a,{label:"Kortingsbedrag",type:"number",id:"amountReduction",name:"amountReduction",value:r,onChangeAction:this.handleInputChange}),h.a.createElement(j.a,{label:"Totaalbedrag incl. BTW",name:"totalPrice",value:"€"+this.state.totalPrice.toLocaleString("nl",{minimumFractionDigits:2,maximumFractionDigits:2}),readOnly:!0})),this.state.errorMessage&&h.a.createElement("div",{className:"col-sm-10 col-md-offset-1 alert alert-danger"},this.state.errorMessage),h.a.createElement("div",{className:"pull-right btn-group",role:"group"},h.a.createElement(O.a,{buttonClassName:"btn-default",buttonText:"Annuleren",onClickAction:this.props.cancelEdit}),h.a.createElement(O.a,{buttonText:"Opslaan",onClickAction:this.handleSubmit,type:"submit",value:"Submit"})))))}}]),a}(p.Component),me=Object(f.b)((function(e){return{orderDetails:e.orderDetails,costCenters:e.systemData.costCenters,ledgers:e.systemData.ledgers,usesTwinfield:e.systemData.usesTwinfield}}),(function(e){return{fetchOrderDetails:function(t){e(Object(v.a)(t))}}}))(ue);function pe(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function he(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?pe(Object(a),!0).forEach((function(t){P()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):pe(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function fe(e){var t=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 a,r=m()(e);if(t){var n=m()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return d()(this,a)}}var ve=function(e){s()(a,e);var t=fe(a);function a(e){var r;return n()(this,a),r=t.call(this,e),P()(b()(r),"toggleDelete",(function(){r.props.orderDetails.canEdit?r.setState({showDelete:!r.state.showDelete}):r.props.setError(405,"Een order met daar aan gekoppeld een nota met de status “Te verzenden” kan niet worden aangepast(de order zit in de map “Order – Te verzenden”). Wil je deze order toch aanpassen? Verwijder dan eerst de “Te verzenden” nota. Dan kom deze order weer in de “Order – te factureren”.  Pas de order aan en maak vervolgens opnieuw de nota.")})),P()(b()(r),"onLineEnter",(function(){r.setState({showActionButtons:!0,highlightLine:"highlight-line"})})),P()(b()(r),"onLineLeave",(function(){r.setState({showActionButtons:!1,highlightLine:""})})),P()(b()(r),"openEdit",(function(){r.props.orderDetails.canEdit?r.setState({showEdit:!0}):r.props.setError(405,"Een order met daar aan gekoppeld een nota met de status “Te verzenden” kan niet worden aangepast(de order zit in de map “Order – Te verzenden”). Wil je deze order toch aanpassen? Verwijder dan eerst de “Te verzenden” nota. Dan kom deze order weer in de “Order – te factureren”.  Pas de order aan en maak vervolgens opnieuw de nota.")})),P()(b()(r),"closeEdit",(function(){r.setState({showEdit:!1})})),P()(b()(r),"cancelEdit",(function(){r.setState(he(he({},r.state),{},{orderProduct:he({},r.props.orderProduct)})),r.closeEdit()})),P()(b()(r),"handleInputChange",(function(e){var t=e.target,a="checkbox"===t.type?t.checked:t.value,n=t.name;r.setState(he(he({},r.state),{},{orderProduct:he(he({},r.state.orderProduct),{},P()({},n,a))}),r.updatePrice)})),P()(b()(r),"updatePrice",(function(){var e=!1,t=0;r.state.orderProduct.product.currentPrice&&(e=r.state.orderProduct.product.currentPrice.inputInclVat,t=R.a.isFloat(r.state.orderProduct.product.currentPrice.vatPercentage+"")?r.state.orderProduct.product.currentPrice.vatPercentage:0);var a=(parseFloat(100)+parseFloat(t))/100,n=0,o=0,c=R.a.isFloat(r.state.orderProduct.variablePrice+"")?r.state.orderProduct.variablePrice:0;c?e?(n=c,o=c/a):(n=c*a,o=c):r.state.orderProduct.product.currentPrice&&(n=R.a.isFloat(r.state.orderProduct.product.currentPrice.priceInclVat+"")?r.state.orderProduct.product.currentPrice.priceInclVat:0,o=R.a.isFloat(r.state.orderProduct.product.currentPrice.price+"")?r.state.orderProduct.product.currentPrice.price:0);var i=R.a.isFloat(r.state.orderProduct.amount+"")?r.state.orderProduct.amount:0,s=parseFloat(n*i).toFixed(2),l=parseFloat(o*i).toFixed(2),d=R.a.isFloat(r.state.orderProduct.amountReduction+"")?r.state.orderProduct.amountReduction:0;e||(d*=a),d=parseFloat(d).toFixed(2);var u=(R.a.isFloat(r.state.orderProduct.percentageReduction+"")?r.state.orderProduct.percentageReduction:0)/100,m=0;e?m=s*u:(m=l*u,m*=a);var p=s-d-(m=parseFloat(m).toFixed(2));r.setState(he(he({},r.state),{},{totalPrice:p}))})),P()(b()(r),"handleSubmit",(function(e){e.preventDefault();var t={},a=!1,n=r.state.orderProduct;R.a.isEmpty(n.amount+"")&&(t.amount=!0,a=!0),R.a.isEmpty(n.dateStart+"")&&(t.dateStart=!0,a=!0),!R.a.isEmpty(n.dateStart+"")&&B()(n.dateEnd).isSameOrBefore(B()(n.dateStart))&&(t.dateEnd=!0,a=!0),!R.a.isEmpty(n.dateEnd+"")&&B()(n.dateStart).isSameOrAfter(B()(n.dateEnd))&&(t.dateStart=!0,a=!0),null!==r.props.orderProduct.variablePrice&&(R.a.isEmpty(n.variablePrice+"")||null===n.variablePrice)&&(t.variablePrice=!0,a=!0),r.setState(he(he({},r.state),{},{errors:t})),!a&&z.a.updateOrderProduct(n).then((function(e){r.props.fetchOrderDetails(r.state.orderProduct.orderId),r.closeEdit()}))})),P()(b()(r),"handleInputChangeVariablePrice",(function(e){var t=e.target,a="checkbox"===t.type?t.checked:t.value,n=t.name;r.setState(he(he({},r.state),{},{price:a,orderProduct:he(he({},r.state.orderProduct),{},P()({},n,a))}),r.updatePrice)})),r.state={showActionButtons:!1,highlightLine:"",showEdit:!1,showDelete:!1,totalPrice:e.orderProduct.amountInclReductionInclVat,orderProduct:he({},e.orderProduct),errors:{amount:!1,dateStart:!1,dateEnd:!1,variablePrice:!1}},r.handleInputChangeDate=r.handleInputChangeDate.bind(b()(r)),r.handleInputChangeStartDate=r.handleInputChangeStartDate.bind(b()(r)),r}return c()(a,[{key:"componentWillReceiveProps",value:function(e){Object(T.isEqual)(this.state.orderProduct,e.orderProduct)||this.setState(he(he({},this.state),{},{orderProduct:he({},e.orderProduct)}))}},{key:"handleInputChangeDate",value:function(e,t){this.setState(he(he({},this.state),{},{orderProduct:he(he({},this.state.orderProduct),{},P()({},t,e))}))}},{key:"handleInputChangeStartDate",value:function(e,t){var a,r="";if(e)switch(this.state.orderProduct.product.durationId){case"none":r="";break;case"month":r=B()(e).add(1,"M").format("YYYY-MM-DD");break;case"quarter":r=B()(e).add(1,"Q").format("YYYY-MM-DD");break;case"half_year":r=B()(e).add(6,"M").format("YYYY-MM-DD");break;case"year":r=B()(e).add(1,"y").format("YYYY-MM-DD");break;case"until_cancellation":r="";break;default:r=""}this.setState(he(he({},this.state),{},{orderProduct:he(he({},this.state.orderProduct),{},(a={},P()(a,t,e),P()(a,"dateEnd",r),a))}))}},{key:"render",value:function(){return h.a.createElement("div",null,h.a.createElement(oe,{highlightLine:this.state.highlightLine,showActionButtons:this.state.showActionButtons,onLineEnter:this.onLineEnter,onLineLeave:this.onLineLeave,openEdit:this.openEdit,toggleDelete:this.toggleDelete,orderProduct:this.state.orderProduct}),this.state.showEdit&&this.props.orderDetails.canEdit&&this.props.permissions.manageFinancial&&!this.state.orderProduct.product.isOneTime&&h.a.createElement(ce,{orderDetails:this.props.orderDetails,errors:this.state.errors,totalPrice:this.state.totalPrice,orderProduct:this.state.orderProduct,handleInputChange:this.handleInputChange,handleInputChangeDate:this.handleInputChangeDate,handleInputChangeStartDate:this.handleInputChangeStartDate,handleSubmit:this.handleSubmit,cancelEdit:this.cancelEdit,handleInputChangeVariablePrice:this.handleInputChangeVariablePrice}),this.state.showEdit&&this.props.orderDetails.canEdit&&this.props.permissions.manageFinancial&&1==this.state.orderProduct.product.isOneTime&&h.a.createElement(me,{orderProduct:this.state.orderProduct,product:this.state.orderProduct.product,cancelEdit:this.cancelEdit}),this.state.showDelete&&this.props.orderDetails.canEdit&&this.props.permissions.manageFinancial&&h.a.createElement(ie,{closeDeleteItemModal:this.toggleDelete,id:this.state.orderProduct.id,orderId:this.state.orderProduct.orderId}))}}]),a}(p.Component),ge=Object(f.b)((function(e){return{permissions:e.meDetails.permissions,orderDetails:e.orderDetails}}),(function(e){return{fetchOrderDetails:function(t){e(Object(v.a)(t))},setError:function(t,a){e(Object(Q.b)(t,a))}}}))(ve),be=Object(f.b)((function(e){return{orderProducts:e.orderDetails.orderProducts}}))((function(e){return h.a.createElement("div",null,h.a.createElement("div",{className:"row border header"},h.a.createElement("div",{className:"col-sm-1"},"Productcode"),h.a.createElement("div",{className:"col-sm-2"},"Omschrijving"),h.a.createElement("div",{className:"col-sm-1"},"Aantal"),h.a.createElement("div",{className:"col-sm-2"},"Prijs incl. BTW"),h.a.createElement("div",{className:"col-sm-2"},"Prijs per"),h.a.createElement("div",{className:"col-sm-1"},"Prijs incl. BTW/jaar"),h.a.createElement("div",{className:"col-sm-1"},"Begin datum"),h.a.createElement("div",{className:"col-sm-1"},"Eind datum"),h.a.createElement("div",{className:"col-sm-1"})),e.orderProducts.length>0?e.orderProducts.map((function(e){return h.a.createElement(ge,{key:e.id,orderProduct:e})})):h.a.createElement("div",null,"Geen orderregels bekend."))}));function Ee(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function Pe(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?Ee(Object(a),!0).forEach((function(t){P()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Ee(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function ye(e){var t=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 a,r=m()(e);if(t){var n=m()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return d()(this,a)}}var De=function(e){s()(a,e);var t=ye(a);function a(e){var r;return n()(this,a),r=t.call(this,e),P()(b()(r),"handleInputChange",(function(e){var t=e.target,a="checkbox"===t.type?t.checked:t.value,n=t.name;r.setState(Pe(Pe({},r.state),{},{orderProduct:Pe(Pe({},r.state.orderProduct),{},P()({},n,a))}),r.updatePrice)})),P()(b()(r),"handleInputChangeVariablePrice",(function(e){var t=e.target,a="checkbox"===t.type?t.checked:t.value,n=t.name;r.setState(Pe(Pe({},r.state),{},{price:a,orderProduct:Pe(Pe({},r.state.orderProduct),{},P()({},n,a))}),r.updatePrice)})),P()(b()(r),"handleBlurVariablePrice",(function(e){var t=e.target,a=t.value;t.name;r.setState(Pe(Pe({},r.state),{},{orderProduct:Pe(Pe({},r.state.orderProduct),{},{variablePrice:parseFloat(a).toFixed(r.state.priceNumberOfDecimals)})}))})),P()(b()(r),"updatePrice",(function(){var e,t;e=r.state.productInputInclVat,t=R.a.isFloat(r.state.vatPercentage+"")?r.state.vatPercentage:0;var a=(parseFloat(100)+parseFloat(t))/100,n=0,o=0,c=R.a.isFloat(r.state.orderProduct.variablePrice+"")?r.state.orderProduct.variablePrice:0;c?e?(n=c,o=c/a):(n=c*a,o=c):(n=R.a.isFloat(r.state.priceInclVat+"")?r.state.priceInclVat:0,o=R.a.isFloat(r.state.price+"")?r.state.price:0);var i=R.a.isFloat(r.state.orderProduct.amount+"")?r.state.orderProduct.amount:0,s=parseFloat(n*i).toFixed(2),l=parseFloat(o*i).toFixed(2),d=R.a.isFloat(r.state.orderProduct.amountReduction+"")?r.state.orderProduct.amountReduction:0;e||(d*=a),d=parseFloat(d).toFixed(2);var u=(R.a.isFloat(r.state.orderProduct.percentageReduction+"")?r.state.orderProduct.percentageReduction:0)/100,m=0;e?m=s*u:(m=l*u,m*=a);var p=s-d-(m=parseFloat(m).toFixed(2));r.setState(Pe(Pe({},r.state),{},{totalPrice:p}))})),P()(b()(r),"handleChangeProduct",(function(e){var t=e.target,a="checkbox"===t.type?t.checked:t.value,n=t.name,o=2,c=0,i=0,s=0,l="",d="",u=!1,m="",p="",h=!1;if(a){var f=r.props.products.find((function(e){return e.id==a}));o=f.currentPrice.priceNumberOfDecimals,c=f.currentPrice.price,i=f.currentPrice.priceInclVat,s=f.currentPrice.vatPercentage,h=f.currentPrice.inputInclVat,(l=f.costCenterId)||(l=""),d=f.invoiceText,u=f.durationId,p=f.hasVariablePrice}if(u&&r.state.orderProduct.dateStart)switch(u){case"none":m="";break;case"month":m=B()(r.state.orderProduct.dateStart).add(1,"M").format("YYYY-MM-DD");break;case"quarter":m=B()(r.state.orderProduct.dateStart).add(1,"Q").format("YYYY-MM-DD");break;case"half_year":m=B()(r.state.orderProduct.dateStart).add(6,"M").format("YYYY-MM-DD");break;case"year":m=B()(r.state.orderProduct.dateStart).add(1,"y").format("YYYY-MM-DD");break;case"until_cancellation":m="";break;default:m=""}r.setState(Pe(Pe({},r.state),{},{priceNumberOfDecimals:o,price:c,priceInclVat:i,vatPercentage:s,durationId:u,productHasVariablePrice:"variable"===p,productInputInclVat:h,orderProduct:Pe(Pe({},r.state.orderProduct),{},P()({costCenterId:l,description:d,dateEnd:m},n,a))}),r.updatePrice)})),P()(b()(r),"handleSubmit",(function(e){e.preventDefault();var t=r.state.orderProduct,a={},n=!1;R.a.isEmpty(t.productId+"")&&(a.productId=!0,n=!0),R.a.isEmpty(t.amount+"")&&(a.amount=!0,n=!0),R.a.isEmpty(t.dateStart+"")&&(a.dateStart=!0,n=!0),R.a.isEmpty(t.datePeriodStartFirstInvoice+"")&&(a.datePeriodStartFirstInvoice=!0,n=!0),!R.a.isEmpty(t.dateStart+"")&&B()(t.dateEnd).isSameOrBefore(B()(t.dateStart))&&(a.dateEnd=!0,n=!0),!R.a.isEmpty(t.dateEnd+"")&&B()(t.dateStart).isSameOrAfter(B()(t.dateEnd))&&(a.dateStart=!0,n=!0),r.state.productHasVariablePrice&&(R.a.isEmpty(t.variablePrice+"")||null===t.variablePrice)&&(a.variablePrice=!0,n=!0),r.setState(Pe(Pe({},r.state),{},{errors:a})),!n&&z.a.newOrderProduct(t).then((function(e){r.props.fetchOrderDetails(t.orderId),r.props.toggleShowNew()}))})),r.state={priceNumberOfDecimals:"2",price:"0",priceInclVat:"0",vatPercentage:"0",totalPrice:"0",durationId:"none",productHasVariablePrice:!1,productInputInclVat:!1,orderProduct:{orderId:r.props.orderDetails.id,productId:"",description:"",costCenterId:"",amount:1,amountReduction:0,percentageReduction:0,dateStart:B()().format("YYYY-MM-DD"),dateEnd:"",datePeriodStartFirstInvoice:B()().format("YYYY-MM-DD"),variablePrice:null},errors:{productId:!1,amount:!1,dateStart:!1,dateEnd:!1,datePeriodStartFirstInvoice:!1,variablePrice:!1}},r.handleInputChangeDate=r.handleInputChangeDate.bind(b()(r)),r.handleInputChangeStartDate=r.handleInputChangeStartDate.bind(b()(r)),r}return c()(a,[{key:"handleInputChangeDate",value:function(e,t){this.setState(Pe(Pe({},this.state),{},{orderProduct:Pe(Pe({},this.state.orderProduct),{},P()({},t,e))}))}},{key:"handleInputChangeStartDate",value:function(e,t){var a,r=this,n="";if(this.state.orderProduct.dateStart&&this.state.orderProduct.productId){var o;if(e)o=this.props.products.filter((function(e){return e.id==r.state.orderProduct.productId}))[0].durationId;switch(o){case"none":n="";break;case"month":n=B()(e).add(1,"M").format("YYYY-MM-DD");break;case"quarter":n=B()(e).add(1,"Q").format("YYYY-MM-DD");break;case"half_year":n=B()(e).add(6,"M").format("YYYY-MM-DD");break;case"year":n=B()(e).add(1,"y").format("YYYY-MM-DD");break;case"until_cancellation":n="";break;default:n=""}}this.setState(Pe(Pe({},this.state),{},{orderProduct:Pe(Pe({},this.state.orderProduct),{},(a={},P()(a,t,e),P()(a,"dateEnd",n),a))}))}},{key:"render",value:function(){var e=this.state.orderProduct,t=e.productId,a=e.description,r=e.costCenterId,n=e.amount,o=e.amountReduction,c=e.percentageReduction,i=e.dateStart,s=e.dateEnd,l=e.datePeriodStartFirstInvoice;return h.a.createElement("form",{className:"form-horizontal",onSubmit:this.handleSubmit},h.a.createElement(x.a,{className:"panel-grey"},h.a.createElement(A.a,null,h.a.createElement("div",{className:"row"},h.a.createElement(j.a,{label:"Order nummer",name:"orderId",value:this.props.orderDetails.number,readOnly:!0}),h.a.createElement(M.a,{label:"Product",id:"productId",name:"productId",options:this.props.products.filter((function(e){return e.active})).sort((function(e,t){return e.name.localeCompare(t.name)})),value:t,onChangeAction:this.handleChangeProduct,required:"required",error:this.state.errors.productId})),h.a.createElement("div",{className:"row"},h.a.createElement(M.a,{label:"Kostenplaats",id:"costCenterId",name:"costCenterId",options:this.props.costCenters,optionName:"description",value:r,onChangeAction:this.handleInputChange})),h.a.createElement("div",{className:"row"},h.a.createElement(j.a,{label:"Omschrijving",id:"description",name:"description",value:a,readOnly:!0}),h.a.createElement(j.a,{label:"Aantal",type:"number",id:"amount",name:"amount",value:n,onChangeAction:this.handleInputChange,required:"required",error:this.state.errors.amount})),h.a.createElement("div",{className:"row"},h.a.createElement(j.a,{label:"Kortingspercentage",type:"number",id:"percentageReduction",name:"percentageReduction",value:c,onChangeAction:this.handleInputChange}),this.state.productHasVariablePrice?h.a.createElement(j.a,{label:"Prijs excl. BTW",name:"variablePrice",type:"number",value:this.state.price,onChangeAction:this.handleInputChangeVariablePrice,onBlurAction:this.handleBlurVariablePrice,error:this.state.errors.variablePrice,required:this.state.productHasVariablePrice&&"required"}):h.a.createElement(j.a,{label:this.state.productInputInclVat?"Prijs incl. BTW":"Prijs excl. BTW",name:"price",value:this.state.productInputInclVat?"€"+this.state.priceInclVat.toLocaleString("nl",{minimumFractionDigits:2,maximumFractionDigits:this.state.priceNumberOfDecimals}):"€"+this.state.price.toLocaleString("nl",{minimumFractionDigits:2,maximumFractionDigits:this.state.priceNumberOfDecimals}),readOnly:!0})),h.a.createElement("div",{className:"row"},h.a.createElement(j.a,{label:"Kortingsbedrag",type:"number",id:"amountReduction",name:"amountReduction",value:o,onChangeAction:this.handleInputChange}),h.a.createElement(j.a,{label:"Totaalbedrag incl. BTW",name:"totalPrice",value:"€"+this.state.totalPrice.toLocaleString("nl",{minimumFractionDigits:2,maximumFractionDigits:2}),readOnly:!0})),h.a.createElement("div",{className:"row"},h.a.createElement(V.a,{label:"Begin datum",name:"dateStart",value:i,onChangeAction:this.handleInputChangeStartDate,required:"required",error:this.state.errors.dateStart}),h.a.createElement(V.a,{label:"Eind datum",name:"dateEnd",value:s,onChangeAction:this.handleInputChangeDate,error:this.state.errors.dateEnd,readOnly:"none"===this.state.durationId})),"none"!==this.state.durationId&&h.a.createElement("div",{className:"row"},h.a.createElement(V.a,{label:"1ste notaperiode start op",name:"datePeriodStartFirstInvoice",value:l,onChangeAction:this.handleInputChangeDate,error:this.state.errors.datePeriodStartFirstInvoice,required:"required"})),h.a.createElement("div",{className:"pull-right btn-group",role:"group"},h.a.createElement(O.a,{buttonClassName:"btn-default",buttonText:"Annuleren",onClickAction:this.props.toggleShowNew}),h.a.createElement(O.a,{buttonText:"Opslaan",onClickAction:this.handleSubmit,type:"submit",value:"Submit"})))))}}]),a}(p.Component),Ce=Object(f.b)((function(e){return{orderDetails:e.orderDetails,products:e.systemData.products,costCenters:e.systemData.costCenters}}),(function(e){return{fetchOrderDetails:function(t){e(Object(v.a)(t))}}}))(De),Ie=a(709);function Ne(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function Oe(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?Ne(Object(a),!0).forEach((function(t){P()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Ne(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function we(e){var t=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 a,r=m()(e);if(t){var n=m()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return d()(this,a)}}var Se=function(e){s()(a,e);var t=we(a);function a(e){var r;return n()(this,a),r=t.call(this,e),P()(b()(r),"handleInputChange",(function(e){var t=e.target,a="checkbox"===t.type?t.checked:t.value,n=t.name;r.setState(Oe(Oe({},r.state),{},{orderProduct:Oe(Oe({},r.state.orderProduct),{},P()({},n,a))}),r.updateOrderPrice)})),P()(b()(r),"handleLedgerChange",(function(e){var t=r.props.ledgers.find((function(t){return t.id===e})),a=t.vatCode&&t.vatCode.percentage;r.setState(Oe(Oe({},r.state),{},{product:Oe(Oe({},r.state.product),{},{ledgerId:e,vatPercentage:a})}),r.updatePrice)})),P()(b()(r),"handleCostCenterChange",(function(e){var t=e.target,a="checkbox"===t.type?t.checked:t.value,n=t.name;r.setState(Oe(Oe({},r.state),{},{product:Oe(Oe({},r.state.product),{},P()({},n,a))}))})),P()(b()(r),"handleInputChangeProduct",(function(e){var t=e.target,a="checkbox"===t.type?t.checked:t.value,n=t.name;r.setState(Oe(Oe({},r.state),{},{product:Oe(Oe({},r.state.product),{},P()({},n,a))}),r.updatePrice)})),P()(b()(r),"handleInputChangeProductDuration",(function(e){var t,a=e.target,n="checkbox"===a.type?a.checked:a.value,o=a.name;if(r.state.orderProduct.dateStart)switch(n){case"none":t="";break;case"month":t=B()(r.state.orderProduct.dateStart).add(1,"M").format("YYYY-MM-DD");break;case"quarter":t=B()(r.state.orderProduct.dateStart).add(1,"Q").format("YYYY-MM-DD");break;case"half_year":t=B()(r.state.orderProduct.dateStart).add(6,"M").format("YYYY-MM-DD");break;case"year":t=B()(r.state.orderProduct.dateStart).add(1,"y").format("YYYY-MM-DD");break;case"until_cancellation":t="";break;default:t=""}r.setState(Oe(Oe({},r.state),{},{product:Oe(Oe({},r.state.product),{},P()({},o,n)),orderProduct:Oe(Oe({},r.state.orderProduct),{},{dateEnd:t})}))})),P()(b()(r),"handleInputChangeProductVat",(function(e){var t=e.target,a="checkbox"===t.type?t.checked:t.value,n=t.name;r.setState(Oe(Oe({},r.state),{},{product:Oe(Oe({},r.state.product),{},P()({},n,a))}),r.updatePrice)})),P()(b()(r),"handleInputChangeProductPrice",(function(e){var t=e.target,a="checkbox"===t.type?t.checked:t.value,n=t.name;r.setState(Oe(Oe({},r.state),{},{product:Oe(Oe({},r.state.product),{},P()({},n,a))}),r.updatePrice)})),P()(b()(r),"handleBlurProductPrice",(function(e){var t=e.target,a=t.value,n=t.name;r.setState(Oe(Oe({},r.state),{},{product:Oe(Oe({},r.state.product),{},P()({},n,parseFloat(a).toFixed(r.state.product.priceNumberOfDecimals)))}))})),P()(b()(r),"handleBlurDecimals",(function(e){var t=e.target,a="checkbox"===t.type?t.checked:t.value,n=(t.name,a);n<2&&(n=2),n>6&&(n=6),r.setState(Oe(Oe({},r.state),{},{product:Oe(Oe({},r.state.product),{},{priceNumberOfDecimals:n,price:parseFloat(r.state.product.price).toFixed(n),priceInclVat:parseFloat(r.state.product.priceInclVat).toFixed(n)})}),r.updatePrice)})),P()(b()(r),"updatePrice",(function(){var e=!!r.state.product.inputInclVat&&r.state.product.inputInclVat,t=R.a.isFloat(r.state.product.price+"")?r.state.product.price:0,a=R.a.isFloat(r.state.product.priceInclVat+"")?r.state.product.priceInclVat:0,n=R.a.isFloat(r.state.product.vatPercentage+"")?r.state.product.vatPercentage:0,o=(parseFloat(100)+parseFloat(n))/100;e?(t=a/o,r.setState(Oe(Oe({},r.state),{},{product:Oe(Oe({},r.state.product),{},{price:parseFloat(t).toFixed(r.state.product.priceNumberOfDecimals)})}),r.updateOrderPrice)):(a=t*o,r.setState(Oe(Oe({},r.state),{},{product:Oe(Oe({},r.state.product),{},{priceInclVat:parseFloat(a).toFixed(r.state.product.priceNumberOfDecimals)})}),r.updateOrderPrice))})),P()(b()(r),"updateOrderPrice",(function(){var e,t;e=r.state.product.inputInclVat,t=R.a.isFloat(r.state.product.vatPercentage+"")?r.state.product.vatPercentage:0;var a=(parseFloat(100)+parseFloat(t))/100,n=R.a.isFloat(r.state.product.priceInclVat+"")?r.state.product.priceInclVat:0,o=R.a.isFloat(r.state.product.price+"")?r.state.product.price:0,c=R.a.isFloat(r.state.orderProduct.amount+"")?r.state.orderProduct.amount:0,i=parseFloat(n*c).toFixed(2),s=parseFloat(o*c).toFixed(2),l=0;l=e?n:o;var d=R.a.isFloat(r.state.orderProduct.amountReduction+"")?r.state.orderProduct.amountReduction:0;e||(d*=a),d=parseFloat(d).toFixed(2);var u=(R.a.isFloat(r.state.orderProduct.percentageReduction+"")?r.state.orderProduct.percentageReduction:0)/100,m=0;e?m=i*u:(m=s*u,m*=a);var p=i-d-(m=parseFloat(m).toFixed(2));r.setState(Oe(Oe({},r.state),{},{orderPrice:parseFloat(l).toFixed(r.state.product.priceNumberOfDecimals),totalPrice:parseFloat(p).toFixed(2)}))})),P()(b()(r),"handleSubmit",(function(e){e.preventDefault();var t=r.state.orderProduct,a={},n=!1,o=!1;R.a.isEmpty(t.amount+"")&&(a.amount=!0,n=!0),R.a.isEmpty(t.dateStart+"")&&(a.dateStart=!0,n=!0),!R.a.isEmpty(t.dateStart+"")&&B()(t.dateEnd).isSameOrBefore(B()(t.dateStart))&&(a.dateEnd=!0,n=!0),!R.a.isEmpty(t.dateEnd+"")&&B()(t.dateStart).isSameOrAfter(B()(t.dateEnd))&&(a.dateStart=!0,n=!0),R.a.isEmpty(t.datePeriodStartFirstInvoice+"")&&(a.datePeriodStartFirstInvoice=!0,n=!0);var c=r.state.product,i=!1;r.props.products.map((function(e){return e.code==c.code&&(i=!0)})),i&&(o="Productcode moet uniek zijn.",a.code=!0,n=!0),R.a.isEmpty(c.code+"")&&(a.code=!0,n=!0);var s=!1;r.props.products.map((function(e){return e.name==c.name&&(s=!0)})),s&&(o="Productnaam moet uniek zijn.",a.name=!0,n=!0),i&&s&&(o="Productcode en productnaam moeten uniek zijn."),R.a.isEmpty(c.name+"")&&(a.name=!0,n=!0),R.a.isEmpty(c.administrationId+"")&&(a.administrationId=!0,n=!0),c.inputInclVat?R.a.isEmpty(c.priceInclVat+"")&&(a.priceInclVat=!0,n=!0):R.a.isEmpty(c.price+"")&&(a.price=!0,n=!0),r.props.usesTwinfield&&R.a.isEmpty(String(c.ledgerId))&&(a.ledgerId=!0,n=!0),R.a.isEmpty(c.description)&&(a.description=!0,n=!0),r.setState(Oe(Oe({},r.state),{},{errors:a,errorMessage:o})),!n&&z.a.newProductAndOrderProduct(t,c).then((function(e){r.props.fetchOrderDetails(t.orderId),r.props.toggleShowNewProduct()}))})),r.state={errorMessage:!1,orderPrice:"",totalPrice:"",orderProduct:{orderId:r.props.orderDetails.id,amount:1,amountReduction:0,percentageReduction:0,dateStart:B()().format("YYYY-MM-DD"),dateEnd:"",datePeriodStartFirstInvoice:B()().format("YYYY-MM-DD")},product:{code:"",name:"",durationId:"none",description:"",administrationId:r.props.orderDetails.administrationId,invoiceFrequencyId:r.props.orderDetails.collectionFrequencyId?r.props.orderDetails.collectionFrequencyId:"once",vatPercentage:"",inputInclVat:!1,priceNumberOfDecimals:2,price:"",priceInclVat:"",ledgerId:"",costCenterId:"",isOneTime:!1},errors:{amount:!1,dateStart:!1,dateEnd:!1,code:!1,name:!1,priceNumberOfDecimals:!1,price:!1,priceInclVat:!1,datePeriodStartFirstInvoice:!1,ledgerId:!1,description:!1}},r.handleInputChangeDate=r.handleInputChangeDate.bind(b()(r)),r.handleInputChangeStartDate=r.handleInputChangeStartDate.bind(b()(r)),r}return c()(a,[{key:"handleInputChangeDate",value:function(e,t){this.setState(Oe(Oe({},this.state),{},{orderProduct:Oe(Oe({},this.state.orderProduct),{},P()({},t,e))}))}},{key:"handleInputChangeStartDate",value:function(e,t){var a,r="";if(this.state.orderProduct.dateStart)switch(this.state.product.durationId){case"none":r="";break;case"month":r=B()(e).add(1,"M").format("YYYY-MM-DD");break;case"quarter":r=B()(e).add(1,"Q").format("YYYY-MM-DD");break;case"half_year":r=B()(e).add(6,"M").format("YYYY-MM-DD");break;case"year":r=B()(e).add(1,"y").format("YYYY-MM-DD");break;case"until_cancellation":r="";break;default:r=""}this.setState(Oe(Oe({},this.state),{},{orderProduct:Oe(Oe({},this.state.orderProduct),{},(a={},P()(a,t,e),P()(a,"dateEnd",r),a))}))}},{key:"render",value:function(){var e=this.state.orderProduct,t=e.amount,a=e.amountReduction,r=e.percentageReduction,n=e.dateStart,o=e.dateEnd,c=e.datePeriodStartFirstInvoice,i=this.state.product,s=i.description,l=i.code,d=i.name,u=i.durationId,m=i.vatPercentage,p=i.inputInclVat,f=i.priceNumberOfDecimals,v=i.price,g=i.priceInclVat,b=i.ledgerId,E=i.costCenterId;return h.a.createElement("form",{className:"form-horizontal",onSubmit:this.handleSubmit},h.a.createElement(x.a,{className:"panel-grey"},h.a.createElement(A.a,null,h.a.createElement("div",{className:"row"},h.a.createElement("div",{className:"panel-heading"},h.a.createElement("span",{className:"h5 text-bold"},"Product"))),h.a.createElement("div",{className:"row"},h.a.createElement(j.a,{label:"Productcode",name:"code",value:l,onChangeAction:this.handleInputChangeProduct,required:"required",error:this.state.errors.code}),h.a.createElement(j.a,{label:"Naam",name:"name",value:d,onChangeAction:this.handleInputChangeProduct,required:"required",error:this.state.errors.name})),h.a.createElement("div",{className:"row"},this.props.usesTwinfield?h.a.createElement(h.a.Fragment,null,h.a.createElement(q.a,{label:"Grootboek",name:"ledgerId",id:"ledgerId",options:this.props.ledgers,optionName:"description",value:b,onChangeAction:this.handleLedgerChange,multi:!1,required:"required",error:this.state.errors.ledgerId}),h.a.createElement(M.a,{label:"Kostenplaats",id:"costCenterId",name:"costCenterId",options:this.props.costCenters,optionName:"description",value:E,onChangeAction:this.handleCostCenterChange})):null),h.a.createElement("div",{className:"row"},h.a.createElement(M.a,{label:"Looptijd",id:"durationId",name:"durationId",options:this.props.productDurations,value:u,onChangeAction:this.handleInputChangeProductDuration,emptyOption:!1}),h.a.createElement(M.a,{label:"BTW percentage",name:"vatPercentage",options:this.props.vatCodes,optionValue:"percentage",optionName:"description",value:m,onChangeAction:this.props.usesTwinfield?null:this.handleInputChangeProductVat,placeholder:"Geen",readOnly:this.props.usesTwinfield})),h.a.createElement("div",{className:"row"},h.a.createElement(Ie.a,{label:"Invoer inclusief BTW",name:"inputInclVat",value:p,onChangeAction:this.handleInputChangeProduct}),h.a.createElement(j.a,{label:"Aantal decimalen",type:"number",min:"2",max:"6",name:"priceNumberOfDecimals",value:f,onChangeAction:this.handleInputChangeProduct,onBlurAction:this.handleBlurDecimals,required:"required",error:this.state.errors.priceNumberOfDecimals})),h.a.createElement("div",{className:"row"},p?h.a.createElement(h.a.Fragment,null,h.a.createElement(j.a,{label:"Prijs excl. BTW",id:"price",name:"price",value:v,readOnly:!0,required:"required"}),h.a.createElement(j.a,{label:"Prijs incl. BTW",id:"priceInclVat",name:"priceInclVat",type:"number",min:"0",max:"1000000",value:g,onChangeAction:this.handleInputChangeProductPrice,onBlurAction:this.handleBlurProductPrice,required:"required",error:this.state.errors.priceInclVat})):h.a.createElement(h.a.Fragment,null,h.a.createElement(j.a,{label:"Prijs ex. BTW",id:"price",name:"price",type:"number",min:"0",max:"1000000",value:v,onChangeAction:this.handleInputChangeProductPrice,onBlurAction:this.handleBlurProductPrice,required:"required",error:this.state.errors.price}),h.a.createElement(j.a,{label:"Prijs incl. BTW",id:"priceInclVat",name:"priceInclVat",value:g,readOnly:!0,required:"required"}))),h.a.createElement("div",{className:"row"},h.a.createElement("div",{className:"panel-part panel-heading"},h.a.createElement("span",{className:"h5 text-bold"},"Orderregel"))),h.a.createElement("div",{className:"row"},h.a.createElement(j.a,{label:"Omschrijving",id:"description",name:"description",value:s,onChangeAction:this.handleInputChangeProduct,required:"required",error:this.state.errors.description}),h.a.createElement(j.a,{label:"Aantal",type:"number",id:"amount",name:"amount",value:t,onChangeAction:this.handleInputChange,required:"required",error:this.state.errors.amount})),h.a.createElement("div",{className:"row"},h.a.createElement(j.a,{label:"Kortingspercentage",type:"number",id:"percentageReduction",name:"percentageReduction",value:r,onChangeAction:this.handleInputChange}),h.a.createElement(j.a,{label:this.state.product.inputInclVat?"Prijs incl. BTW":"Prijs excl. BTW",name:"orderPrice",value:"€"+this.state.orderPrice.toLocaleString("nl",{minimumFractionDigits:2,maximumFractionDigits:this.state.product.priceNumberOfDecimals}),readOnly:!0})),h.a.createElement("div",{className:"row"},h.a.createElement(j.a,{label:"Kortingsbedrag",type:"number",id:"amountReduction",name:"amountReduction",value:a,onChangeAction:this.handleInputChange}),h.a.createElement(j.a,{label:"Totaalbedrag incl. BTW",name:"totalPrice",value:"€"+this.state.totalPrice.toLocaleString("nl",{minimumFractionDigits:2,maximumFractionDigits:2}),readOnly:!0})),h.a.createElement("div",{className:"row"},h.a.createElement(V.a,{label:"Begin datum",name:"dateStart",value:n,onChangeAction:this.handleInputChangeStartDate,required:"required",error:this.state.errors.dateStart}),h.a.createElement(V.a,{label:"Eind datum",name:"dateEnd",value:o,onChangeAction:this.handleInputChangeDate,error:this.state.errors.dateEnd,readOnly:"none"===u})),"none"!==u&&h.a.createElement("div",{className:"row"},h.a.createElement(V.a,{label:"1ste notaperiode start op",name:"datePeriodStartFirstInvoice",value:c,onChangeAction:this.handleInputChangeDate,error:this.state.errors.datePeriodStartFirstInvoice,required:"required"})),this.state.errorMessage&&h.a.createElement("div",{className:"col-sm-10 col-md-offset-1 alert alert-danger"},this.state.errorMessage),h.a.createElement("div",{className:"pull-right btn-group",role:"group"},h.a.createElement(O.a,{buttonClassName:"btn-default",buttonText:"Annuleren",onClickAction:this.props.toggleShowNewProduct}),h.a.createElement(O.a,{buttonText:"Opslaan",onClickAction:this.handleSubmit,type:"submit",value:"Submit"})))))}}]),a}(p.Component),ke=Object(f.b)((function(e){return{orderDetails:e.orderDetails,productDurations:e.systemData.productDurations,productInvoiceFrequencies:e.systemData.productInvoiceFrequencies,productPaymentTypes:e.systemData.productPaymentTypes,products:e.systemData.products,costCenters:e.systemData.costCenters,ledgers:e.systemData.ledgers,vatCodes:e.systemData.vatCodes,usesTwinfield:e.systemData.usesTwinfield}}),(function(e){return{fetchOrderDetails:function(t){e(Object(v.a)(t))}}}))(Se);function Te(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function Fe(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?Te(Object(a),!0).forEach((function(t){P()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Te(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function Re(e){var t=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 a,r=m()(e);if(t){var n=m()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return d()(this,a)}}var je=function(e){s()(a,e);var t=Re(a);function a(e){var r;return n()(this,a),r=t.call(this,e),P()(b()(r),"handleInputChange",(function(e){var t=e.target,a="checkbox"===t.type?t.checked:t.value,n=t.name;r.setState(Fe(Fe({},r.state),{},{orderProduct:Fe(Fe({},r.state.orderProduct),{},P()({},n,a))}),r.updateOrderPrice)})),P()(b()(r),"handleLedgerChange",(function(e){var t=r.props.ledgers.find((function(t){return t.id===e})),a=t.vatCode&&t.vatCode.percentage;r.setState(Fe(Fe({},r.state),{},{product:Fe(Fe({},r.state.product),{},{ledgerId:e,vatPercentage:a})}),r.updatePrice)})),P()(b()(r),"handleCostCenterChange",(function(e){var t=e.target,a="checkbox"===t.type?t.checked:t.value,n=t.name;r.setState(Fe(Fe({},r.state),{},{product:Fe(Fe({},r.state.product),{},P()({},n,a))}))})),P()(b()(r),"handleInputChangeProduct",(function(e){var t=e.target,a="checkbox"===t.type?t.checked:t.value,n=t.name;r.setState(Fe(Fe({},r.state),{},{product:Fe(Fe({},r.state.product),{},P()({},n,a))}),r.updatePrice)})),P()(b()(r),"handleInputChangeProductVat",(function(e){var t=e.target,a="checkbox"===t.type?t.checked:t.value,n=t.name;r.setState(Fe(Fe({},r.state),{},{product:Fe(Fe({},r.state.product),{},P()({},n,a))}),r.updatePrice)})),P()(b()(r),"handleInputChangeProductPrice",(function(e){var t=e.target,a="checkbox"===t.type?t.checked:t.value,n=t.name;r.setState(Fe(Fe({},r.state),{},{product:Fe(Fe({},r.state.product),{},P()({},n,a))}),r.updatePrice)})),P()(b()(r),"handleBlurProductPrice",(function(e){var t=e.target,a=t.value,n=t.name;r.setState(Fe(Fe({},r.state),{},{product:Fe(Fe({},r.state.product),{},P()({},n,parseFloat(a).toFixed(r.state.product.priceNumberOfDecimals)))}))})),P()(b()(r),"handleBlurDecimals",(function(e){var t=e.target,a="checkbox"===t.type?t.checked:t.value,n=(t.name,a);n<2&&(n=2),n>6&&(n=6),r.setState(Fe(Fe({},r.state),{},{product:Fe(Fe({},r.state.product),{},{priceNumberOfDecimals:n,price:parseFloat(r.state.product.price).toFixed(n),priceInclVat:parseFloat(r.state.product.priceInclVat).toFixed(n)})}),r.updatePrice)})),P()(b()(r),"updatePrice",(function(){var e=!!r.state.product.inputInclVat&&r.state.product.inputInclVat,t=R.a.isFloat(r.state.product.price+"")?r.state.product.price:0,a=R.a.isFloat(r.state.product.priceInclVat+"")?r.state.product.priceInclVat:0,n=R.a.isFloat(r.state.product.vatPercentage+"")?r.state.product.vatPercentage:0,o=(parseFloat(100)+parseFloat(n))/100;e?(t=a/o,r.setState(Fe(Fe({},r.state),{},{product:Fe(Fe({},r.state.product),{},{price:parseFloat(t).toFixed(r.state.product.priceNumberOfDecimals)})}),r.updateOrderPrice)):(a=t*o,r.setState(Fe(Fe({},r.state),{},{product:Fe(Fe({},r.state.product),{},{priceInclVat:parseFloat(a).toFixed(r.state.product.priceNumberOfDecimals)})}),r.updateOrderPrice))})),P()(b()(r),"updateOrderPrice",(function(){var e,t;e=r.state.product.inputInclVat,t=R.a.isFloat(r.state.product.vatPercentage+"")?r.state.product.vatPercentage:0;var a=(parseFloat(100)+parseFloat(t))/100,n=R.a.isFloat(r.state.product.priceInclVat+"")?r.state.product.priceInclVat:0,o=R.a.isFloat(r.state.product.price+"")?r.state.product.price:0,c=R.a.isFloat(r.state.orderProduct.amount+"")?r.state.orderProduct.amount:0,i=parseFloat(n*c).toFixed(2),s=parseFloat(o*c).toFixed(2),l=0;l=e?n:o;var d=R.a.isFloat(r.state.orderProduct.amountReduction+"")?r.state.orderProduct.amountReduction:0;e||(d*=a),d=parseFloat(d).toFixed(2);var u=(R.a.isFloat(r.state.orderProduct.percentageReduction+"")?r.state.orderProduct.percentageReduction:0)/100,m=0;e?m=i*u:(m=s*u,m*=a);var p=i-d-(m=parseFloat(m).toFixed(2));r.setState(Fe(Fe({},r.state),{},{orderPrice:parseFloat(l).toFixed(r.state.product.priceNumberOfDecimals),totalPrice:parseFloat(p).toFixed(2)}))})),P()(b()(r),"handleSubmit",(function(e){e.preventDefault();var t=r.state.orderProduct,a={},n=!1;R.a.isEmpty(t.amount+"")&&(a.amount=!0,n=!0);var o=r.state.product;o.inputInclVat?R.a.isEmpty(o.priceInclVat+"")&&(a.priceInclVat=!0,n=!0):R.a.isEmpty(o.price+"")&&(a.price=!0,n=!0),r.props.usesTwinfield&&R.a.isEmpty(String(o.ledgerId))&&(a.ledgerId=!0,n=!0),R.a.isEmpty(o.description)&&(a.description=!0,n=!0),r.setState(Fe(Fe({},r.state),{},{errors:a,errorMessage:!1})),!n&&z.a.newProductAndOrderProduct(t,o).then((function(e){r.props.fetchOrderDetails(t.orderId),r.props.toggleShowNewProductOneTime()}))})),r.state={errorMessage:!1,orderPrice:"",totalPrice:"",orderProduct:{orderId:r.props.orderDetails.id,amount:1,amountReduction:0,percentageReduction:0,dateStart:B()().format("YYYY-MM-DD"),dateEnd:"",datePeriodStartFirstInvoice:B()().format("YYYY-MM-DD")},product:{code:"EMP",name:"Eenmalig product",durationId:"none",description:"",administrationId:r.props.orderDetails.administrationId,invoiceFrequencyId:r.props.orderDetails.collectionFrequencyId?r.props.orderDetails.collectionFrequencyId:"once",vatPercentage:"",inputInclVat:!1,priceNumberOfDecimals:2,price:"",priceInclVat:"",ledgerId:"",costCenterId:"",isOneTime:!0},errors:{amount:!1,priceNumberOfDecimals:!1,price:!1,priceInclVat:!1,ledgerId:!1,description:!1}},r}return c()(a,[{key:"render",value:function(){var e=this.state.orderProduct,t=e.amount,a=e.amountReduction,r=e.percentageReduction,n=this.state.product,o=n.description,c=n.vatPercentage,i=n.inputInclVat,s=n.priceNumberOfDecimals,l=n.price,d=n.priceInclVat,u=n.ledgerId,m=n.costCenterId;return h.a.createElement("form",{className:"form-horizontal",onSubmit:this.handleSubmit},h.a.createElement(x.a,{className:"panel-grey"},h.a.createElement(A.a,null,h.a.createElement("div",{className:"row"},h.a.createElement("div",{className:"panel-heading"},h.a.createElement("span",{className:"h5 text-bold"},"Product"))),this.props.usesTwinfield?h.a.createElement("div",{className:"row"},h.a.createElement(q.a,{label:"Grootboek",name:"ledgerId",id:"ledgerId",options:this.props.ledgers,optionName:"description",value:u,onChangeAction:this.handleLedgerChange,multi:!1,required:"required",error:this.state.errors.ledgerId}),h.a.createElement(M.a,{label:"Kostenplaats",id:"costCenterId",name:"costCenterId",options:this.props.costCenters,optionName:"description",value:m,onChangeAction:this.handleCostCenterChange})):null,h.a.createElement("div",{className:"row"},h.a.createElement("div",{className:"form-group col-sm-6"}," "),h.a.createElement(M.a,{label:"BTW percentage",name:"vatPercentage",options:this.props.vatCodes,optionValue:"percentage",optionName:"description",value:c,onChangeAction:this.props.usesTwinfield?null:this.handleInputChangeProductVat,placeholder:"Geen",readOnly:this.props.usesTwinfield})),h.a.createElement("div",{className:"row"},h.a.createElement(Ie.a,{label:"Invoer inclusief BTW",name:"inputInclVat",value:i,onChangeAction:this.handleInputChangeProduct}),h.a.createElement(j.a,{label:"Aantal decimalen",type:"number",min:"2",max:"6",name:"priceNumberOfDecimals",value:s,onChangeAction:this.handleInputChangeProduct,onBlurAction:this.handleBlurDecimals,required:"required",error:this.state.errors.priceNumberOfDecimals})),h.a.createElement("div",{className:"row"},i?h.a.createElement(h.a.Fragment,null,h.a.createElement(j.a,{label:"Prijs excl. BTW",id:"price",name:"price",value:l,readOnly:!0,required:"required"}),h.a.createElement(j.a,{label:"Prijs incl. BTW",id:"priceInclVat",name:"priceInclVat",type:"number",min:"0",max:"1000000",value:d,onChangeAction:this.handleInputChangeProductPrice,onBlurAction:this.handleBlurProductPrice,required:"required",error:this.state.errors.priceInclVat})):h.a.createElement(h.a.Fragment,null,h.a.createElement(j.a,{label:"Prijs ex. BTW",id:"price",name:"price",type:"number",min:"0",max:"1000000",value:l,onChangeAction:this.handleInputChangeProductPrice,onBlurAction:this.handleBlurProductPrice,required:"required",error:this.state.errors.price}),h.a.createElement(j.a,{label:"Prijs incl. BTW",id:"priceInclVat",name:"priceInclVat",value:d,readOnly:!0,required:"required"}))),h.a.createElement("div",{className:"row"},h.a.createElement("div",{className:"panel-part panel-heading"},h.a.createElement("span",{className:"h5 text-bold"},"Orderregel"))),h.a.createElement("div",{className:"row"},h.a.createElement(j.a,{label:"Omschrijving",id:"description",name:"description",value:o,onChangeAction:this.handleInputChangeProduct,required:"required",error:this.state.errors.description}),h.a.createElement(j.a,{label:"Aantal",type:"number",id:"amount",name:"amount",value:t,onChangeAction:this.handleInputChange,required:"required",error:this.state.errors.amount})),h.a.createElement("div",{className:"row"},h.a.createElement(j.a,{label:"Kortingspercentage",type:"number",id:"percentageReduction",name:"percentageReduction",value:r,onChangeAction:this.handleInputChange}),h.a.createElement(j.a,{label:this.state.product.inputInclVat?"Prijs incl. BTW":"Prijs excl. BTW",name:"orderPrice",value:"€"+this.state.orderPrice.toLocaleString("nl",{minimumFractionDigits:2,maximumFractionDigits:this.state.product.priceNumberOfDecimals}),readOnly:!0})),h.a.createElement("div",{className:"row"},h.a.createElement(j.a,{label:"Kortingsbedrag",type:"number",id:"amountReduction",name:"amountReduction",value:a,onChangeAction:this.handleInputChange}),h.a.createElement(j.a,{label:"Totaalbedrag incl. BTW",name:"totalPrice",value:"€"+this.state.totalPrice.toLocaleString("nl",{minimumFractionDigits:2,maximumFractionDigits:2}),readOnly:!0})),this.state.errorMessage&&h.a.createElement("div",{className:"col-sm-10 col-md-offset-1 alert alert-danger"},this.state.errorMessage),h.a.createElement("div",{className:"pull-right btn-group",role:"group"},h.a.createElement(O.a,{buttonClassName:"btn-default",buttonText:"Annuleren",onClickAction:this.props.toggleShowNewProductOneTime}),h.a.createElement(O.a,{buttonText:"Opslaan",onClickAction:this.handleSubmit,type:"submit",value:"Submit"})))))}}]),a}(p.Component),xe=Object(f.b)((function(e){return{orderDetails:e.orderDetails,costCenters:e.systemData.costCenters,ledgers:e.systemData.ledgers,vatCodes:e.systemData.vatCodes,usesTwinfield:e.systemData.usesTwinfield}}),(function(e){return{fetchOrderDetails:function(t){e(Object(v.a)(t))}}}))(je);function Ae(e){var t=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 a,r=m()(e);if(t){var n=m()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return d()(this,a)}}var Me=function(e){s()(a,e);var t=Ae(a);function a(e){var r;return n()(this,a),r=t.call(this,e),P()(b()(r),"toggleShowNew",(function(){r.props.orderDetails.canEdit?r.setState({showNew:!r.state.showNew}):r.props.setError(405,"Een order met daar aan gekoppeld een nota met de status “Te verzenden” kan niet worden aangepast(de order zit in de map “Order – Te verzenden”). Wil je deze order toch aanpassen? Verwijder dan eerst de “Te verzenden” nota. Dan kom deze order weer in de “Order – te factureren”.  Pas de order aan en maak vervolgens opnieuw de nota.")})),P()(b()(r),"toggleShowNewProduct",(function(){r.props.orderDetails.canEdit?r.setState({showNewProduct:!r.state.showNewProduct}):r.props.setError(405,"Een order met daar aan gekoppeld een nota met de status “Te verzenden” kan niet worden aangepast(de order zit in de map “Order – Te verzenden”). Wil je deze order toch aanpassen? Verwijder dan eerst de “Te verzenden” nota. Dan kom deze order weer in de “Order – te factureren”.  Pas de order aan en maak vervolgens opnieuw de nota.")})),P()(b()(r),"toggleShowNewProductOneTime",(function(){r.props.orderDetails.canEdit?r.setState({showNewProductOneTime:!r.state.showNewProductOneTime}):r.props.setError(405,"Een order met daar aan gekoppeld een nota met de status “Te verzenden” kan niet worden aangepast(de order zit in de map “Order – Te verzenden”). Wil je deze order toch aanpassen? Verwijder dan eerst de “Te verzenden” nota. Dan kom deze order weer in de “Order – te factureren”.  Pas de order aan en maak vervolgens opnieuw de nota.")})),r.state={showNew:!1,showNewProduct:!1,showNewProductOneTime:!1},r}return c()(a,[{key:"render",value:function(){return h.a.createElement(x.a,null,h.a.createElement(re.a,null,h.a.createElement("div",{className:"row"},h.a.createElement("div",{className:"col-xs-10"},h.a.createElement("span",{className:"h5 text-bold"},"Orderregels")),this.props.permissions.manageFinancial&&h.a.createElement("div",{className:"col-xs-2"},h.a.createElement("div",{className:"pull-right"},h.a.createElement("span",{className:"glyphicon glyphicon-plus","data-toggle":"dropdown",role:"button"}),h.a.createElement("ul",{className:"dropdown-menu"},h.a.createElement("li",null,h.a.createElement("a",{className:"btn",onClick:this.toggleShowNew},"Bestaand product")),h.a.createElement("li",null,h.a.createElement("a",{className:"btn",onClick:this.toggleShowNewProduct},"Nieuw product")),h.a.createElement("li",null,h.a.createElement("a",{className:"btn",onClick:this.toggleShowNewProductOneTime},"Nieuw eenmalig product"))))))),h.a.createElement(A.a,null,h.a.createElement("div",{className:"col-md-12"},h.a.createElement(be,null)),h.a.createElement("div",{className:"col-md-12 margin-10-top"},this.state.showNew&&h.a.createElement(Ce,{toggleShowNew:this.toggleShowNew}),this.state.showNewProduct&&h.a.createElement(ke,{toggleShowNewProduct:this.toggleShowNewProduct}),this.state.showNewProductOneTime&&h.a.createElement(xe,{toggleShowNewProductOneTime:this.toggleShowNewProductOneTime}))))}}]),a}(p.Component),Le=Object(f.b)((function(e){return{permissions:e.meDetails.permissions,orderDetails:e.orderDetails}}),(function(e){return{setError:function(t,a){e(Object(Q.b)(t,a))}}}))(Me);function Ve(e){var t=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 a,r=m()(e);if(t){var n=m()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return d()(this,a)}}B.a.locale("nl");var qe=function(e){s()(a,e);var t=Ve(a);function a(e){return n()(this,a),t.call(this,e)}return c()(a,[{key:"render",value:function(){var e="",t=!0;return this.props.hasError?e="Fout bij het ophalen van order.":this.props.isLoading?e="Gegevens aan het laden.":Object(T.isEmpty)(this.props.orderDetails)?e="Geen order gevonden!":t=!1,t?h.a.createElement("div",null,e):h.a.createElement("div",null,h.a.createElement(te,null),h.a.createElement(Le,null),h.a.createElement(ne,null))}}]),a}(p.Component),Ye=Object(f.b)((function(e){return{orderDetails:e.orderDetails,isLoading:e.loadingData.isLoading,hasError:e.loadingData.hasError}}))(qe);function Be(e){var t=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 a,r=m()(e);if(t){var n=m()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return d()(this,a)}}var ze=function(e){s()(a,e);var t=Be(a);function a(e){var r;return n()(this,a),r=t.call(this,e),P()(b()(r),"openItem",(function(e){y.f.push("/taak/".concat(e))})),r.state={relatedTasks:""},r}return c()(a,[{key:"render",value:function(){var e=this,t=this.props.relatedTasks;return h.a.createElement("div",null,""==t&&h.a.createElement("div",null,"Geen taken of notities gevonden."),""!=t&&h.a.createElement("table",{className:"table harmonica-table"},h.a.createElement("tbody",null,t.map((function(t,a){return h.a.createElement("tr",{onClick:function(){return e.openItem(t.id)},key:a},h.a.createElement("td",{className:"col-xs-12 clickable"},B()(t.createdAt).format("L")," - ",t.noteSummary))})))))}}]),a}(p.Component),We=Object(f.b)((function(e){return{relatedTasks:e.orderDetails.relatedTasks}}))(ze),_e=Object(f.b)((function(e){return{permissions:e.meDetails.permissions}}),null)((function(e){var t=e.toggleShowList,a=e.showTasksList,r=e.newTask,n=e.taskCount,o=e.permissions;return h.a.createElement(x.a,{className:"harmonica-button"},h.a.createElement(A.a,null,h.a.createElement("div",{className:"col-sm-10",onClick:t,role:"button"},h.a.createElement("span",null,"TAKEN/NOTITIES ",h.a.createElement("span",{className:"badge"},n))),h.a.createElement("div",{className:"col-sm-2"},o.manageTask&&h.a.createElement("div",{className:"pull-right"},h.a.createElement("span",{className:"glyphicon glyphicon-plus glyphicon-white","data-toggle":"dropdown",role:"button"}),h.a.createElement("ul",{className:"dropdown-menu"},h.a.createElement("li",null,h.a.createElement("a",{className:"btn",onClick:function(){return r("open")}},"Maak taak")),h.a.createElement("li",null,h.a.createElement("a",{className:"btn",onClick:function(){return r("afgehandeld")}},"Maak notitie"))))),h.a.createElement("div",{className:"col-sm-12"},a&&h.a.createElement(We,null))))}));function Ge(e){var t=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 a,r=m()(e);if(t){var n=m()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return d()(this,a)}}var Ke=function(e){s()(a,e);var t=Ge(a);function a(e){var r;return n()(this,a),r=t.call(this,e),P()(b()(r),"openItem",(function(e){y.f.push("/email/".concat(e))})),r}return c()(a,[{key:"render",value:function(){var e=this,t=this.props.relatedEmails;return h.a.createElement("div",null,""==t&&h.a.createElement("div",null,"Geen e-mails gevonden."),""!=t&&h.a.createElement("table",{className:"table harmonica-table"},h.a.createElement("tbody",null,t.map((function(t,a){return h.a.createElement("tr",{key:a},h.a.createElement("td",{className:"col-xs-4 clickable",onClick:function(){return e.openItem(t.id)}},B()(t.date_sent).format("L")),h.a.createElement("td",{className:"col-xs-8 clickable",onClick:function(){return e.openItem(t.id)}},t.subject))})))))}}]),a}(p.Component),Xe=Object(f.b)((function(e){return{relatedEmails:e.orderDetails.relatedEmails}}))(Ke),He=function(e){var t=e.toggleShowList,a=e.showEmailsList,r=e.newEmail,n=e.emailCount;return h.a.createElement(x.a,{className:"harmonica-button"},h.a.createElement(A.a,null,h.a.createElement("div",{className:"col-sm-10",onClick:t,role:"button"},h.a.createElement("span",{onClick:t,className:""},"E-MAILS ",h.a.createElement("span",{className:"badge"},n))),h.a.createElement("div",{className:"col-sm-2"},h.a.createElement("a",{role:"button",className:"pull-right",onClick:r},h.a.createElement("span",{className:"glyphicon glyphicon-plus glyphicon-white"}))),h.a.createElement("div",{className:"col-sm-12"},a&&h.a.createElement(Xe,null))))};function Ue(e){var t=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 a,r=m()(e);if(t){var n=m()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return d()(this,a)}}var Qe=function(e){s()(a,e);var t=Ue(a);function a(e){var r;return n()(this,a),r=t.call(this,e),P()(b()(r),"openItem",(function(e){y.f.push("/document/".concat(e))})),r.state={relatedDocuments:""},r}return c()(a,[{key:"render",value:function(){var e=this,t=this.props.relatedDocuments;return h.a.createElement("div",null,""==t&&h.a.createElement("div",null,"Geen documenten gevonden."),""!=t&&h.a.createElement("table",{className:"table harmonica-table"},h.a.createElement("tbody",null,t.map((function(t,a){return h.a.createElement("tr",{onClick:function(){return e.openItem(t.id)},key:a},h.a.createElement("td",{className:"col-xs-5 clickable"},B()(t.createdAt).format("L")),h.a.createElement("td",{className:"col-xs-6 clickable"},t.filename))})))))}}]),a}(p.Component),Je=Object(f.b)((function(e){return{relatedDocuments:e.orderDetails.relatedDocuments}}))(Qe),Ze=Object(f.b)((function(e){return{permissions:e.meDetails.permissions}}),null)((function(e){var t=e.toggleShowList,a=e.showDocumentsList,r=e.newDocument,n=e.documentCount,o=e.permissions;return h.a.createElement(x.a,{className:"harmonica-button"},h.a.createElement(A.a,null,h.a.createElement("div",{className:"col-sm-10",onClick:t,role:"button"},h.a.createElement("span",null,"DOCUMENTEN ",h.a.createElement("span",{className:"badge"},n))),h.a.createElement("div",{className:"col-sm-2"},o.createDocument&&h.a.createElement("div",{className:"pull-right"},h.a.createElement("span",{className:"glyphicon glyphicon-plus glyphicon-white","data-toggle":"dropdown",role:"button"}),h.a.createElement("ul",{className:"dropdown-menu"},h.a.createElement("li",null,h.a.createElement("a",{className:"btn",onClick:function(){return r("internal")}},"Maak document")),h.a.createElement("li",null,h.a.createElement("a",{className:"btn",onClick:function(){return r("upload")}},"Upload document"))))),h.a.createElement("div",{className:"col-sm-12"},a&&h.a.createElement(Je,null))))}));function $e(e){var t=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 a,r=m()(e);if(t){var n=m()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return d()(this,a)}}var et=function(e){s()(a,e);var t=$e(a);function a(e){var r;return n()(this,a),r=t.call(this,e),P()(b()(r),"openItem",(function(e){y.f.push("/nota/".concat(e))})),r.state={relatedInvoices:""},r}return c()(a,[{key:"render",value:function(){var e=this,t=this.props.relatedInvoices;return h.a.createElement("div",null,""==t&&h.a.createElement("div",null,"Geen nota's gevonden."),""!=t&&h.a.createElement("table",{className:"table harmonica-table"},h.a.createElement("tbody",null,t.map((function(t,a){return h.a.createElement("tr",{onClick:function(){return e.openItem(t.id)},key:a},h.a.createElement("td",{className:"col-xs-12 clickable"},B()(t.createdAt).format("L")," - ",t.number))})))))}}]),a}(p.Component),tt=Object(f.b)((function(e){return{relatedInvoices:e.orderDetails.relatedInvoices}}))(et),at=function(e){var t=e.toggleShowList,a=e.showInvoicesList,r=e.invoiceCount;return h.a.createElement(x.a,{className:"harmonica-button"},h.a.createElement(A.a,null,h.a.createElement("div",{className:"col-sm-12",onClick:t,role:"button"},h.a.createElement("span",null,"NOTA'S ",h.a.createElement("span",{className:"badge"},r))),h.a.createElement("div",{className:"col-sm-12"},a&&h.a.createElement(tt,null))))};function rt(e){var t=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 a,r=m()(e);if(t){var n=m()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return d()(this,a)}}var nt=function(e){s()(a,e);var t=rt(a);function a(e){var r;return n()(this,a),r=t.call(this,e),P()(b()(r),"openItem",(function(e){y.f.push("/nota/".concat(e))})),r.state={relatedInvoicesPaidCollection:""},r}return c()(a,[{key:"render",value:function(){var e=this,t=this.props.relatedInvoicesPaidCollection;return h.a.createElement("div",null,""==t&&h.a.createElement("div",null,"Geen geïncasseerde incasso's gevonden."),""!=t&&h.a.createElement("table",{className:"table harmonica-table"},h.a.createElement("tbody",null,t.map((function(t,a){return h.a.createElement("tr",{onClick:function(){return e.openItem(t.id)},key:a},h.a.createElement("td",{className:"col-xs-12 clickable"},B()(t.createdAt).format("L")," - ",t.number))})))))}}]),a}(p.Component),ot=Object(f.b)((function(e){return{relatedInvoicesPaidCollection:e.orderDetails.relatedInvoicesPaidCollection}}))(nt),ct=function(e){var t=e.toggleShowList,a=e.showInvoicesPaidCollectionList,r=e.invoicePaidCollectionCount;return h.a.createElement(x.a,{className:"harmonica-button"},h.a.createElement(A.a,null,h.a.createElement("div",{className:"col-sm-12",onClick:t,role:"button"},h.a.createElement("span",null,"GEÏNCASSEERDE INCASSO'S ",h.a.createElement("span",{className:"badge"},r))),h.a.createElement("div",{className:"col-sm-12"},a&&h.a.createElement(ot,null))))};function it(e){var t=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 a,r=m()(e);if(t){var n=m()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return d()(this,a)}}var st=function(e){s()(a,e);var t=it(a);function a(e){var r;return n()(this,a),r=t.call(this,e),P()(b()(r),"openItem",(function(e){y.f.push("/nota/".concat(e))})),r.state={relatedInvoicesPaidTransfer:""},r}return c()(a,[{key:"render",value:function(){var e=this,t=this.props.relatedInvoicesPaidTransfer;return h.a.createElement("div",null,""==t&&h.a.createElement("div",null,"Geen overboekingen gevonden."),""!=t&&h.a.createElement("table",{className:"table harmonica-table"},h.a.createElement("tbody",null,t.map((function(t,a){return h.a.createElement("tr",{onClick:function(){return e.openItem(t.id)},key:a},h.a.createElement("td",{className:"col-xs-12 clickable"},B()(t.createdAt).format("L")," - ",t.number))})))))}}]),a}(p.Component),lt=Object(f.b)((function(e){return{relatedInvoicesPaidTransfer:e.orderDetails.relatedInvoicesPaidTransfer}}))(st),dt=function(e){var t=e.toggleShowList,a=e.showInvoicesPaidTransferList,r=e.invoicePaidTransferCount;return h.a.createElement(x.a,{className:"harmonica-button"},h.a.createElement(A.a,null,h.a.createElement("div",{className:"col-sm-12",onClick:t,role:"button"},h.a.createElement("span",null,"OVERBOEKINGEN ",h.a.createElement("span",{className:"badge"},r))),h.a.createElement("div",{className:"col-sm-12"},a&&h.a.createElement(lt,null))))};function ut(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function mt(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?ut(Object(a),!0).forEach((function(t){P()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):ut(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function pt(e){var t=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 a,r=m()(e);if(t){var n=m()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return d()(this,a)}}var ht=function(e){s()(a,e);var t=pt(a);function a(e){var r;return n()(this,a),r=t.call(this,e),P()(b()(r),"newTask",(function(e){y.f.push("/taak/nieuw/".concat(e,"/order/").concat(r.props.orderDetails.id))})),P()(b()(r),"newEmail",(function(){y.f.push("/email/nieuw")})),P()(b()(r),"newDocument",(function(e){y.f.push("/document/nieuw/".concat(e,"/order/").concat(r.props.orderDetails.id))})),r.state={toggleShowList:{tasks:!1,emails:!1,documents:!1,invoices:!1,invoicesPaidCollection:!1,invoicesPaidTransfer:!1}},r.toggleShowList=r.toggleShowList.bind(b()(r)),r}return c()(a,[{key:"componentWillReceiveProps",value:function(e){this.props.id!==e.id&&this.setState({toggleShowList:{tasks:!1,emails:!1,documents:!1,invoices:!1,invoicesPaidCollection:!1,invoicesPaidTransfer:!1}})}},{key:"toggleShowList",value:function(e){this.setState(mt(mt({},this.state),{},{toggleShowList:mt(mt({},this.state.toggleShowList),{},P()({},e,!this.state.toggleShowList[e]))}))}},{key:"render",value:function(){var e=this;return h.a.createElement("div",{className:"margin-10-top"},h.a.createElement(_e,{toggleShowList:function(){return e.toggleShowList("tasks")},showTasksList:this.state.toggleShowList.tasks,taskCount:this.props.orderDetails.taskCount,newTask:this.newTask}),h.a.createElement(He,{toggleShowList:function(){return e.toggleShowList("emails")},showEmailsList:this.state.toggleShowList.emails,newEmail:this.newEmail,emailCount:this.props.orderDetails.emailCount}),h.a.createElement(Ze,{toggleShowList:function(){return e.toggleShowList("documents")},showDocumentsList:this.state.toggleShowList.documents,newDocument:this.newDocument,documentCount:this.props.orderDetails.documentCount}),h.a.createElement(at,{toggleShowList:function(){return e.toggleShowList("invoices")},showInvoicesList:this.state.toggleShowList.invoices,invoiceCount:this.props.orderDetails.invoiceCount}),"collection"===this.props.orderDetails.paymentTypeId?h.a.createElement(ct,{toggleShowList:function(){return e.toggleShowList("invoicesPaidCollection")},showInvoicesPaidCollectionList:this.state.toggleShowList.invoicesPaidCollection,invoicePaidCollectionCount:this.props.orderDetails.invoicePaidCollectionCount}):h.a.createElement(dt,{toggleShowList:function(){return e.toggleShowList("invoicesPaidTransfer")},showInvoicesPaidTransferList:this.state.toggleShowList.invoicesPaidTransfer,invoicePaidTransferCount:this.props.orderDetails.invoicePaidTransferCount}))}}]),a}(p.Component),ft=Object(f.b)((function(e){return{orderDetails:e.orderDetails,permissions:e.meDetails.permissions}}),null)(ht);function vt(e){var t=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 a,r=m()(e);if(t){var n=m()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return d()(this,a)}}var gt=function(e){s()(a,e);var t=vt(a);function a(e){return n()(this,a),t.call(this,e)}return c()(a,[{key:"componentDidMount",value:function(){this.props.fetchOrderDetails(this.props.params.id)}},{key:"render",value:function(){return h.a.createElement("div",{className:"row"},h.a.createElement("div",{className:"col-md-9"},h.a.createElement("div",{className:"col-md-12 margin-10-top"},h.a.createElement(x.a,null,h.a.createElement(A.a,{className:"panel-small"},h.a.createElement(k,null)))),h.a.createElement("div",{className:"col-md-12 margin-10-top"},h.a.createElement(Ye,null))),h.a.createElement(x.a,{className:"col-md-3 harmonica"},h.a.createElement(A.a,null,h.a.createElement(ft,null))))}}]),a}(p.Component);t.default=Object(f.b)((function(e){return{orderDetails:e.orderDetails}}),(function(e){return{fetchOrderDetails:function(t){e(Object(v.a)(t))}}}))(gt)},699:function(e,t,a){"use strict";var r=a(0),n=a.n(r),o=a(8),c=a.n(o),i=function(e){var t=e.children,a=e.className,r=e.onMouseEnter,o=e.onMouseLeave;return n.a.createElement("div",{className:"panel panel-default ".concat(a),onMouseEnter:r,onMouseLeave:o},t)};i.defaultProps={className:"",onMouseEnter:function(){},onMouseLeave:function(){}},i.propTypes={className:c.a.string,onMouseEnter:c.a.func,onMouseLeave:c.a.func},t.a=i},700:function(e,t,a){"use strict";var r=a(0),n=a.n(r),o=a(8),c=a.n(o),i=function(e){var t=e.className,a=e.children;return n.a.createElement("div",{className:"panel-body ".concat(t)},a)};i.defaultProps={className:""},i.propTypes={className:c.a.string},t.a=i},701:function(e,t,a){"use strict";var r=a(0),n=a.n(r),o=a(8),c=a.n(o),i=function(e){var t=e.buttonClassName,a=e.iconName,r=e.onClickAction,o=e.title,c=e.disabled;return n.a.createElement("button",{type:"button",className:"btn ".concat(t),onClick:r,disabled:c,title:o},n.a.createElement("span",{className:"glyphicon ".concat(a)}))};i.defaultProps={buttonClassName:"btn-success btn-sm",title:"",disabled:!1},i.propTypes={buttonClassName:c.a.string,iconName:c.a.string.isRequired,onClickAction:c.a.func,title:c.a.string,disabled:c.a.bool},t.a=i},702:function(e,t,a){"use strict";var r=a(0),n=a.n(r),o=a(8),c=a.n(o),i=function(e){var t=e.buttonClassName,a=e.buttonText,r=e.onClickAction,o=e.type,c=e.value,i=e.loading,s=e.loadText,l=e.disabled;return i?n.a.createElement("button",{type:o,className:"btn btn-sm btn-loading ".concat(t),value:c,disabled:i},n.a.createElement("span",{className:"glyphicon glyphicon-refresh glyphicon-refresh-animate"})," ",s):n.a.createElement("button",{type:o,className:"btn btn-sm ".concat(t),onClick:r,value:c,disabled:l},a)};i.defaultProps={buttonClassName:"btn-success",type:"button",value:"",loading:!1,loadText:"Aan het laden",disabled:!1},i.propTypes={buttonClassName:c.a.string,buttonText:c.a.string.isRequired,onClickAction:c.a.func,type:c.a.string,value:c.a.string,loading:c.a.bool,loadText:c.a.string,disabled:c.a.bool},t.a=i},703:function(e,t,a){"use strict";var r=a(0),n=a.n(r),o=a(8),c=a.n(o),i=function(e){var t=e.label,a=e.type,r=e.className,o=e.size,c=e.id,i=e.placeholder,s=e.name,l=e.value,d=e.onClickAction,u=e.onChangeAction,m=e.onBlurAction,p=e.required,h=e.readOnly,f=e.maxLength,v=e.error,g=e.min,b=e.max,E=e.step,P=e.errorMessage,y=e.divSize,D=e.divClassName,C=e.autoComplete;return n.a.createElement("div",{className:"form-group ".concat(y," ").concat(D)},n.a.createElement("label",{htmlFor:c,className:"col-sm-6 ".concat(p)},t),n.a.createElement("div",{className:"".concat(o)},n.a.createElement("input",{type:a,className:"form-control input-sm ".concat(r)+(v?"has-error":""),id:c,placeholder:i,name:s,value:l||"",onClick:d,onChange:u,onBlur:m,readOnly:h,maxLength:f,min:g,max:b,autoComplete:C,step:E})),v&&n.a.createElement("div",{className:"col-sm-offset-6 col-sm-6"},n.a.createElement("span",{className:"has-error-message"}," ",P)))};i.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(){}},i.propTypes={label:c.a.oneOfType([c.a.string,c.a.object]).isRequired,type:c.a.string,className:c.a.string,divClassName:c.a.string,size:c.a.string,divSize:c.a.string,id:c.a.string,placeholder:c.a.string,name:c.a.string.isRequired,value:c.a.oneOfType([c.a.string,c.a.number]),onClickAction:c.a.func,onChangeAction:c.a.func,onBlurAction:c.a.func,required:c.a.string,readOnly:c.a.bool,maxLength:c.a.string,error:c.a.bool,min:c.a.string,max:c.a.string,step:c.a.string,errorMessage:c.a.string,autoComplete:c.a.string},t.a=i},704:function(e,t,a){"use strict";var r=a(0),n=a.n(r),o=a(4),c=a(8),i=a.n(c),s=function(e){var t=e.label,a=e.className,r=e.id,c=e.value,i=e.link,s=e.hidden;return i.length>0?n.a.createElement("div",{className:a,style:s?{display:"none"}:{}},n.a.createElement("label",{htmlFor:r,className:"col-sm-6"},t),n.a.createElement("div",{className:"col-sm-6",id:r,onClick:null},n.a.createElement(o.b,{to:i,className:"link-underline"},c))):n.a.createElement("div",{className:a,style:s?{display:"none"}:{}},n.a.createElement("label",{htmlFor:r,className:"col-sm-6"},t),n.a.createElement("div",{className:"col-sm-6",id:r},c))};s.defaultProps={className:"col-sm-6",value:"",link:"",hidden:!1},s.propTypes={label:i.a.oneOfType([i.a.string,i.a.object]).isRequired,className:i.a.string,id:i.a.string,value:i.a.oneOfType([i.a.string,i.a.number]),link:i.a.string,hidden:i.a.bool},t.a=s},705:function(e,t,a){"use strict";var r=a(0),n=a.n(r),o=a(8),c=a.n(o),i=function(e){var t=e.label,a=e.className,r=e.size,o=e.id,c=e.name,i=e.value,s=e.options,l=e.onChangeAction,d=e.onBlurAction,u=e.required,m=e.error,p=e.errorMessage,h=e.optionValue,f=e.optionName,v=e.readOnly,g=e.placeholder,b=e.divClassName,E=e.emptyOption;return n.a.createElement("div",{className:"form-group ".concat(r," ").concat(b)},n.a.createElement("label",{htmlFor:o,className:"col-sm-6 ".concat(u)},t),n.a.createElement("div",{className:"col-sm-6"},n.a.createElement("select",{className:"form-control input-sm ".concat(a)+(m&&" has-error"),id:o,name:c,value:i||"",onChange:l,onBlur:d,readOnly:v},E&&n.a.createElement("option",{value:""},g),s.map((function(e){return n.a.createElement("option",{key:e[h],value:e[h]},e[f])})))),m&&n.a.createElement("div",{className:"col-sm-offset-6 col-sm-6"},n.a.createElement("span",{className:"has-error-message"}," ",p)))};i.defaultProps={divClassName:"",className:"",size:"col-sm-6",readOnly:!1,required:"",error:!1,errorMessage:"",value:"",optionValue:"id",optionName:"name",placeholder:"",emptyOption:!0},i.propTypes={label:c.a.string.isRequired,className:c.a.string,size:c.a.string,id:c.a.string,name:c.a.string.isRequired,options:c.a.array,value:c.a.oneOfType([c.a.string,c.a.number]),onChangeAction:c.a.func,onBlurAction:c.a.func,required:c.a.string,readOnly:c.a.bool,error:c.a.bool,errorMessage:c.a.string,emptyOption:c.a.bool,optionValue:c.a.string,optionName:c.a.string,placeholder:c.a.string},t.a=i},707:function(e,t,a){"use strict";var r=a(0),n=a.n(r),o=a(8),c=a.n(o),i=function(e){var t=e.className,a=e.children;return n.a.createElement("div",{className:"panel-heading ".concat(t)},a)};i.defaultProps={className:""},i.propTypes={className:c.a.string},t.a=i},708:function(e,t,a){"use strict";var r=a(24),n=a.n(r),o=a(25),c=a.n(o),i=a(22),s=a.n(i),l=a(26),d=a.n(l),u=a(27),m=a.n(u),p=a(16),h=a.n(p),f=a(6),v=a.n(f),g=a(0),b=a.n(g),E=a(8),P=a.n(E),y=a(717),D=a.n(y),C=a(718),I=a.n(C),N=a(7),O=a.n(N);function w(e){var t=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 a,r=h()(e);if(t){var n=h()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return m()(this,a)}}O.a.locale("nl");var S=function(e){d()(a,e);var t=w(a);function a(e){var r;return n()(this,a),r=t.call(this,e),v()(s()(r),"validateDate",(function(e){var t=O()(e.target.value,"DD-MM-YYYY",!0),a=!1;t.isValid()||""===e.target.value||(a=!0),r.props.disabledBefore&&t.isBefore(r.props.disabledBefore)&&(a=!0),r.props.disabledAfter&&t.isAfter(r.props.disabledAfter)&&(a=!0),r.setState({errorDateFormat:a})})),v()(s()(r),"onDateChange",(function(e){var t=e?O()(e).format("Y-MM-DD"):"",a=!1;t&&r.props.disabledBefore&&O()(t).isBefore(r.props.disabledBefore)&&(a=!0),t&&r.props.disabledAfter&&O()(t).isAfter(r.props.disabledAfter)&&(a=!0),r.setState({errorDateFormat:a}),!a&&r.props.onChangeAction(t,r.props.name)})),r.state={errorDateFormat:!1},r}return c()(a,[{key:"render",value:function(){var e=this.props,t=e.label,a=e.className,r=e.size,n=e.divSize,o=e.id,c=e.value,i=e.required,s=e.readOnly,l=e.name,d=e.error,u=e.errorMessage,m=e.disabledBefore,p=e.disabledAfter,h=c?O()(c).format("L"):"",f={};return m&&(f.before=new Date(m)),p&&(f.after=new Date(p)),b.a.createElement("div",{className:"form-group ".concat(n)},b.a.createElement("div",null,b.a.createElement("label",{htmlFor:o,className:"col-sm-6 ".concat(i)},t)),b.a.createElement("div",{className:"".concat(r)},b.a.createElement(D.a,{id:o,value:h,formatDate:C.formatDate,parseDate:C.parseDate,onDayChange:this.onDateChange,dayPickerProps:{showWeekNumbers:!0,locale:"nl",firstDayOfWeek:1,localeUtils:I.a,disabledDays:f},inputProps:{className:"form-control input-sm ".concat(a)+(this.state.errorDateFormat||d?" has-error":""),name:l,onBlur:this.validateDate,autoComplete:"off",readOnly:s,disabled:s},required:i,readOnly:s,placeholder:""})),d&&b.a.createElement("div",{className:"col-sm-offset-6 col-sm-6"},b.a.createElement("span",{className:"has-error-message"}," ",u)))}}]),a}(g.Component);S.defaultProps={className:"",size:"col-sm-6",divSize:"col-sm-6",required:"",readOnly:!1,value:null,error:!1,errorMessage:"",disabledBefore:null,disabledAfter:null},S.propTypes={label:P.a.string.isRequired,type:P.a.string,className:P.a.string,size:P.a.string,divSize:P.a.string,id:P.a.string,name:P.a.string,value:P.a.oneOfType([P.a.string,P.a.object]),onChangeAction:P.a.func,required:P.a.string,readOnly:P.a.bool,error:P.a.bool,errorMessage:P.a.string,disabledBefore:P.a.string,disabledAfter:P.a.string},t.a=S},709:function(e,t,a){"use strict";var r=a(0),n=a.n(r),o=a(8),c=a.n(o),i=a(712),s=a.n(i),l=function(e){var t=e.label,a=e.size,r=e.id,o=e.name,c=e.value,i=e.onChangeAction,l=e.required,d=e.divSize,u=e.className,m=e.disabled;return n.a.createElement("div",{className:"form-group ".concat(d," ").concat(u)},n.a.createElement("div",null,n.a.createElement("label",{htmlFor:r,className:"col-sm-6 ".concat(l)},t)),n.a.createElement("div",{className:"".concat(a)},n.a.createElement(s.a,{id:r,name:o,onChange:i,defaultChecked:c,disabled:m})))};l.defaultProps={className:"",size:"col-sm-6",divSize:"col-sm-6",required:"",disabled:!1,value:""},l.propTypes={label:c.a.string.isRequired,type:c.a.string,size:c.a.string,divSize:c.a.string,id:c.a.string,name:c.a.string.isRequired,value:c.a.bool,onChangeAction:c.a.func,required:c.a.string,disabled:c.a.bool},t.a=l},712:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},n=function(){function e(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),o=a(0),c=m(o),i=m(a(720)),s=m(a(8)),l=m(a(713)),d=m(a(714)),u=a(715);function m(e){return e&&e.__esModule?e:{default:e}}var p=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a.handleClick=a.handleClick.bind(a),a.handleTouchStart=a.handleTouchStart.bind(a),a.handleTouchMove=a.handleTouchMove.bind(a),a.handleTouchEnd=a.handleTouchEnd.bind(a),a.handleFocus=a.handleFocus.bind(a),a.handleBlur=a.handleBlur.bind(a),a.previouslyChecked=!(!e.checked&&!e.defaultChecked),a.state={checked:!(!e.checked&&!e.defaultChecked),hasFocus:!1},a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"componentDidUpdate",value:function(e){e.checked!==this.props.checked&&this.setState({checked:!!this.props.checked})}},{key:"handleClick",value:function(e){var t=this.input;if(e.target!==t&&!this.moved)return this.previouslyChecked=t.checked,e.preventDefault(),t.focus(),void t.click();var a=this.props.hasOwnProperty("checked")?this.props.checked:t.checked;this.setState({checked:a})}},{key:"handleTouchStart",value:function(e){this.startX=(0,u.pointerCoord)(e).x,this.activated=!0}},{key:"handleTouchMove",value:function(e){if(this.activated&&(this.moved=!0,this.startX)){var t=(0,u.pointerCoord)(e).x;this.state.checked&&t+15<this.startX?(this.setState({checked:!1}),this.startX=t,this.activated=!0):t-15>this.startX&&(this.setState({checked:!0}),this.startX=t,this.activated=t<this.startX+5)}}},{key:"handleTouchEnd",value:function(e){if(this.moved){var t=this.input;if(e.preventDefault(),this.startX){var a=(0,u.pointerCoord)(e).x;!0===this.previouslyChecked&&this.startX+4>a?this.previouslyChecked!==this.state.checked&&(this.setState({checked:!1}),this.previouslyChecked=this.state.checked,t.click()):this.startX-4<a&&this.previouslyChecked!==this.state.checked&&(this.setState({checked:!0}),this.previouslyChecked=this.state.checked,t.click()),this.activated=!1,this.startX=null,this.moved=!1}}}},{key:"handleFocus",value:function(e){var t=this.props.onFocus;t&&t(e),this.setState({hasFocus:!0})}},{key:"handleBlur",value:function(e){var t=this.props.onBlur;t&&t(e),this.setState({hasFocus:!1})}},{key:"getIcon",value:function(e){var a=this.props.icons;return a?void 0===a[e]?t.defaultProps.icons[e]:a[e]:null}},{key:"render",value:function(){var e=this,t=this.props,a=t.className,n=(t.icons,function(e,t){var a={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(a[r]=e[r]);return a}(t,["className","icons"])),o=(0,i.default)("react-toggle",{"react-toggle--checked":this.state.checked,"react-toggle--focus":this.state.hasFocus,"react-toggle--disabled":this.props.disabled},a);return c.default.createElement("div",{className:o,onClick:this.handleClick,onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove,onTouchEnd:this.handleTouchEnd},c.default.createElement("div",{className:"react-toggle-track"},c.default.createElement("div",{className:"react-toggle-track-check"},this.getIcon("checked")),c.default.createElement("div",{className:"react-toggle-track-x"},this.getIcon("unchecked"))),c.default.createElement("div",{className:"react-toggle-thumb"}),c.default.createElement("input",r({},n,{ref:function(t){e.input=t},onFocus:this.handleFocus,onBlur:this.handleBlur,className:"react-toggle-screenreader-only",type:"checkbox"})))}}]),t}(o.PureComponent);t.default=p,p.displayName="Toggle",p.defaultProps={icons:{checked:c.default.createElement(l.default,null),unchecked:c.default.createElement(d.default,null)}},p.propTypes={checked:s.default.bool,disabled:s.default.bool,defaultChecked:s.default.bool,onChange:s.default.func,onFocus:s.default.func,onBlur:s.default.func,className:s.default.string,name:s.default.string,value:s.default.string,id:s.default.string,"aria-labelledby":s.default.string,"aria-label":s.default.string,icons:s.default.oneOfType([s.default.bool,s.default.shape({checked:s.default.node,unchecked:s.default.node})])}},713:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,n=a(0),o=(r=n)&&r.__esModule?r:{default:r};t.default=function(){return o.default.createElement("svg",{width:"14",height:"11",viewBox:"0 0 14 11"},o.default.createElement("title",null,"switch-check"),o.default.createElement("path",{d:"M11.264 0L5.26 6.004 2.103 2.847 0 4.95l5.26 5.26 8.108-8.107L11.264 0",fill:"#fff",fillRule:"evenodd"}))}},714:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,n=a(0),o=(r=n)&&r.__esModule?r:{default:r};t.default=function(){return o.default.createElement("svg",{width:"10",height:"10",viewBox:"0 0 10 10"},o.default.createElement("title",null,"switch-x"),o.default.createElement("path",{d:"M9.9 2.12L7.78 0 4.95 2.828 2.12 0 0 2.12l2.83 2.83L0 7.776 2.123 9.9 4.95 7.07 7.78 9.9 9.9 7.776 7.072 4.95 9.9 2.12",fill:"#fff",fillRule:"evenodd"}))}},715:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pointerCoord=function(e){if(e){var t=e.changedTouches;if(t&&t.length>0){var a=t[0];return{x:a.clientX,y:a.clientY}}var r=e.pageX;if(void 0!==r)return{x:r,y:e.pageY}}return{x:0,y:0}}},716:function(e,t,a){"use strict";var r=a(0),n=a.n(r),o=a(8),c=a.n(o),i=a(721),s=(a(722),function(e){var t=e.label,a=e.divSize,r=e.size,o=e.id,c=e.name,s=e.value,l=e.options,d=e.optionId,u=e.optionName,m=e.onChangeAction,p=e.required,h=e.multi,f=e.error,v=e.isLoading,g=e.disabled;return n.a.createElement("div",{className:"form-group ".concat(a)},n.a.createElement("label",{htmlFor:o,className:"col-sm-6 ".concat(p)},t),n.a.createElement("div",{className:"".concat(r)},n.a.createElement(i.a,{id:o,name:c,value:s,onChange:function(e){m(e||"",c)},options:l,valueKey:d,labelKey:u,placeholder:"",noResultsText:"Geen resultaat gevonden",multi:h,simpleValue:!0,removeSelected:!0,className:f?" has-error":"",isLoading:v,disabled:g})))});s.defaultProps={className:"",size:"col-sm-6",divSize:"col-sm-6",optionId:"id",optionName:"name",disabled:!1,required:"",error:!1,value:"",multi:!0,isLoading:!1},s.propTypes={label:c.a.string.isRequired,className:c.a.string,size:c.a.string,divSize:c.a.string,id:c.a.string,name:c.a.string.isRequired,options:c.a.array.isRequired,optionId:c.a.string,optionName:c.a.string,value:c.a.oneOfType([c.a.string,c.a.number]),onChangeAction:c.a.func,onBlurAction:c.a.func,required:c.a.string,disabled:c.a.bool,error:c.a.bool,multi:c.a.bool,isLoading:c.a.bool},t.a=s},770:function(e,t,a){"use strict";a.d(t,"a",(function(){return r})),a.d(t,"b",(function(){return n}));var r=function(e){return{type:"FETCH_ORDER_DETAILS",id:e}},n=function(e,t){return{type:"UPDATE_ORDER",order:e,switchToView:t}}},812:function(e,t,a){"use strict";a.d(t,"d",(function(){return r})),a.d(t,"a",(function(){return n})),a.d(t,"c",(function(){return o})),a.d(t,"e",(function(){return c})),a.d(t,"b",(function(){return i}));var r=function(e,t,a,r){return{type:"FETCH_ORDERS",filters:e,sorts:t,pagination:a,administrationId:r}},n=function(){return{type:"CLEAR_ORDERS"}},o=function(e){return{type:"DELETE_ORDER",id:e}},c=function(e){return{type:"ORDER_PREVIEW_CREATE",data:e}},i=function(){return{type:"CLEAR_ORDER_PREVIEW_CREATE"}}}}]);