Skip to content

Commit

Permalink
Merge pull request #738 from rufener/bugfix
Browse files Browse the repository at this point in the history
fix bug hannening when openning a new cadastration
  • Loading branch information
rufener authored Jun 14, 2023
2 parents d8bae70 + f5a5657 commit 4953bbd
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions front/src/components/Affaires/NewAffaire/NewAffaire.vue
Original file line number Diff line number Diff line change
Expand Up @@ -760,9 +760,13 @@ export default {
// test validation of clients which are in a different component
let test = true;
test = test && this.$refs.ref_client_commande.validator();
test = test && this.$refs.ref_client_envoi.validator();
if (this.affaireTypeRequirements && this.affaireTypeRequirements.section_facture) {
if (this.$refs.ref_client_commande) {
test = test && this.$refs.ref_client_commande.validator();
}
if (this.$refs.ref_client_envoi) {
test = test && this.$refs.ref_client_envoi.validator();
}
if (this.affaireTypeRequirements && this.affaireTypeRequirements.section_facture && this.$refs.ref_client_facture) {
test = test && this.$refs.ref_client_facture.validator();
}
Expand Down Expand Up @@ -910,7 +914,7 @@ export default {
this.form.client_commande_id = process.env.VUE_APP_CLIENT_CADASTRATION_ID;
this.form.client_envoi_id = process.env.VUE_APP_CLIENT_CADASTRATION_ID;
this.form.client_envoi_complement = null;
this.client_facture_id = null;
this.client_facture_id = process.env.VUE_APP_CLIENT_CADASTRATION_ID;
this.client_facture_premiere_ligne = null;
this.form.nom = "Cadastration sur ";
} else if (this.form.type.id === this.typesAffaires_conf.mpd) {
Expand Down Expand Up @@ -1005,8 +1009,12 @@ export default {
_this.setModificationAffaireNuméros();
// fill clients from old affaire
this.$refs.ref_client_commande.getClientById(_this.selectedModificationAffaire.client_commande_id);
this.$refs.ref_client_envoi.getClientById(_this.selectedModificationAffaire.client_envoi_id);
if (this.$refs.ref_client_commande) {
this.$refs.ref_client_commande.getClientById(_this.selectedModificationAffaire.client_commande_id);
}
if (this.$refs.ref_client_envoi) {
this.$refs.ref_client_envoi.getClientById(_this.selectedModificationAffaire.client_envoi_id);
}
this.getParentAffaireFactureClients(this.form.affaire_base_id).then(() => {
this.$refs.ref_client_facture.getClientById(this.client_facture_id);
});
Expand Down

0 comments on commit 4953bbd

Please sign in to comment.