\r\n
\r\n Scriba.state().setObjetPropriete(this, 'lot', 'numero', newValue, this._onVerificationFormulaire)}\r\n required\r\n value={this.state.lot.numero}\r\n />\r\n
\r\n
\r\n {\r\n const lot = { ...this.state.lot, idNature: option.key, idLotType: 0 };\r\n this.setState({ lot }, this._onVerificationFormulaire);\r\n }}\r\n required\r\n selectedKey={this.state.lot.idNature}\r\n />\r\n
\r\n
\r\n 0)}\r\n idNature={this.state.lot.idNature}\r\n onChange={(event, option) => Scriba.state().setObjetPropriete(this, 'lot', 'idLotType', option.key, this._onVerificationFormulaire)}\r\n required\r\n selectedKey={this.state.lot.idLotType}\r\n />\r\n
\r\n {this.state.lot.idNature === 6 || this.state.lot.idNature === 7 || this.state.lot.idNature === 8 || this.state.lot.idNature === 9 || this.state.lot.idNature === 15 ?\r\n null :\r\n
\r\n Scriba.state().setObjetPropriete(this, 'lot', 'numCoPro', newValue, this._onVerificationFormulaire)}\r\n value={this.state.lot.numCoPro}\r\n />\r\n
\r\n }\r\n {this.state.lot.idNature === 6 || this.state.lot.idNature === 7 || this.state.lot.idNature === 8 || this.state.lot.idNature === 9 || this.state.lot.idNature === 15 ?\r\n null :\r\n
\r\n Scriba.officeUI().textField().nombre().onFocusTextFieldNombreObjet(this, 'lot', 'nombreTantiemes')}\r\n onBlur={e => Scriba.officeUI().textField().nombre().onBlurTextFieldNombreObjet(this, 'lot', 'nombreTantiemes', e.target.value, 'fr', this._onVerificationFormulaire)}\r\n onGetErrorMessage={e => Scriba.officeUI().textField().nombre().onGetErrorMessageTextFieldNombre(this, 'nombreTantiemes', e, false, 0)}\r\n deferredValidationTime={0}\r\n />\r\n
\r\n }\r\n {this.state.lot.idNature === 6 || this.state.lot.idNature === 7 || this.state.lot.idNature === 8 || this.state.lot.idNature === 9 || this.state.lot.idNature === 15 ?\r\n null :\r\n
\r\n Scriba.state().setObjetPropriete(this, 'lot', 'baseTantiemes', option.key, this._onVerificationFormulaire)}\r\n options={[\r\n { key: '1000', text: '1000' },\r\n { key: '10000', text: '10000' }\r\n ]}\r\n selectedKey={this.state.lot.baseTantiemes}\r\n />\r\n
\r\n }\r\n {this.state.lot.idNature === 15 ?\r\n null :\r\n
\r\n Scriba.state().setObjetPropriete(this, 'lot', 'etage', option.key, this._onVerificationFormulaire)}\r\n required={this.state.lot.idNature === 1}\r\n selectedKey={this.state.lot.etage}\r\n />\r\n
\r\n }\r\n {this.state.lot.idNature === 3 || this.state.lot.idNature === 4 ?\r\n null :\r\n
\r\n Scriba.state().setObjetPropriete(this, 'lot', 'exposition', option.key, this._onVerificationFormulaire)}\r\n required={this.state.lot.idNature === 1}\r\n selectedKey={this.state.lot.exposition}\r\n />\r\n
\r\n }\r\n
\r\n Scriba.officeUI().textField().nombre().onFocusTextFieldNombreObjet(this, 'lot', 'surfaceHabitable')}\r\n onBlur={e => Scriba.officeUI().textField().nombre().onBlurTextFieldNombreObjet(this, 'lot', 'surfaceHabitable', e.target.value, 'fr', this._onVerificationFormulaire)}\r\n onGetErrorMessage={e => Scriba.officeUI().textField().nombre().onGetErrorMessageTextFieldNombre(this, 'surfaceHabitable', e, false, 2)}\r\n deferredValidationTime={0}\r\n suffix=\"m²\"\r\n />\r\n
\r\n {(this.state.lot.idNature >= 6 && this.state.lot.idNature <= 12) || this.state.lot.idNature === 15 ?\r\n null :\r\n
\r\n Scriba.state().setObjetPropriete(this, 'lot', 'batiment', newValue, this._onVerificationFormulaire)}\r\n value={this.state.lot.batiment}\r\n />\r\n
\r\n }\r\n {this.state.lot.idNature === 1 || this.state.lot.idNature === 2 || this.state.lot.idNature === 15 ?\r\n
\r\n Scriba.officeUI().textField().nombre().onFocusTextFieldNombreObjet(this, 'lot', 'nombreSalleDeBain')}\r\n onBlur={e => Scriba.officeUI().textField().nombre().onBlurTextFieldNombreObjet(this, 'lot', 'nombreSalleDeBain', e.target.value, 'fr', this._onVerificationFormulaire)}\r\n onGetErrorMessage={e => Scriba.officeUI().textField().nombre().onGetErrorMessageTextFieldNombre(this, 'nombreSalleDeBain', e, false, 0)}\r\n deferredValidationTime={0}\r\n />\r\n
\r\n : null\r\n }\r\n {this.state.lot.idNature == 1 || this.state.lot.idNature === 2 || this.state.lot.idNature === 15 ?\r\n
\r\n Scriba.officeUI().textField().nombre().onFocusTextFieldNombreObjet(this, 'lot', 'nombreWC')}\r\n onBlur={e => Scriba.officeUI().textField().nombre().onBlurTextFieldNombreObjet(this, 'lot', 'nombreWC', e.target.value, 'fr', this._onVerificationFormulaire)}\r\n onGetErrorMessage={e => Scriba.officeUI().textField().nombre().onGetErrorMessageTextFieldNombre(this, 'nombreWC', e, false, 0)}\r\n deferredValidationTime={0}\r\n />\r\n
\r\n : null\r\n }\r\n {this.state.lot.idNature === 3 || this.state.lot.idNature === 4 || this.state.lot.idNature === 5 || this.state.lot.idNature === 6 || this.state.lot.idNature === 7 || this.state.lot.idNature === 8 || this.state.lot.idNature === 9 || this.state.lot.idNature === 10 || this.state.lot.idNature === 15 ?\r\n null :\r\n
\r\n Scriba.officeUI().textField().nombre().onFocusTextFieldNombreObjet(this, 'lot', 'prixMobilierHT')}\r\n onBlur={e => Scriba.officeUI().textField().nombre().onBlurTextFieldNombreObjet(this, 'lot', 'prixMobilierHT', e.target.value, 'fr', this._onVerificationFormulaire)}\r\n onGetErrorMessage={e => Scriba.officeUI().textField().nombre().onGetErrorMessageTextFieldNombre(this, 'prixMobilierHT', e, false, 2)}\r\n deferredValidationTime={0}\r\n suffix=\"€\"\r\n />\r\n
\r\n }\r\n
\r\n 10}\r\n value={Scriba.officeUI().textField().nombre().ValeurChampNombreObjetAvecPrecisionAfficheeSpecifiee(this, 'lot', 'prixHT', false, 12, 2)}\r\n onFocus={() => Scriba.officeUI().textField().nombre().onFocusTextFieldNombreObjet(this, 'lot', 'prixHT')}\r\n onBlur={e => this._calculPrixTTC(e.target.value)}\r\n onGetErrorMessage={e => Scriba.officeUI().textField().nombre().onGetErrorMessageTextFieldNombre(this, 'prixHT', e, false, 2)}\r\n deferredValidationTime={0}\r\n suffix=\"€\"\r\n />\r\n
\r\n {this.state.lot.idNature === 6 || this.state.lot.idNature === 7 || this.state.lot.idNature === 8 || this.state.lot.idNature === 9 || this.state.lot.idNature === 10 || this.state.lot.idNature === 15 ?\r\n null :\r\n
\r\n Scriba.officeUI().textField().nombre().onFocusTextFieldNombreObjet(this, 'lot', 'prixMaitriseHT')}\r\n onBlur={e => Scriba.officeUI().textField().nombre().onBlurTextFieldNombreObjet(this, 'lot', 'prixMaitriseHT', e.target.value, 'fr', this._onVerificationFormulaire)}\r\n onGetErrorMessage={e => Scriba.officeUI().textField().nombre().onGetErrorMessageTextFieldNombre(this, 'prixMaitriseHT', e, false, 2)}\r\n deferredValidationTime={0}\r\n suffix=\"€\"\r\n />\r\n
\r\n }\r\n {this.state.lot.idNature === 6 || this.state.lot.idNature === 7 || this.state.lot.idNature === 8 || this.state.lot.idNature === 9 || this.state.lot.idNature === 10 ?\r\n null :\r\n
\r\n Scriba.officeUI().textField().nombre().onFocusTextFieldNombreObjet(this, 'lot', 'prixTTC')}\r\n onBlur={e => this._calculPrixHT(e.target.value)}\r\n onGetErrorMessage={e => Scriba.officeUI().textField().nombre().onGetErrorMessageTextFieldNombre(this, 'prixTTC', e, false, 2)}\r\n deferredValidationTime={0}\r\n suffix=\"€\"\r\n />\r\n
\r\n }\r\n {this.state.lot.idNature === 6 || this.state.lot.idNature === 7 || this.state.lot.idNature === 8 || this.state.lot.idNature === 9 || this.state.lot.idNature === 10 || this.state.lot.idNature === 15 ?\r\n null :\r\n
\r\n Scriba.officeUI().textField().nombre().onFocusTextFieldNombreObjet(this, 'lot', 'loyerAnnuelHT')}\r\n onBlur={e => Scriba.officeUI().textField().nombre().onBlurTextFieldNombreObjet(this, 'lot', 'loyerAnnuelHT', e.target.value, 'fr', this._onVerificationFormulaire)}\r\n onGetErrorMessage={e => Scriba.officeUI().textField().nombre().onGetErrorMessageTextFieldNombre(this, 'loyerAnnuelHT', e, false, 2)}\r\n deferredValidationTime={0}\r\n suffix=\"€\"\r\n />\r\n
\r\n }\r\n\r\n {this.state.lot.idLot == null ? null :\r\n
\r\n
\r\n {this.state.lot.creerLe !== null ?\r\n
\r\n Créé le {Scriba.date().stringDateFormatCourt(this.state.lot.creerLe)} par {this.state.lot.creerPar}\r\n
\r\n : null\r\n }\r\n {this.state.lot.modifierLe !== null ?\r\n
\r\n Modifié le {Scriba.date().stringDateFormatCourt(this.state.lot.modifierLe)} par {this.state.lot.modifierPar}\r\n
\r\n : null\r\n }\r\n
\r\n
\r\n }\r\n
\r\n );\r\n }\r\n\r\n constructor(props) {\r\n super(props);\r\n\r\n this.state = objetState;\r\n }\r\n\r\n _onInit() {\r\n this.setState(objetState);\r\n }\r\n\r\n _onAnnulation = () => {\r\n this._onInit();\r\n this.props.onFermeFicheLot();\r\n }\r\n\r\n _chargementDonnees() {\r\n this.setState({ enCoursDeTraitement: true, messageEnCoursTraitement: \"Chargement du lot\" });\r\n\r\n var chargementLot = DataLot._chargementLot(this.props.idLot);\r\n\r\n chargementLot\r\n .then(responseFetch => {\r\n let retourVerif = Immocom.onRegardeSiOnChargeLesDonnees(responseFetch, this);\r\n\r\n if (retourVerif === null) {\r\n let objetData = responseFetch.reponseAPIobjet;\r\n let lotTrav = objetData[0];\r\n\r\n lotTrav.prixHT = parseFloat(lotTrav.prixHT).toFixed(12);\r\n\r\n if (lotTrav.prixMaitriseHT !== null) {\r\n lotTrav.prixMaitriseHT = parseFloat(lotTrav.prixMaitriseHT).toFixed(2);\r\n }\r\n\r\n if (lotTrav.loyerAnnuelHT !== null) {\r\n lotTrav.loyerAnnuelHT = parseFloat(lotTrav.loyerAnnuelHT).toFixed(2);\r\n }\r\n\r\n // Ticket 1443 - Par défaut à 1\r\n if (lotTrav.idLot <= 0) {\r\n if (lotTrav.nombreSalleDeBain == null) {\r\n lotTrav.nombreSalleDeBain = 1;\r\n }\r\n\r\n if (lotTrav.nombreWC == null) {\r\n lotTrav.nombreWC = 1;\r\n }\r\n }\r\n\r\n let stateTemp = {};\r\n stateTemp.idLot = this.props.idLot;\r\n stateTemp.lot = lotTrav;\r\n stateTemp.tauxTVA = objetData[2];\r\n stateTemp.titrePanel = (lotTrav.idLot > 0 ? 'Modifier le lot ' + lotTrav.numero : 'Créer un lot');\r\n stateTemp.onDesactivePrixMaitrise = (objetData[1] !== 3);\r\n\r\n Immocom.onReinitStateValeurParDefautEtExecutionDuSetState(this, stateTemp);\r\n\r\n //if (lotTrav.idLot !== 0)\r\n this._calculPrixTTC(lotTrav.prixHT);\r\n }\r\n else {\r\n Immocom.onTraitementErreurAvecState(this, { ...this.state }, retourVerif, responseFetch);\r\n }\r\n });\r\n }\r\n\r\n _onVerificationFormulaire() {\r\n Immocom.fiche()._validationFormulaire(this, 'Lot', this.state.lot, (this.state.lot.idLot > 0 ? 'Modification' : 'Création'));\r\n }\r\n\r\n _onEnregistrement = () => {\r\n this.setState({\r\n enCoursDeTraitement: true,\r\n messageEnCoursTraitement: 'Enregistrement du lot en cours'\r\n });\r\n\r\n let enregistrementLot = DataLot._onEnregistrementLot(this.state.lot, this.state.idLot);\r\n\r\n enregistrementLot\r\n .then(responseFetch => {\r\n let retourVerif = Immocom.onRegardeSiOnChargeLesDonnees(responseFetch, this);\r\n\r\n if (retourVerif === null) {\r\n Immocom.onReinitStateValeurParDefautEtExecutionDuSetState(this, { ...this.state });\r\n\r\n this.props.onFermeFicheLot();\r\n }\r\n else {\r\n Immocom.onTraitementErreurAvecState(this, { ...this.state }, retourVerif, responseFetch);\r\n }\r\n });\r\n }\r\n\r\n _calculPrixTTC(prixHT) {\r\n let prixTTC = (prixHT * (1 + parseFloat(this.state.tauxTVA))).toFixed(2);\r\n\r\n let lot = { ...this.state.lot };\r\n lot.prixTTC = prixTTC;\r\n\r\n // If you want a function to be executed after the state change occurs, pass it in as a callback\r\n this.setState({ lot: lot }, function () {\r\n Scriba.officeUI().textField().nombre().onBlurTextFieldNombreObjet(this, 'lot', 'prixHT', prixHT, 'fr', this._onVerificationFormulaire)\r\n });\r\n }\r\n\r\n _calculPrixHT(prixTTC) {\r\n var prixHT = (prixTTC / (1 + parseFloat(this.state.tauxTVA))).toFixed(12);\r\n\r\n\r\n let lot = { ...this.state.lot };\r\n lot.prixHT = prixHT;\r\n\r\n // If you want a function to be executed after the state change occurs, pass it in as a callback\r\n this.setState({ lot: lot }, function () {\r\n Scriba.officeUI().textField().nombre().onBlurTextFieldNombreObjet(this, 'lot', 'prixTTC', prixTTC, 'fr', this._onVerificationFormulaire);\r\n\r\n });\r\n }\r\n\r\n _onRenderFooterContent = () => {\r\n let boutonActif = this.state.onActiveBoutonEnregistrer;\r\n\r\n return (\r\n