KNH5OGCTL3YCOQQPA32M76SGWHGHAPQRIZ7S2CBC5DGIEV32SOYQC
$: tarifAllo = (i: number) => p.prixAllo * Math.pow(1+p.inflation/100, i)
$: chiffreAffaires = (i: number) => ((i == 0) ? primeInvestissement : 0) + productionAnnuelle(i) * (autoconso * tarifLocal(i) + (1 - autoconso) * tarifSurplus(i) + p.autoprod * tarifAllo(i)/100)
$: tarifAllo = (i: number) => p.coutElec * Math.pow(1+p.inflationElec/100, i)
for(let i = 0; i < 10; i++) {
cout += p.coutElec * Math.pow(1 + p.inflationElec / 100, i) * p.consoMoyenneFoyer
for(let i = 0; i < N; i++) {
console.log('coutelec10 : ', p.coutElec , p.inflationElec, i ,consoMoyenneFoyer(i))
cout += p.coutElec * Math.pow(1 + p.inflationElec / 100, i) * consoMoyenneFoyer(i)
for(let i = 0; i < 10; i++) {
cout += tarifLocal(i) * p.consoMoyenneFoyer * p.autoprod / 100
+ p.coutElec * Math.pow(1 + p.inflationElec / 100, i) * p.consoMoyenneFoyer * (100 - p.autoprod) / 100
for(let i = 0; i < N; i++) {
console.log('cout10 : ' , tarifLocal(i), consoMoyenneFoyer(i) ,p.autoprod,i)
cout += tarifLocal(i) * consoMoyenneFoyer(i) * p.autoprod / 100
+ p.coutElec * Math.pow(1 + p.inflationElec / 100, i) * consoMoyenneFoyer(i) * (100 - p.autoprod) / 100
function sum(x:any,n:number){
let s:number=0
for(let i=0;i<n;i++){
s+=x(i)
function sum(x: (number) => number, n: number){
return new Array(n).fill(0).reduce((a, _, i) => a + x(i))
}
function formateur(x : number){
let X:number = 0
let s:string = '';
if (Math.abs(x) <= 1000){
s = ' €'
X = x.toFixed(0)
} else if (Math.abs(x) < 1000000) {
s = ' k€'
X = (x/1000).toFixed(2)
} else if(Math.abs(x) < 1000000000) {
s = ' M€'
X = x/1000000
} else {
s = ' mds€'
X = x/1000000000
}
return Intl.NumberFormat('fr-FR').format(X).toString()+ s
}
function rentabiliteTaux(x:number,y:number){
return y ?
((x*100/y)-100).toFixed(2)+' %'
: 0
}
function traceArray(x: (number) => number, n:number){
let a:Array<number> = []
let b:Array<number> = []
let c:string='M 0,50 L '
for (let i = 0; i < n; i ++ ){
let pr:number = 0
if (i>0){pr = a[i-1]}
a.push((x(i)+pr))
b.push(i)
}
let rapx:number=50/(Math.max(...a)-Math.min(...a))// COMMENT GERER LES CAS >0 ?
let rapy:number=300/(Math.max(...b)-Math.min(...b))
for (let i = 0; i < n; i ++ ){
c += (' ' + (i*rapy).toFixed(arr).toString()+ ',' + (50-a[i]*rapx).toFixed(arr).toString() )
}
return c
}
function roiDate(j: (number) => number){
let d:number = 0
let resultat:string=''
for (let i = 0; i < N; i += 1 ){
if (sum(j,i+1) > 0){
d=i
break;
}
}
if (d <= 0) {
resultat = 'À la saint glinglin'
} else if (d > 0){
let resu:string=''
let y:number = (d%12).toFixed(0)
let x:number = Math.trunc(d/12)
if (x > 0){
resu += x.toString()+' ans'
}
if (y > 0){
resu += y.toString()+' mois'
}
resultat = resu
return Intl.NumberFormat('fr-FR').format(s.toFixed(arr))
return resultat
}
$: rembPret = (n:number) => {
let totalRembAnnuel_n =remboursementAnnuel.slice(0,n).reduce((a, b) => a + b,0)
let totalInteret_n = sum(interetsDetteSenior,n)
let totalRembAnnuel =remboursementAnnuel.reduce((a, b) => a + b,0)
let totalInteret = sum(interetsDetteSenior,N)
return (totalRembAnnuel + totalInteret) ?
((totalRembAnnuel_n + totalInteret_n) * 100 / (totalRembAnnuel + totalInteret)).toFixed(1) + ' %'
: 0
<nav class="navbar navbar-expand-lg start-0 w-lg-25">
<button class="navbar-toggler" type="button" data-bs-toggle="offcanvas" data-bs-target="#menuoff" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="d-lg-none ms-3 me-auto">
{#if data.name}
<h1 class="my-0">{data.name}</h1>
{/if}
</div>
</nav>
<div class="offcanvas-lg offcanvas-start mb-auto" data-bs-scroll="true" tabindex="-1" id="menuoff">
<div class="offcanvas-body">
<div class="p-3 p-lg-0 overflow-auto">
<nav class="navbar navbar-expand-lg start-0 w-lg-25">
<button class="navbar-toggler" type="button" data-bs-toggle="offcanvas" data-bs-target="#menuoff" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="d-lg-none ms-3 me-auto">
<div class="my-3 form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="expert" bind:checked={expert}>
<label class="form-check-label" for="expert">Niveau expert</label>
</div>
</div>
</nav>
<h2 class="mt-5">Communauté</h2>
<div class="my-3">
<label class="form-label" for="puissance">Puissance totale (kWc)</label>
<input class="form-control form-control-sm" type="number" id="puissance" min="1" bind:value={p.puissance}/>
</div>
<div class="mb-3">
<label class="form-label" for="autoconso">Taux d'autoconsommation (%)<button type="button" class="btn btn-link align-baseline p-0 ms-2" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-content="Pourcentage de la production consommée localement, à valider plus finement dans l'onglet Simulation. C'est la valeur que l'application Coturnix optimise."><i class="bi bi-question-circle"></i></button>
</label>
<div class="d-flex">
<input class="form-range me-4" type="range" id="autoconso" bind:value={p.autoconso}/>{p.autoconso}%
<div class="offcanvas-lg offcanvas-start mb-auto" data-bs-scroll="true" tabindex="-1" id="menuoff">
<div class="offcanvas-body">
<div class="p-3 p-lg-0 overflow-auto">
{#if data.name}
<h1>{data.name}</h1>
{/if}
<div class="my-3 form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="expert" bind:checked={expert}>
<label class="form-check-label" for="expert">Niveau expert</label>
</div>
<h2 class="mt-5">Communauté</h2>
<div class="my-3">
<label class="form-label" for="puissance">Puissance totale (kWc)</label>
<input class="form-control form-control-sm" type="number" id="puissance" min="1" bind:value={p.puissance}/>
</div>
<div class="mb-3">
<label class="form-label" for="autoconso">Taux d'autoconsommation (%)<button type="button" class="btn btn-link align-baseline p-0 ms-2" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-content="Pourcentage de la production consommée localement, à valider plus finement dans l'onglet Simulation. C'est la valeur que l'application Coturnix optimise."><i class="bi bi-question-circle"></i></button>
</label>
<div class="d-flex">
<input class="form-range me-4" type="range" id="autoconso" bind:value={p.autoconso}/>{p.autoconso}%
</div>
</div>
<div class="mb-3">
<label class="form-label" for="autoprod">Taux d'autoproduction (%)<button type="button" class="btn btn-link align-baseline p-0 ms-2" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-content="Pourcentage des consommations venant de sources locales, à valider plus finement dans l'onglet Simulation."><i class="bi bi-question-circle"></i></button></label>
<div class="d-flex">
<input class="form-range me-4" type="range" id="autoprod" bind:value={p.autoprod}/>{p.autoprod}%
</div>
</div>
<div class="mb-3">
<label class="form-label" for="autoprod">Taux d'autoproduction (%)<button type="button" class="btn btn-link align-baseline p-0 ms-2" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-content="Pourcentage des consommations venant de sources locales, à valider plus finement dans l'onglet Simulation."><i class="bi bi-question-circle"></i></button></label>
<div class="d-flex">
<input class="form-range me-4" type="range" id="autoprod" bind:value={p.autoprod}/>{p.autoprod}%
<div class="mb-3">
<label class="form-label" for="prix">Prix d'achat alloproduit (€/kWh)<button type="button" class="btn btn-link align-baseline p-0 ms-2" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-content="Ce prix dépend du contrat de fourniture d'électricité du producteur."><i class="bi bi-question-circle"></i></button></label>
<input class="form-control form-control-sm" type="number" step="0.01" min="0" id="coutElec" bind:value={p.coutElec}/>
</div>
<div class="mb-3">
<label class="form-label" for="prix">Prix de vente local (€/kWh)<button type="button" class="btn btn-link align-baseline p-0 ms-2" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-content="Dans Coturnix, chaque producteur choisit son prix, et Coturnix propose le moins cher au consommateur."><i class="bi bi-question-circle"></i></button></label>
<input class="form-control form-control-sm" type="number" step="0.01" min="0" id="prix" bind:value={p.prix}/>
</div>
<div class="mb-3">
<label class="form-label" for="inflationElec">Inflation nationale de l'électricité (%)</label>
<input class="form-control form-control-sm" type="number" bind:value={p.inflationElec} min="0" id="inflationElec" />
</div>
<div class="mb-3">
<label class="form-label" for="echeances">Durée d'analyse (an)</label>
<input class="form-control form-control-sm" type="number" id="echeances" min="0" bind:value={N}/>
</div>
<h2 class="mt-5">Financement</h2>
<div class="my-3">
<label class="form-label" for="apport">Apport initial (€)</label>
<input class="form-control form-control-sm" type="number" id="apport" min="0" step="1000" bind:value={p.apport}/>
</div>
<div class="mb-3">
<label class="form-label" for="interet">Taux d'intérêt(%)</label>
<input class="form-control form-control-sm" type="number" step="0.1" id="interet" min="0" bind:value={p.interet}/>
</div>
<div class="mb-3">
<label class="form-label" for="echeances">Nombre d'échéances (en mois)</label>
<input class="form-control form-control-sm" type="number" id="echeances" min="0" bind:value={p.echeances}/>
</div>
<div class="mb-3">
<label class="form-label" for="prix">Prix d'achat alloproduit (€/kWh)<button type="button" class="btn btn-link align-baseline p-0 ms-2" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-content="Ce prix dépend du contrat de fourniture d'électricité du producteur."><i class="bi bi-question-circle"></i></button></label>
<input class="form-control form-control-sm" type="number" step="0.01" min="0" id="prixAllo" bind:value={p.prixAllo}/>
</div>
<div class="mb-3">
<label class="form-label" for="prix">Prix de vente local (€/kWh)<button type="button" class="btn btn-link align-baseline p-0 ms-2" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-content="Dans Coturnix, chaque producteur choisit son prix, et Coturnix propose le moins cher au consommateur."><i class="bi bi-question-circle"></i></button></label>
<input class="form-control form-control-sm" type="number" step="0.01" min="0" id="prix" bind:value={p.prix}/>
{#if data.id}
<form method="POST" action="?/save" use:enhance={save}>
<button class="btn btn-primary">Sauvegarder</button><button class="ms-2 btn btn-outline-primary" formaction="?/del">Supprimer</button>
</form>
{:else if data.email}
<button class="btn btn-primary" on:click={saveModal}>Sauvegarder</button>
{/if}
<div class="mb-3">
<label class="form-label" for="inflationElec">Inflation nationale de l'électricité (%)</label>
<input class="form-control form-control-sm" type="number" bind:value={p.inflationElec} min="0" id="inflationElec" />
</div>
<div class="mb-3">
<label class="form-label" for="echeances">Durée d'analyse (an)</label>
<input class="form-control form-control-sm" type="number" id="echeances" min="0" bind:value={N}/>
</div>
<h2 class="mt-5">Financement</h2>
<div class="my-3">
<label class="form-label" for="apport">Apport initial (€)</label>
<input class="form-control form-control-sm" type="number" id="apport" min="0" step="1000" bind:value={p.apport}/>
</div>
<div class="mb-3">
<label class="form-label" for="interet">Taux d'intérêt(%)</label>
<input class="form-control form-control-sm" type="number" step="0.1" id="interet" min="0" bind:value={p.interet}/>
</div>
<div class="mb-3">
<label class="form-label" for="echeances">Nombre d'échéances (en mois)</label>
<input class="form-control form-control-sm" type="number" id="echeances" min="0" bind:value={p.echeances}/>
</div>
</div>
</div>
<div class="ps-lg-5 w-100 ms-0">
<ul class="mt-5 mt-lg-3 nav nav-tabs d-print-none" id="tabs" role="tablist">
{#if data.id}
<form method="POST" action="?/save" use:enhance={save}>
<button class="btn btn-primary">Sauvegarder</button><button class="ms-2 btn btn-outline-primary" formaction="?/del">Supprimer</button>
</form>
{:else if data.email}
<button class="btn btn-primary" on:click={saveModal}>Sauvegarder</button>
{/if}
</div>
</div>
</div>
<div class="ps-lg-5 w-100 ms-0">
<ul class="mt-5 mt-lg-3 nav nav-tabs d-print-none" id="tabs" role="tablist">
<li class="nav-item" role="presentation">
<a href="#synthese" class="nav-link {syntheseActive}" id="synthese-tab" type="button" role="tab" aria-controls="synthese-tab-pane" aria-selected="true">Synthèse</a>
</li>
<li class="nav-item" role="presentation">
<a href="#compte" class="nav-link {compteActive}" id="profile-tab" type="button" role="tab" aria-controls="compte-tab-pane" aria-selected="false">Détails financiers</a>
</li>
<li class="nav-item" role="presentation">
<a href="#banque" class="nav-link {banqueActive}" id="banque-tab" type="button" role="tab" aria-controls="banque-tab-pane" aria-selected="false">Emprunt</a>
</li>
{#if expert}
<a href="#expert" class="nav-link {expertActive}" id="expert-tab" type="button" role="tab" aria-controls="expert-tab-pane" aria-selected="false">Mode expert</a>
<a href="#compte" class="nav-link {compteActive}" id="profile-tab" type="button" role="tab" aria-controls="compte-tab-pane" aria-selected="false">Détails financiers</a>
<a href="#simu" class="nav-link {simuActive}" id="prm-tab" type="button" role="tab" aria-controls="prm-tab-pane" aria-selected="false">Simulation</a>
</li>
{/if}
</ul>
<div class="tab-content" id="syntheseTabContent">
<div class="tab-pane fade {syntheseActive} {syntheseShow} p-3" id="synthese-tab-pane" role="tabpanel" aria-labelledby="synthese-tab" tabindex="0">
<h3 class="my-3 fs-1 fw-bold ">En un regard, <span class="text-primary">tout</span> votre projet.</h3>
<a href="#banque" class="nav-link {banqueActive}" id="banque-tab" type="button" role="tab" aria-controls="banque-tab-pane" aria-selected="false">Emprunt</a>
</li>
{#if expert}
<li class="nav-item" role="presentation">
<a href="#expert" class="nav-link {expertActive}" id="expert-tab" type="button" role="tab" aria-controls="expert-tab-pane" aria-selected="false">Mode expert</a>
</li>
{/if}
{#if true || !data.guest}
<li class="nav-item" role="presentation">
<a href="#simu" class="nav-link {simuActive}" id="prm-tab" type="button" role="tab" aria-controls="prm-tab-pane" aria-selected="false">Simulation</a>
</li>
{/if}
<div class="my-5 py-2">
<h5 class="border-bottom border-3 border-primary text-primary fs-3"> Synthèse durée totale</h5>
<div class="row flex-row-reverse px-4 ">
<div class="d-flex justify-content-between text-primary p-5">
<div class="flex-column justify-content-between text-center ">
<div class="fs-1 fw-bold bg-cc ">54 k€</div>
<div>Chiffre d'affaire </div>
</ul>
<div class="tab-content" id="syntheseTabContent">
<div class="tab-pane fade {syntheseActive} {syntheseShow} p-3" id="synthese-tab-pane" role="tabpanel" aria-labelledby="synthese-tab" tabindex="0">
<h3 class="my-3 text-body fs-1 fw-bold ">En un regard, <span class="text-primary">tout</span> votre projet.</h3>
<div class="my-5 py-2 total">
<h5 > Synthèse durée totale {N} ans</h5>
<div class="row flex-row-reverse px-4 ">
<div class="d-flex justify-content-between p-5">
<div class="flex-column justify-content-between text-center ">
<div class="donnee"> {formateur(sum(chiffreAffaires,N))}</div>
<div>Chiffre d'affaire </div>
</div>
<div class="flex-column justify-content-between text-center ">
<div class="donnee">{formateur(sum(charges,N))}</div>
<div >Charges d'exploitation </div>
</div>
<div class="flex-column justify-content-between text-center">
<div class="donnee">{formateur(sum(resultatNet,N))}</div>
<div >Résultat net</div>
</div>
</div>
<div class="flex-column justify-content-between text-center ">
<div class="fs-1 fw-bold ">11 k€</div>
<div>Coût total </div>
<div class="row flex-row-reverse px-4 ">
<div class="d-flex justify-content-around p-5">
<div class="flex-column justify-content-between text-center ">
<div class="donnee">{rentabiliteTaux(sum(resultatNet,N),apport)}</div>
<div>retour sur investissement</div>
</div>
<div class="flex-column justify-content-between text-center">
<div class="donnee">{roiDate(resultatNet)}</div>
<div>point de rentabilité</div>
</div>
</div>
<div class="flex-column justify-content-between text-center">
<div class="fs-1 fw-bold ">+ 43 k€</div>
<div>Résultat net</div>
<div class="row flex-row-reverse px-4 ">
<div class="d-flex justify-content-around p-5">
<div class="flex-column justify-content-between text-center ">
<div class="fs-1 fw-bold bg-cc ">
<svg viewBox="0 0 300 50" xmlns="http://www.w3.org/2000/svg" width="200px">
<path d={traceArray(resultatNet,N)} fill="transparent" stroke-width="2" stroke="red" />
</svg>
</div>
<div>Résultat net </div>
</div>
<div class="flex-column justify-content-between text-center ">
<div class="fs-1 fw-bold ">
<svg viewBox="0 0 100 50" xmlns="http://www.w3.org/2000/svg" width="60px">
<path d="M 0,49 L 10,49 20,49 30,12 40,5 50,10 60,0 70,15 80,43 90,49 100,49 "
fill="transparent" stroke-width="2" stroke="red" />
</svg>
</div>
<div>Puissance moyenne quotidienne </div>
</div>
</div>
</div>
</div>
<div class="row flex-row-reverse px-4 ">
<div class="d-flex justify-content-around text-primary p-5">
<div class="flex-column justify-content-between text-center ">
<div class="fs-1 fw-bold ">14,06 %</div>
<div>taux de rentabilité</div>
<div class="row flex-row-reverse px-4 ">
<div class="d-flex justify-content-between p-5">
<div class="flex-column justify-content-between text-center ">
<div class="donnee"> {formateur(sum(resultatNet,N)/N)}</div>
<div>Bénéfice annuel moyen </div>
</div>
<div class="flex-column justify-content-between text-center ">
<div class="donnee">{formateur((coutElec() - coutElecAuto()))}</div><!-- coutelec10, sur 10 ans ? possible de le prolonger sur la durée du projet ? -->
<div>Economies consommateur </div>
</div>
<div class="flex-column justify-content-between text-center">
<div class="donnee">{economieFoyerMois} mois </div>
<div>d'éléctricité économisés par foyer</div>
</div>
</div>
</div>
<div class="row flex-row-reverse px-4 ">
<div class="d-flex justify-content-around text-primary p-5">
<div class="flex-column justify-content-between text-center ">
<div class="fs-1 fw-bold bg-cc ">
<svg viewBox="0 0 300 50" xmlns="http://www.w3.org/2000/svg" width="200px">
<path d="M 0,50 L 30,46 60,43 90,36 120,25 150,22 180,28 210,16 240,12 270,5 300,0 "
fill="transparent" stroke-width="2" stroke="red" />
</svg>
<div class="my-5 py-2 dix">
<h5> Synthèse 10 ans</h5>
<div class="row flex-row-reverse px-4 ">
<div class="d-flex justify-content-between p-5">
<div class="flex-column justify-content-between text-center ">
<div class="donnee">{formateur(sum(chiffreAffaires,10))}</div>
<div>Chiffre d'affaire </div>
</div>
<div class="flex-column justify-content-between text-center ">
<div class="donnee">{formateur(sum(charges,10))}</div>
<div>Coût total </div>
</div>
<div class="flex-column justify-content-between text-center ">
<div class="fs-1 fw-bold ">
<svg viewBox="0 0 100 50" xmlns="http://www.w3.org/2000/svg" width="60px">
<path d="M 0,49 L 10,49 20,49 30,12 40,5 50,10 60,0 70,15 80,43 90,49 100,49 "
fill="transparent" stroke-width="2" stroke="red" />
</svg>
<div class="row flex-row-reverse px-4 dix">
<div class="d-flex justify-content-around p-5">
<div class="flex-column justify-content-between text-center ">
<div class="donnee">{rembPret(10)}</div>
<div>Prêt remboursé </div>
</div>
<div class="flex-column justify-content-between text-center">
<div class="donnee">{rentabiliteTaux(sum(resultatNet,10),apport)}</div>
<div>Rentabilité</div>
</div>
</div>
<div class="row flex-row-reverse px-4 ">
<div class="d-flex justify-content-between text-primary p-5">
<div class="flex-column justify-content-between text-center ">
<div class="fs-1 fw-bold bg-cc "> 7 254 €</div>
<div>Bénéfice annuel moyen </div>
<div class="my-5 py-2 cinq">
<h5> Synthèse 5 ans</h5>
<div class="row flex-row-reverse px-4 ">
<div class="d-flex justify-content-between p-5">
<div class="flex-column justify-content-between text-center ">
<div class="donnee">{formateur(sum(chiffreAffaires,5))}</div>
<div>Chiffre d'affaire </div>
</div>
<div class="flex-column justify-content-between text-center ">
<div class="donnee">{formateur(sum(charges,5))}</div>
<div>Coût total </div>
</div>
<div class="flex-column justify-content-between text-center">
<div class="donnee">{formateur(sum(resultatNet,5))}</div>
<div>Résultat net</div>
</div>
</div>
<div class="flex-column justify-content-between text-center ">
<div class="fs-1 fw-bold ">452 €</div>
<div>Economies annuelles consommateur </div>
<div class="row flex-row-reverse px-4">
<div class="d-flex justify-content-around p-5">
<div class="flex-column justify-content-between text-center">
<div class="donnee">{rembPret(5)}</div>
<div>Prêt remboursé </div>
</div>
<div class="flex-column justify-content-between text-center">
<div class="donnee">{rentabiliteTaux(sum(resultatNet,5),apport)}</div>
<div>Rentabilité</div>
</div>
</div>
</div>
</div>
<div class="my-5 py-2">
<div class="my-5 py-2 moyenne">
<h5 > Synthèse année moyenne</h5>
<div class="row flex-row-reverse px-4 ">
<div class="d-flex justify-content-between p-5">
<div class="flex-column justify-content-between text-center ">
<div class="donnee ">{formateur(sum(resultatNet,N)/N)}</div>
<div>bénéfices moyen </div>
</div>
<h5 class=" dixans fs-3 dixansborder"> Synthèse 10 ans</h5>
<div class="row flex-row-reverse px-4 dixans">
<div class="d-flex justify-content-between p-5">
<div class="flex-column justify-content-between text-center ">
<div class="fs-1 fw-bold bg-cc ">17 k€</div>
<div>Chiffre d'affaire </div>
</div>
<div class="flex-column justify-content-between text-center ">
<div class="fs-1 fw-bold ">8,2 k€</div>
<div>Coût total </div>
</div>
<div class="flex-column justify-content-between text-center">
<div class="fs-1 fw-bold ">+ 9,8 k€</div>
<div>Résultat net</div>
<div class="flex-column justify-content-between text-center ">
<div class="donnee">{formateur(sum(chiffreAffaires,N)/N)}</div>
<div>chiffre d'affaire</div>
</div>
{#if coutElec() > 0}
<div class="flex-column justify-content-between text-center">
<div class="donnee">{((coutElec() - coutElecAuto()) * 100 / coutElec()).toFixed(0)}%</div>
<div>économies consommateur</div>
</div>{/if}
<div class="row flex-row-reverse px-4 dixans">
<div class="d-flex justify-content-around p-5">
<div class="flex-column justify-content-between text-center ">
<div class="fs-1 fw-bold bg-cc ">36 %</div>
<div>Prêt remboursé </div>
<div class="tab-pane fade {compteActive} {compteShow} p-3" id="compte-tab-pane" role="tabpanel" aria-labelledby="compte-tab" tabindex="0">
<h3 class="my-3 fs-1 fw-bold "> <span class="text-primary">Projetez-vous</span> dans votre projet.</h3>
Durée d'analyse : {N} ans
<h4 class="my-3 mt-5">Résultat</h4>
<div class="ms-3 row">
<div>
<h5 class="mt-5">Résultat net</h5>
<div class="fw-bold fs-4 ">Cumulé : <span class="text-primary"> {formateur(sum(resultatNet,N))}</span>
<div class="flex-column justify-content-between text-center">
<div class="fs-1 fw-bold ">7,02 %</div>
<div>Rentabilité</div>
<div class="ws-100 overflow-auto">
<table class="table table-striped d-inline-block">
<tbody>
<tr class="titreligne"><td>Année</td>{#each Array(N) as _, i}<td>{an + i}</td>{/each}</tr>
<tr ><td class="titreligne border-0">Résultat net</td>
{#each Array(N) as _, i}
<td class=" border-bottom-0">{resultatNet(i).toFixed(arr)}</td>
{/each}
</tr>
</tbody>
</table>
<h5 class=" text-cc fs-3 cinqansborder"> Synthèse 5 ans</h5>
<div class="row flex-row-reverse px-4 text-cc">
<div class="d-flex justify-content-between p-5">
<div class="flex-column justify-content-between text-center ">
<div class="fs-1 fw-bold bg-cc ">6 253 €</div>
<div>Chiffre d'affaire </div>
<h4 class="my-3">Détail</h4>
<div class="ms-3 row">
<div>
<h5 class="mt-5">Chiffre d'affaires</h5>
<div class="fw-bold fs-4 ">Cumulé : <span class="text-primary"> {formateur(sum(chiffreAffaires,N))}</span>
<div class="flex-column justify-content-between text-center ">
<div class="fs-1 fw-bold ">7 392 €</div>
<div>Coût total </div>
<div class="ws-100 overflow-auto">
<table class="table table-striped d-inline-block">
<tbody>
<tr class="titreligne"><td >Année</td>{#each Array(N) as _, i}<td>{an + i}</td>{/each}</tr>
<tr><td class="titreligne">Autoproduction (€)</td>
{#each Array(N) as _, i}
<td >{(productionAnnuelle(i) * (p.autoprod * tarifAllo(i) / 100)).toFixed(0)}</td>
{/each}
</tr>
<tr><td class="titreligne">Vente locale (€)</td>
{#each Array(N) as _, i}
<td>{(productionAnnuelle(i) * (autoconso * tarifLocal(i))).toFixed(0)}</td>
{/each}
</tr>
<tr><td class="titreligne">Vente de surplus (€)</td>
{#each Array(N) as _, i}
<td>{(productionAnnuelle(i) * ((1 - autoconso) * tarifSurplus(i))).toFixed(0)}</td>
{/each}
</tr>
<tr><td class="titreligne">Prime</td>
<td>{primeInvestissement}</td>
{#each Array(N-1) as _}
<td></td>
{/each}
</tr>
</tbody>
<tfoot class="table-group-divider">
<tr><td class="titreligne border-0">Chiffre d'affaires</td>
{#each Array(N) as _, i}
<td class="border-0">{chiffreAffaires(i).toFixed(arr)}</td>
{/each}
</tr>
</tfoot>
</table>
<div class="flex-column justify-content-between text-center">
<div class="fs-1 fw-bold ">- 1 139 €</div>
<div>Résultat net</div>
<h5 class="my-3">Charges d'exploitation</h5>
<div class="fw-bold fs-4 ">Cumulé : <span class="text-primary"> {formateur(sum(charges,N))}</span>
</div>
</div>
</div>
<div class="row flex-row-reverse px-4 ">
<div class="d-flex justify-content-around p-5">
<div class="flex-column justify-content-between text-center ">
<div class="fs-1 fw-bold bg-cc ">18 %</div>
<div>Prêt remboursé </div>
<div class="ws-100 overflow-auto">
<table class="table table-striped d-inline-block">
<tbody>
<tr class="titreligne"><td >Année</td>{#each Array(N) as _, i}<td>{an + i}</td>{/each}</tr>
<tr><td class="titreligne">Maintenance</td>
{#each Array(N) as _, i}
<td>{exploitation(i).toFixed(arr)}</td>
{/each}
</tr>
<tr><td class="titreligne">TURPE</td>
{#each Array(N) as _, i}
<td>{turpe(i).toFixed(arr)}</td>
{/each}
</tr>
<tr><td class="titreligne">Assurance</td>
{#each Array(N) as _, i}
<td>{assurance(i).toFixed(arr)}</td>
{/each}
</tr>
<tr><td class="titreligne">Divers</td>
{#each Array(N) as _, i}
<td>{divers(i).toFixed(arr)}</td>
{/each}
</tr>
</tbody>
<tfoot class="table-group-divider">
<tr ><td class="titreligne border-0">Total charges</td>
{#each Array(N) as _, i}
<td class="border-0">{charges(i).toFixed(arr)}</td>
{/each}
</tr>
</tfoot>
</table>
<div class="flex-column justify-content-between text-center">
<div class="fs-1 fw-bold ">-1,02 %</div>
<div>Rentabilité</div>
<h5 class="my-3">Excédent brut d'exploitation</h5>
<div class="fw-bold fs-4 ">Cumulé : <span class="text-primary"> {formateur(sum(ebe,N))}</span>
</div>
</div>
<div class="my-5 py-2">
<div class="ws-100 overflow-auto">
<table class="table table-striped d-inline-block">
<tbody>
<tr class="titreligne"><td >Année</td>{#each Array(N) as _, i}<td>{an + i}</td>{/each}</tr>
<tr><td class="titreligne">Valeur ajoutée</td>
{#each Array(N) as _, i}
<td>{valeurAjoutee(i).toFixed(arr)}</td>
{/each}
</tr>
<tr><td class="titreligne">Accise</td>
{#each Array(N) as _, i}
<td>{accise(i).toFixed(arr)}</td>
{/each}
</tr>
<tr><td class="titreligne">IFER</td>
{#each Array(N) as _, i}
<td>{ifer(i).toFixed(arr)}</td>
{/each}
</tr>
<tr><td class="titreligne">Taxe foncière</td>
{#each Array(N) as _, i}
<td>{taxeFonciere(i).toFixed(arr)}</td>
{/each}
</tr>
<tr><td class="titreligne">Cotisation foncière des entreprises</td>
{#each Array(N) as _, i}
<td>{cfe(i).toFixed(arr)}</td>
{/each}
</tr>
</tbody>
<tfoot class="table-group-divider">
<h5 class="border-bottom border-3 border-primary text-primary fs-3"> Synthèse année moyenne</h5>
<div class="row flex-row-reverse px-4 ">
<div class="d-flex justify-content-between text-primary p-5">
<div class="flex-column justify-content-between text-center ">
<div class="fs-1 fw-bold bg-cc ">14,4 k€</div>
<div>bénéfices moyen </div>
<tr ><td class="titreligne border-0">Excédent brut d'exploitation</td>
{#each Array(N) as _, i}
<td class="border-0">{ebe(i).toFixed(arr)}</td>
{/each}
</tr>
</tfoot>
</table>
<div class="flex-column justify-content-between text-center ">
<div class="fs-1 fw-bold ">18,5 k€</div>
<div>chiffre d'affaire</div>
</div>
{#if coutElec10() > 0}
<div class="flex-column justify-content-between text-center">
<div class="fs-1 fw-bold ">{((coutElec10() - coutElecAuto10()) * 100 / coutElec10()).toFixed(0)}%</div>
<div>économies consommateur</div>
</div>{/if}
</div>
</div>
</div>
<h5 class="my-3">Résultat net</h5>
<div class="ws-100 overflow-auto">
<div class="fw-bold fs-4 ">Cumulé : <span class="text-primary"> {formateur(sum(resultatNet,N))}</span>
</div>
<table class="table table-striped d-inline-block">
<tbody>
<tr class="titreligne"><td >Année</td>{#each Array(N) as _, i}<td>{an + i}</td>{/each}</tr>
<div class="ms-3 row">
<div>
<table class="table table-bordered d-inline-block">
<tbody>
<tr class="d-none d-print-table-row"><td>Puissance modules</td><td>{p.puissance}</td></tr>
<tr class="d-none d-print-table-row"><td>Taux d'autoconsommation</td><td>{p.autoconso}</td></tr>
<tr class="d-none d-print-table-row"><td>Taux d'autoproduction</td><td>{p.autoprod}</td></tr>
<tr><td>Production annuelle</td><td>{productionAnnuelle(0).toFixed(0)}kWh</td></tr>
<tr><td>Coût de la centrale</td><td>{investissement.toFixed(0)}€</td></tr>
<tr><td>Nombre de foyers</td><td>
{(productionAnnuelle(0) * p.autoconso / (p.consoMoyenneFoyer * p.autoprod)).toFixed(1)}
</td></tr>
</tbody>
</table>
</div>
</div>
<h4 class="my-3">Analyse économique</h4>
<div class="ms-3 row">
<div class="col-12 col-lg-6">
<h5 class="my-3">Financement</h5>
<table class="table table-bordered d-inline-block">
<tbody>
<tr class="d-none d-print-table-row"><td>Apport</td><td>{apport}€</td></tr>
<tr><td>Volume d'emprunt</td><td>{Math.max(0, investissement - apport).toFixed(0)}€</td></tr>
{#if investissement > apport}
<tr class="d-none d-print-table-row"><td>Taux d'intérêt</td><td>{p.interet}€</td></tr>
<tr class="d-none d-print-table-row"><td>Durée du crédit</td><td>{p.echeances} mois</td></tr>
<tr><td>Annuité</td><td>{(remboursementAnnuel[0] + interetsAnnuels[0]).toFixed(arr)}€</td></tr>
<tr><td>Capacité de remboursement (DSCR)</td><td>{dscrMoyen ? dscrMoyen.toFixed(2): ""}</td></tr>
{/if}
</tbody>
</table>
</div>
<div class="col-12 col-lg-6">
<h5 class="my-3">Revenus</h5>
<div class="ws-100 overflow-auto">
<table class="table table-bordered d-inline-block">
<tbody>
<tr class="d-none d-print-table-row"><td>Tarif de vente local</td><td>{p.prix}</td></tr>
<tr class="d-none d-print-table-row"><td>Estimation de l'inflation de l'électricité</td><td>{p.inflationElec}</td></tr>
<tr><td>Prix de vente de l'énergie moyen sur 10 ans</td><td>{(tarifLocalMoyen10).toFixed(2)}€</td></tr>
<tr><td>Chiffre d'affaires moyen sur 10 ans</td><td>{CAMoyen10.toFixed(arr)}€</td></tr>
<tr><td>Revenu annuel net moyen au-delà du prêt</td><td>{netMoyenFutur.toFixed(arr)}€</td></tr>
</tbody>
</table>
<tr ><td class="titreligne ">Impôt sur les sociétés</td>
{#each Array(N) as _, i}
<td>{is(i).toFixed(arr)}</td>
{/each}
</tr>
</tbody>
<tfoot class="table-group-divider">
<tr class="border-0"><td class="titreligne border-0">Résultat net</td>
{#each Array(N) as _, i}
<td class="border-0">{resultatNet(i).toFixed(arr)}</td>
{/each}
</tr>
</tfoot>
</table>
</div>
{#if investissement > apport }
<h5 class="my-3">Couverture de la dette</h5>
<div class="ws-100 overflow-auto">
<table class="table table-striped d-inline-block">
<tbody>
<tr class="titreligne"><td >Année</td>{#each Array(N) as _, i}<td>{an + i}</td>{/each}</tr>
<tr><td class="titreligne border-0">DSCR</td>
{#each Array(N) as _, i}
<td class="border-0">{dscr(i).toFixed(2)}</td>
{/each}
</tr>
</tbody>
</table>
</div>
{/if}
<h4 class="my-3">Intérêt financier</h4>
<div class="ms-3 row">
<div class="col-12 col-lg-6">
<h5 class="my-3">Pour le producteur</h5>
<table class="table table-bordered d-inline-block">
<tbody>
{#if apport}
<tr><td>ROE sur 30 ans (résultat net / apport)</td>
<td>{(rentabilite * 100 / 30).toFixed(0)}% par an</td></tr>
{/if}
{#if CA30}
<tr><td>ROCE</td><td>{((resultatNet30 / CA30) * 100).toFixed(0)}%</td></tr>
{/if}
</tbody>
</table>
</div>
<div class="col-12 col-lg-6">
<h5 class="my-3">Pour les consommateurs</h5>
<table class="table table-bordered d-inline-block">
<tbody>
<!-- <tr><td>Coût sur 10 ans sans autoconsommation collective</td><td>{coutElec10().toFixed(0)}€</td></tr>
<tr><td>Coût sur 10 ans avec autoconsommation collective</td><td>{coutElecAuto10().toFixed(0)}€</td></tr> -->
<tr><td>Économie réalisée</td><td>{(coutElec10() - coutElecAuto10()).toFixed(0)}€ {#if coutElec10() > 0}({((coutElec10() - coutElecAuto10()) * 100 / coutElec10()).toFixed(0)}%){/if}</td></tr>
</tbody>
</table>
</div>
<div class="tab-pane fade {banqueActive} {banqueShow} p-3" id="banque-tab-pane" role="tabpanel" aria-labelledby="banque-tab" tabindex="0">
<h3 class="my-3 fs-1 fw-bold ">Tous <span class="text-primary">les recoins</span> de votre emprunt.</h3>
<Banque dette = {dette} taux={p.interet / 100} duree={p.echeances} bind:interetsAnnuels={interetsAnnuels} bind:remboursementAnnuel={remboursementAnnuel} />
<div class="tab-pane fade {compteActive} {compteShow} p-3" id="compte-tab-pane" role="tabpanel" aria-labelledby="compte-tab" tabindex="0">
<h3 class="my-3 fs-1 fw-bold ">Tous les recoins de <span class="text-primary">votre projet</span>.</h3>
Durée d'analyse : {N} ans
<h4 class="my-3 mt-5">Résultat</h4>
<div class="ms-3 row">
<div>
<h5 class="mt-5">Résultat net</h5>
<div class="fw-bold fs-4 ">Cummulé : <span class="text-primary"> {sum(resultatNet,N)} €</span>
</div>
<div class="ws-100 overflow-auto">
<table class="table table-striped d-inline-block">
<tbody>
<tr class="titreligne"><td>Année</td>{#each Array(N) as _, i}<td>{an + i}</td>{/each}</tr>
<tr ><td class="titreligne border-0">Résultat net</td>
{#each Array(N) as _, i}
<td class=" border-bottom-0">{resultatNet(i).toFixed(arr)}</td>
{/each}
</tr>
</tbody>
</table>
</div>
</div>
</div>
<h4 class="my-3">Détail</h4>
{#if expert}
<div class="tab-pane fade {expertActive} {expertShow} py-3" id="expert-tab-pane" role="tabpanel" aria-labelledby="expert-tab" tabindex="0">
<div style="max-width:300px">
<div class="mb-3">
<label class="form-label" for="enedis">Coût de raccordement Enedis</label>
<input class="form-control form-control-sm" type="number" id="enedis" min="0" bind:value={p.enedis}/>
</div>
<div class="ms-3 row">
<div>
<h5 class="mt-5">Chiffre d'affaires</h5>
<div class="fw-bold fs-4 ">Cummulé : <span class="text-primary"> {sum(chiffreAffaires,N)} €</span>
</div>
<div class="ws-100 overflow-auto">
<table class="table table-striped d-inline-block">
<!-- <thead>
<tr>
<th></th>
<th></th>
</tr>
</thead> -->
<tbody>
<tr class="titreligne"><td >Année</td>{#each Array(N) as _, i}<td>{an + i}</td>{/each}</tr>
<div class="mb-3">
<label class="form-label" for="productible">Productible annuel (kWh/kWc)</label>
<input class="form-control form-control-sm" type="number" id="productible" min="0" bind:value={p.productible}/>
</div>
<tr><td class="titreligne">Autoproduction (€)</td>
{#each Array(N) as _, i}
<td >{(productionAnnuelle(i) * (p.autoprod * tarifAllo(i) / 100)).toFixed(0)}</td>
{/each}
</tr>
<div class="mb-3">
<label class="form-label" for="ratio">Ratio installation (€/W)</label>
<input class="form-control form-control-sm" type="number" id="ratio" min="0" bind:value={p.ratio}/>
</div>
<tr><td class="titreligne">Vente locale (€)</td>
{#each Array(N) as _, i}
<td>{(productionAnnuelle(i) * (autoconso * tarifLocal(i))).toFixed(0)}</td>
{/each}
</tr>
<tr><td class="titreligne">Vente de surplus (€)</td>
{#each Array(N) as _, i}
<td>{(productionAnnuelle(i) * ((1 - autoconso) * tarifSurplus(i))).toFixed(0)}</td>
{/each}
</tr>
<tr><td class="titreligne">Prime</td>
<td>{primeInvestissement}</td>
{#each Array(N-1) as _}
<td></td>
{/each}
</tr>
</tbody>
<tfoot class="table-group-divider">
<tr><td class="titreligne border-0">Chiffre d'affaires</td>
{#each Array(N) as _, i}
<td class="border-0">{chiffreAffaires(i).toFixed(arr)}</td>
{/each}
</tr>
</tfoot>
</table>
</div>
<h5 class="my-3">Charges d'exploitation</h5>
<div class="fw-bold fs-4 ">Cummulé : <span class="text-primary"> {sum(charges,N)} €</span>
</div>
<div class="ws-100 overflow-auto">
<table class="table table-striped d-inline-block">
<tbody>
<tr class="titreligne"><td >Année</td>{#each Array(N) as _, i}<td>{an + i}</td>{/each}</tr>
<tr><td class="titreligne">Maintenance</td>
{#each Array(N) as _, i}
<td>{exploitation(i).toFixed(arr)}</td>
{/each}
</tr>
<tr><td class="titreligne">TURPE</td>
{#each Array(N) as _, i}
<td>{turpe(i).toFixed(arr)}</td>
{/each}
</tr>
<tr><td class="titreligne">Assurance</td>
{#each Array(N) as _, i}
<td>{assurance(i).toFixed(arr)}</td>
{/each}
</tr>
<tr><td class="titreligne">Divers</td>
{#each Array(N) as _, i}
<td>{divers(i).toFixed(arr)}</td>
{/each}
</tr>
</tbody>
<tfoot class="table-group-divider">
<tr ><td class="titreligne border-0">Total charges</td>
{#each Array(N) as _, i}
<td class="border-0">{charges(i).toFixed(arr)}</td>
{/each}
</tr>
</tfoot>
</table>
</div>
<h5 class="my-3">Excédent brut d'exploitation</h5>
<div class="fw-bold fs-4 ">Cummulé : <span class="text-primary"> {sum(ebe,N)} €</span>
</div>
<div class="ws-100 overflow-auto">
<table class="table table-striped d-inline-block">
<tbody>
<tr class="titreligne"><td >Année</td>{#each Array(N) as _, i}<td>{an + i}</td>{/each}</tr>
<tr><td class="titreligne">Valeur ajoutée</td>
{#each Array(N) as _, i}
<td>{valeurAjoutee(i).toFixed(arr)}</td>
{/each}
</tr>
<tr><td class="titreligne">Accise</td>
{#each Array(N) as _, i}
<td>{accise(i).toFixed(arr)}</td>
{/each}
</tr>
<tr><td class="titreligne">IFER</td>
{#each Array(N) as _, i}
<td>{ifer(i).toFixed(arr)}</td>
{/each}
</tr>
<tr><td class="titreligne">Taxe foncière</td>
{#each Array(N) as _, i}
<td>{taxeFonciere(i).toFixed(arr)}</td>
{/each}
</tr>
<tr><td class="titreligne">Cotisation foncière des entreprises</td>
{#each Array(N) as _, i}
<td>{cfe(i).toFixed(arr)}</td>
{/each}
</tr>
</tbody>
<tfoot class="table-group-divider">
<tr ><td class="titreligne border-0">Excédent brut d'exploitation</td>
{#each Array(N) as _, i}
<td class="border-0">{ebe(i).toFixed(arr)}</td>
{/each}
</tr>
</tfoot>
</table>
</div>
<h5 class="my-3">Résultat net</h5>
<div class="ws-100 overflow-auto">
<div class="fw-bold fs-4 ">Cummulé : <span class="text-primary"> {sum(resultatNet,N)} €</span>
<div class="mb-3">
<label class="form-label" for="degradation">Taux de dégradation PV(%)</label>
<input class="form-control form-control-sm" type="number" id="degradation" min="0" bind:value={p.degradation}/>
<table class="table table-striped d-inline-block">
<tbody>
<tr class="titreligne"><td >Année</td>{#each Array(N) as _, i}<td>{an + i}</td>{/each}</tr>
<tr><td class="titreligne">Onduleurs</td>
{#each Array(N) as _, i}
<td>{provisionOnduleurs(i).toFixed(arr)}</td>
{/each}
</tr>
<tr><td class="titreligne">Amortissement</td>
{#each Array(N) as _, i}
<td>{amortissement(i).toFixed(arr)}</td>
{/each}
</tr>
{#if investissement > apport}
<tr><td class="titreligne">Intérêts dette senior</td>
{#each Array(N) as _, i}
<td>{(interetsDetteSenior(i)).toFixed(arr)}</td>
{/each}
</tr>
<tr><td class="titreligne">Intérêts DSRA</td>
{#each Array(N) as _, i}
<td>{interetsDSRA(i).toFixed(arr)}</td>
{/each}
</tr>
{/if}
<tr><td class="titreligne">Résultat fiscal</td>
{#each Array(N) as _, i}
<td>{resultatFiscal(i).toFixed(arr)}</td>
{/each}
</tr>
<tr ><td class="titreligne ">Impôt sur les sociétés</td>
{#each Array(N) as _, i}
<td>{is(i).toFixed(arr)}</td>
{/each}
</tr>
</tbody>
<tfoot class="table-group-divider">
<tr class="border-0"><td class="titreligne border-0">Résultat net</td>
{#each Array(N) as _, i}
<td class="border-0">{resultatNet(i).toFixed(arr)}</td>
{/each}
</tr>
</tfoot>
</table>
</div>
{#if investissement > apport }
<h5 class="my-3">Couverture de la dette</h5>
<div class="ws-100 overflow-auto">
<table class="table table-striped d-inline-block">
<tbody>
<tr class="titreligne"><td >Année</td>{#each Array(N) as _, i}<td>{an + i}</td>{/each}</tr>
<tr><td class="titreligne border-0">DSCR</td>
{#each Array(N) as _, i}
<td class="border-0">{dscr(i).toFixed(2)}</td>
{/each}
</tr>
</tbody>
</table>
<div class="mb-3">
<label class="form-label" for="inflation">Inflation tarif local</label>
<input class="form-control form-control-sm" type="number" id="inflation" min="0" bind:value={p.inflation}/>
</div>
</div>
<div class="tab-pane fade {banqueActive} {banqueShow} p-3" id="banque-tab-pane" role="tabpanel" aria-labelledby="banque-tab" tabindex="0">
<Banque dette = {Math.max(0, investissement - apport)} taux={p.interet / 100} duree={p.echeances} bind:interetsAnnuels={interetsAnnuels} bind:remboursementAnnuel={remboursementAnnuel} />
{/if}
{#if expert}
<div class="tab-pane fade {expertActive} {expertShow} py-3" id="expert-tab-pane" role="tabpanel" aria-labelledby="expert-tab" tabindex="0">
<div style="max-width:300px">
<div class="mb-3">
<label class="form-label" for="enedis">Coût de raccordement Enedis</label>
<input class="form-control form-control-sm" type="number" id="enedis" min="0" bind:value={p.enedis}/>
</div>
<div class="mb-3">
<label class="form-label" for="productible">Productible annuel (kWh/kWc)</label>
<input class="form-control form-control-sm" type="number" id="productible" min="0" bind:value={p.productible}/>
</div>
<div class="mb-3">
<label class="form-label" for="ratio">Ratio installation (€/W)</label>
<input class="form-control form-control-sm" type="number" id="ratio" min="0" bind:value={p.ratio}/>
</div>
<div class="mb-3">
<label class="form-label" for="degradation">Taux de dégradation PV(%)</label>
<input class="form-control form-control-sm" type="number" id="degradation" min="0" bind:value={p.degradation}/>
</div>
<div class="mb-3">
<label class="form-label" for="inflation">Inflation tarif local</label>
<input class="form-control form-control-sm" type="number" id="inflation" min="0" bind:value={p.inflation}/>
</div>
{#if true || !data.guest}
<div class="tab-content" id="simuTabContent">
<div class="tab-pane fade {simuActive} {simuShow} show p-3" id="simu-tab-pane" role="tabpanel" aria-labelledby="simu-tab" tabindex="0">
<h4 class="my-3">Simulation</h4>
<Simulation active={simuActive} bind:prms={data.prms} puissance={p.puissance}/>
{#if true || !data.guest}
<div class="tab-content" id="simuTabContent">
<div class="tab-pane fade {simuActive} {simuShow} show p-3" id="simu-tab-pane" role="tabpanel" aria-labelledby="simu-tab" tabindex="0">
<h4 class="my-3">Simulation</h4>
<Simulation active={simuActive} bind:prms={data.prms} puissance={p.puissance}/>
</div>
</div>
{/if}
<div class="modal" id="faisanSaveModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
{#if !data.guest}
<div class="modal-body">
<h5 class="modal-title pb-3" id="saveModalLabel">Sauvegarder</h5>
<form method="POST" action="?/save" use:enhance={save}>
<div class="mb-3">
<label class="form-label" for="nom">Nom du projet</label>
<input class="form-control" type="text" id="nom" name="name" bind:value={data.name} required/>
</div>
<div class="mb-3">
<label class="form-label" for="porteur">Prénom et nom du porteur du projet</label>
<input class="form-control" type="text" id="porteur" name="porteur" bind:value={data.porteur}/>
</div>
<div class="mb-3">
<label class="form-label" for="adresse">Adresse</label>
<input class="form-control" type="text" id="adresse" name="adresse" bind:value={data.adresse}/>
</div>
<div class="mb-3">
<label class="form-label" for="tel">Téléphone</label>
<input class="form-control" type="text" id="tel" name="tel" bind:value={data.tel}/>
</div>
<div class="mb-3">
<label class="form-label" for="photo">Photo</label>
<input class="form-control" type="file" id="photo" name="photo"/>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Annuler</button>
<button class="btn btn-primary">Sauvegarder</button>
</div>
{/if}
<div class="modal-content">
{#if !data.guest}
<div class="modal-body">
<h5 class="modal-title pb-3" id="saveModalLabel">Sauvegarder</h5>
<form method="POST" action="?/save" use:enhance={save}>
<div class="mb-3">
<label class="form-label" for="nom">Nom du projet</label>
<input class="form-control" type="text" id="nom" name="name" bind:value={data.name} required/>
</div>
<div class="mb-3">
<label class="form-label" for="porteur">Prénom et nom du porteur du projet</label>
<input class="form-control" type="text" id="porteur" name="porteur" bind:value={data.porteur}/>
</div>
<div class="mb-3">
<label class="form-label" for="adresse">Adresse</label>
<input class="form-control" type="text" id="adresse" name="adresse" bind:value={data.adresse}/>
</div>
<div class="mb-3">
<label class="form-label" for="tel">Téléphone</label>
<input class="form-control" type="text" id="tel" name="tel" bind:value={data.tel}/>
</div>
<div class="mb-3">
<label class="form-label" for="photo">Photo</label>
<input class="form-control" type="file" id="photo" name="photo"/>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Annuler</button>
<button class="btn btn-primary">Sauvegarder</button>
</div>
{/if}
</div>
export type CreateProjet = { CreateProjet: {
name?: string,
porteur?: string,
tel?: string,
adresse?: string,
simulation?: SimulationCommunaute,
}}
export type CreateProjet = {
CreateProjet: {
name?: string,
porteur?: string,
tel?: string,
adresse?: string,
simulation?: SimulationCommunaute,
}
}
export type SaveProjet = { SaveProjet: {
id: string,
name?: string,
porteur?: string,
tel?: string,
adresse?: string,
simulation?: SimulationCommunaute,
}}
export type SaveProjet = {
SaveProjet: {
id: string,
name?: string,
porteur?: string,
tel?: string,
adresse?: string,
simulation?: SimulationCommunaute,
}
}