Skip to content

Commit

Permalink
fix(issue-62): deperdition_plancher_haut should be use enum_periode_i…
Browse files Browse the repository at this point in the history
…solation_id if known
  • Loading branch information
Jérôme GAVIGNET authored and jzck committed Jul 17, 2024
1 parent 816ba20 commit 47da723
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
17 changes: 10 additions & 7 deletions src/3.2.3_plancher_haut.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,17 @@ export default function calc_ph(ph, zc, pc_id, ej) {
di.uph = Math.min(di.uph, di.uph0);
break;
case 'année de construction saisie (table forfaitaire)': {
// i.e l'année d'isolation n'est pas connue
let pi_id = pc_id;
const pc = enums.periode_construction[pc_id];
switch (pc) {
case 'avant 1948':
case '1948-1974':
pi_id = getKeyByValue(enums.periode_isolation, '1975-1977');
break;
if (de.enum_periode_isolation_id) {
pi_id = de.enum_periode_isolation_id;
} else {
const pc = enums.periode_construction[pc_id];
switch (pc) {
case 'avant 1948':
case '1948-1974':
pi_id = getKeyByValue(enums.periode_isolation, '1975-1977');
break;
}
}
calc_uph0(di, de, du);
const tv_uph_avant = de.tv_uph_id;
Expand Down
4 changes: 2 additions & 2 deletions src/3_deperdition.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ export function Upt(o) {
export default function calc_deperdition(cg, zc, th, ej, enveloppe, logement) {
const pc = cg.enum_periode_construction_id;

const mur_list = enveloppe.mur_collection.mur;
const mur_list = enveloppe.mur_collection.mur || [];
const pb_list = enveloppe.plancher_bas_collection.plancher_bas || [];
const ph_list = enveloppe.plancher_haut_collection.plancher_haut || [];
const bv_list = enveloppe.baie_vitree_collection.baie_vitree || [];
const porte_list = enveloppe.porte_collection.porte || [];
const bv_list = enveloppe.baie_vitree_collection.baie_vitree || [];
const pt_list = enveloppe.pont_thermique_collection.pont_thermique || [];
const vt_list = logement.ventilation_collection.ventilation;

Expand Down

0 comments on commit 47da723

Please sign in to comment.