@model IEnumerable @{ ViewBag.Title = "DetailsExeciceComptable"; string dateExercice = DateTime.Today.Year.ToString(); } @if (ViewBag.annneExecrcice != "") { dateExercice = ViewBag.annneExecrcice; }
@{ int montantPOST = 0; int montantSOUS = 0; int resutat = 0; int charge = 0; int Produit = 0; int Autres = 0; int exploitation = 0; int nonExploitation = 0; } @foreach (var item in Model) { { montantSOUS = 0; } foreach (var item01 in item.SOUSPOSTE.ToList()) { } }
POSTES @dateExercice
@Html.DisplayFor(modelItem => item.libellePost)
@item01.libelleSousPost @{ int montant = Convert.ToInt32(item01.DETAILCOMPTE.Where(d => d.PERIODE.EXERCICECOMPTABLE.libelleExercice == dateExercice).Sum(d => d.montant)); montantSOUS = montantSOUS + montant; } @Convert.ToInt32(montant).ToString("n0")
TOTAL @Html.DisplayFor(modelItem => item.libellePost) @montantSOUS @if (item.idTypePoste == 1) { Produit = Produit + montantSOUS; } else if (item.idTypePoste == 2) { charge = charge + montantSOUS; if (item.idRole == 1) { exploitation = exploitation + montantSOUS; } else if (item.idRole == 2) { nonExploitation = nonExploitation + montantSOUS; } } else { Autres = Autres + montantSOUS; }
TOTAL Charge d'exploitation @Convert.ToInt32(exploitation).ToString("n0")
TOTAL Autres Charge @Convert.ToInt32(nonExploitation).ToString("n0")
TOTAL CHARGE @Convert.ToInt32(charge).ToString("n0")
TOTAL PRODUIT @Convert.ToInt32(Produit).ToString("n0")
RESULTAT NET COMPTABLE @{resutat = Produit - charge; } @Convert.ToInt32(resutat).ToString("n0")
Pourcentage par rapport aux recettes @{double pourcentage = 0; if (Produit > 0) { pourcentage = (resutat / Produit); } } @Convert.ToDouble(pourcentage * 0.01).ToString("n2")