'; if(D.view!=="list")h+='
← Liste '; else h+='
'+D.idx.length+' inventaire(s) '; h+='
'; if(D.view==="edit"){var v=G(),n=TI(v);h+='
'+(v.prop||"Nouveau")+' — '+v.ref+' — '+n+' él. 💾
'} h+='
'; // ══ LIST ══ if(D.view==="list"){ h+='
Inventaires Inventaires de référence — prise en gestion
'; h+='
+ Nouvel inventaire '; if(D.idx.length===0)h+='
'; else [].concat(D.idx).sort(function(a,b){return new Date(b.u)-new Date(a.u)}).forEach(function(e){ var d=new Date(e.date).toLocaleDateString("fr-FR"); h+='
'+(e.prop||"Sans nom")+'
'+(e.ref||"")+'
'+(e.owner?e.owner+" • ":"")+d+'
'+(e.ic||0)+' éléments
📄 🗑️
' }); h+='
'; } // ══ EDIT ══ else if(D.view==="edit"){ var v=G(),ri=v.ar; if(!v.acc)v.acc={wifi_nom:"",wifi_mdp:"",boite_cles:"",digicode:"",bip:"",alarme:"",parking:"",cles:"",autre:""}; if(!v.cpt)v.cpt={eau:"",elec:"",gaz:""}; if(!v.rc)v.rc=v.rooms.map(function(){return mkRoom()}); while(v.rc.length
🔍 '; if(D.search.length>=2){var res=gSearch(D.search); if(res.length>0){h+='';res.forEach(function(r){h+='
'+r.nm+' '+r.rm+'
'});h+='
'} else h+=''} h+='
📋 Infos logement '+(D.sec.cfg?"▲":"▼")+' '; if(D.sec.cfg){h+='
'} h+='
🔑 Accès & Connectivité '+(D.sec.acc?"▲":"▼")+' '; if(D.sec.acc){h+='
'; [["wifi_nom","📶 WiFi (nom)","Nom réseau"],["wifi_mdp","📶 WiFi (mdp)","Mot de passe"],["boite_cles","🔑 Boîte à clés","Code"],["digicode","🔢 Digicode","Code"],["bip","📡 Bip portail","Oui/Non"],["alarme","🚨 Alarme","Code"],["parking","🅿️ Parking","Emplacement"],["cles","🔑 Clés remises","Nb et type (ex: 2 clés porte + 1 bip)"],["autre","📝 Autre","Infos"]].forEach(function(f){h+='
'+f[1]+'
'});h+='
'} h+='
📊 Compteurs '+(D.sec.cpt?"▲":"▼")+' '; if(D.sec.cpt){h+='
'} h+='
';v.rooms.forEach(function(rm,i){var n=v.items[i].length;var ev=v.items[i].filter(function(it){return it.co!==null}).length;var pOk=n>0&&ev===n;var pPart=n>0&&ev>0&&ev'+rm+(n>0?' '+(pOk?"✓":ev+"/"+n)+' ':'')+''});h+='+ Pièce
'; if(ri>0)h+='◀ '; h+='
'+v.rooms[ri]+' '; if(ri▶'; h+=' '; if(v.items[ri].length>1)h+='A→Z '; h+='📋 '; if(v.rooms.length>1)h+='🗑️ '; h+='
'; h+='
+
'; if(D.showS&&sgs.length>0){ h+='
'; sgs.slice(0,15).forEach(function(s){ var ck=!!D.multiSel[s]; h+='
' }); if(selCount>0)h+='
✅ Ajouter '+selCount+' élément'+(selCount>1?"s":"")+'
'; h+='
'; } if(D.showS)h+='
Fermer suggestions
'; h+='
Aucun élément — utilisez le champ ci-dessus
'; h+='
'; h+='
'; h+='0?' onclick="mvIt('+ri+','+ii+',-1)"':' style="opacity:.2"')+'>▲'; h+='▼'; h+='
'; h+='
'+it.nm+' '; h+='
− '+it.qty+' +
'; h+='
✕ '; h+='
';CO.forEach(function(c,ci){var on=it.co===ci;h+=''+c.l+' '});h+='
'; if(!showDet)h+='
+ Détails '; if(showDet){h+='
'} h+='
';phs.forEach(function(p,pi){h+='
✕ '}); if(phs.length
📷 '; h+='
🏠 État de la pièce (murs, sol, plafond)
'; [["murs","Murs"],["sol","Sol"],["plafond","Plafond"],["fenetres","Fenêtres"],["prises","Prises"]].forEach(function(f){h+='
'+f[1]+' ';RC_OPT.forEach(function(o){h+=''+o+''});h+='
'}); h+='
📷 Photos pièce ('+(rc.rph.length)+'/'+MAX_PH_ROOM+')
'; rc.rph.forEach(function(p,pi){h+='
✕ '}); if(rc.rph.length
📷 '; h+='
📝 Observations générales
✍️ Signatures 💾 Sauvegarder
📄 Récap 📤 Partager
🖨️ Exporter / PDF
📥 Backup
Signatures Validation de l\'inventaire — signez ci-dessous
Propriétaire — '+(v.owner||"non renseigné")+' '; if(v.sigO)h+='Effacer '; h+='
'; h+='
WISKEYS — '+v.insp+' '; if(v.sigI)h+='Effacer '; h+='
← Retour ✓ Valider
'; h+='
📦
'; h+='
'+(v.prop||"Inventaire")+' '; h+='
'+(v.ref||"")+'
'; h+='
'+ds+(v.owner?" — "+v.owner:"")+'
'; h+='
'+tot+' éléments
'; if(valTot>0)h+='
💰 '+valTot.toLocaleString("fr-FR")+' €
'; if(v.revision)h+='
📅 Révision : '+new Date(v.revision).toLocaleDateString("fr-FR")+'
'; h+='
'; h+='
'; CO.forEach(function(c,ci){if(cc[ci]>0)h+=''+c.l+': '+cc[ci]+' '}); if(nc>0)h+='Non évalué: '+nc+' '; h+='
'; // Accès if(v.acc){var aa=[];if(v.acc.wifi_nom)aa.push("📶 "+v.acc.wifi_nom);if(v.acc.boite_cles)aa.push("🔑 "+v.acc.boite_cles);if(v.acc.digicode)aa.push("🔢 "+v.acc.digicode);if(v.acc.alarme)aa.push("🚨 "+v.acc.alarme);if(v.acc.cles)aa.push("🔑 Clés: "+v.acc.cles); if(aa.length>0)h+='
🔑 Accès '+aa.join(" • ")+'
'} // Compteurs if(v.cpt&&(v.cpt.eau||v.cpt.elec||v.cpt.gaz)){var bits=[];if(v.cpt.eau)bits.push("💧 "+v.cpt.eau);if(v.cpt.elec)bits.push("⚡ "+v.cpt.elec);if(v.cpt.gaz)bits.push("🔥 "+v.cpt.gaz); h+='
📊 Compteurs '+bits.join(" • ")+'
'} // Linen var lin=linenSummary(v); if(lin.length>0){h+='
🛏️ Linge ';lin.forEach(function(l){h+=''+l.nm+' '+l.room+' '+l.qty+' '});var totL=lin.reduce(function(s,l){return s+l.qty},0);h+='Total '+totL+'
'} // Rooms v.rooms.forEach(function(rm,ri){ if(v.items[ri].length===0)return; h+='
'+rm+' ('+v.items[ri].length+') '; if(v.rc&&v.rc[ri]){var rc=v.rc[ri];var bits=[];if(rc.murs!=="—")bits.push("Murs: "+rc.murs);if(rc.sol!=="—")bits.push("Sol: "+rc.sol);if(rc.plafond!=="—")bits.push("Plafond: "+rc.plafond); if(bits.length>0)h+='
'+bits.join(" • ")+'
'; if(rc.rph&&rc.rph.length>0)h+='
📷 '+rc.rph.length+' photo(s)
'} v.items[ri].forEach(function(it){ var co=it.co!==null?CO[it.co]:null;var det=[];if(it.mq)det.push(it.mq);if(it.md)det.push(it.md);if(it.sn)det.push("N°"+it.sn);if(it.val)det.push(it.val+"€");if(it.taille)det.push(it.taille); h+='
'+it.nm+' × '+it.qty+' '; if(det.length>0)h+='
'+det.join(" — ")+'
'; if(it.cm)h+='
💬 '+it.cm+'
'; if((it.ph||[]).length>0)h+='
📷 '+it.ph.length+'
'; h+='
';if(co)h+='
'+co.l+' ';h+='
'});h+='
'}); if(v.sigO||v.sigI){h+='
'; if(v.sigO)h+='
Propriétaire
'+(v.owner||"")+'
'; if(v.sigI)h+='
WISKEYS
'+v.insp+'
';h+='
'} if(v.notes)h+='
📝 '+v.notes+'
'; h+='
← Modifier 📤 Partager
'; h+='
🖨️ Exporter / PDF
Nouveau inventaire ✕ '; h+='
Choisissez un modèle pour pré-remplir les pièces et éléments. Tout est modifiable ensuite.
'; Object.keys(TPL).forEach(function(k){ var t=TPL[k],nR=t.rooms.length,nI=t.items.reduce(function(s,r){return s+r.length},0); var desc=k==="Vide"?"Inventaire vierge — ajoutez tout manuellement":nR+" pièces, "+nI+" éléments pré-remplis (état: Bon)"; var icon=k==="Vide"?"📝":k==="T1 / Studio"?"🏠":k==="T2"?"🏡":k==="T3"?"🏘️":"🏰"; h+='
'; h+=''+icon+' '; }); h+='