565 lines
30 KiB
C#
565 lines
30 KiB
C#
using System;
|
|
using Consulenza.ReportWriter.Business;
|
|
using Consulenza.ReportWriter.Business.OBJ_PDF;
|
|
using System.Data;
|
|
using Consulenza.ReportCommon;
|
|
using Consulenza.ReportWriter.Business.CHART_PDF;
|
|
using Consulenza.ReportWriter.Business.Entity;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace Consulenza.ReportWriter.Manager.Section.Unica
|
|
{
|
|
/// <summary>
|
|
/// S49.RischioMercatoAssetClass idSezione = 92
|
|
/// </summary>
|
|
public class S49 : Entity.Section
|
|
{
|
|
|
|
private bool _presenzaNotaPatrimonioCasa = false;
|
|
private bool _presenzaNotaPatrimonioTerzi = false;
|
|
private float patrimonio1;
|
|
private float patrimonio2;
|
|
private float patrimonio3;
|
|
public S49(EnvironmentFacade environmentFacade, int idSection)
|
|
: base(environmentFacade, idSection)
|
|
{
|
|
try
|
|
{
|
|
|
|
Draw();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
SectionLogger.Write("S49", ex.Message, SectionLoggerMessageLevel.E, EnvironmentFacade.ReportEnvironment);
|
|
}
|
|
}
|
|
|
|
|
|
protected override sealed void Draw()
|
|
{
|
|
var dati = GetDataSet();
|
|
var testi = GetText();
|
|
|
|
var nota = Helper.ReplaceVariables(GetNote1(), EnvironmentFacade.ReportEnvironment);
|
|
var notaIntest = Helper.ReplaceVariables(getTesto(), EnvironmentFacade.ReportEnvironment);
|
|
float elementsHeightSumWithoutStackedPDF = 0;
|
|
|
|
if (notaIntest.Length > 0)
|
|
{
|
|
AddElement(new SpacePDF(15));
|
|
var formattedTextArea = new FormattedTextAreaPDF(notaIntest.ToString(), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify };
|
|
AddElement(formattedTextArea);
|
|
elementsHeightSumWithoutStackedPDF += 15 + formattedTextArea.GetHeight(EnvironmentFacade.ReportEnvironment.FontFamily, false);
|
|
}
|
|
|
|
|
|
// AddElement(new SpacePDF(notaIntest.Length > 0 ? 30 : 35));
|
|
AddElement(new SpacePDF(15));
|
|
elementsHeightSumWithoutStackedPDF += 15;
|
|
#region Grafico
|
|
bool pagebreak = dati.Tables["assetclass"].Rows.Count > 17;
|
|
|
|
#region grafico in una pagina sola
|
|
|
|
var graficoBarre = new StackedPDF(EnvironmentFacade.RendererFacade.XLeftLimit + 110, 1F)
|
|
{
|
|
HeightSingleBar = 25,
|
|
Width = 410,
|
|
LabelFormatAxisY = FormatType.Decimale2,
|
|
ShowLineAxisX = true,
|
|
|
|
// MaximumValueAxisY = 100,//IntervalNumberAxisY = 6,
|
|
AutoIncrementYWritable = true,
|
|
DinamicFloatXEtichettaLateraleBarra = true,
|
|
RemoveWhiteSpaceBetweenChartAndAxisX = true,
|
|
MarginAxisY = 0,
|
|
MarginAxisYFromTop = 0,
|
|
MinorGridAxisY = true
|
|
};
|
|
elementsHeightSumWithoutStackedPDF += 25; // height of axis X labels (they are not being counted in GetHeight() method)
|
|
|
|
var serieCollezione = new List<Serie> { new Serie { Name = "AssetClass" } };
|
|
|
|
|
|
foreach (DataRow item in dati.Tables["assetclass"].Rows)
|
|
{
|
|
|
|
serieCollezione[0].Points.Add(new Point
|
|
{
|
|
ShowLabelAxisY = true,
|
|
LabelAxisY = Helper.FormatDecimal(item["Percentuale"].ToString(), 2),
|
|
FontSizeLabelAxisY = 7,
|
|
FontBoldLabelAxisY = false,
|
|
VerticalAlignment = VerticalAlignmentType.Centrato,
|
|
Color = new ColorPDF(Convert.ToInt32(item["Red"]), Convert.ToInt32(item["Green"]), Convert.ToInt32(item["Blue"])),
|
|
Value = Convert.ToDouble(item["Percentuale"]) == 0 ? 0.01 : Convert.ToDouble(item["Percentuale"]),
|
|
|
|
ShowLabelAxisX = true,
|
|
LabelAxisX = item["Patrimonio"].ToString(),
|
|
FontSizeLabelAxisX = 7
|
|
});
|
|
}
|
|
graficoBarre.SeriesCollection = serieCollezione;
|
|
AddElement(graficoBarre);
|
|
|
|
for (int ii = dati.Tables["patrimonio"].Rows.Count - 1; ii >= 0; ii--)
|
|
{
|
|
DataRow r = dati.Tables["patrimonio"].Rows[ii];
|
|
graficoBarre.VerticalMarkersWithLines.Add(
|
|
new VerticalMarkerWithLine()
|
|
{
|
|
Color = r["NumeroPatrimonio"].ToString().Equals("1") ? new ColorPDF(254, 163, 0) : r["NumeroPatrimonio"].ToString().Equals("2") ? new ColorPDF(32, 114, 156) : new ColorPDF(124, 163, 73),
|
|
ImagePath = string.Format("PallinoColorato{0}.png"/*"PallinoColorato{0}d.png"*/, r["NumeroPatrimonio"].ToString()),
|
|
XValue = Convert.ToDouble(r["VaR"]),
|
|
ImageYOffset = 15
|
|
});
|
|
}
|
|
|
|
#endregion
|
|
AddElement(new SpacePDF(20));
|
|
AddElement(new FormattedTextAreaPDF("Rischio Mercato (VaR %)", EnvironmentFacade.RendererFacade.XLeftLimit + 265) { FontBold = true, FontSize = 7 });
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
//if (dati.Tables["assetclass"].Rows.Count >= 16)
|
|
//{
|
|
// if (dati.Tables["patrimonio"].Rows.Count == 1)
|
|
// AddElement(new SpacePDF(25));
|
|
// else
|
|
// {
|
|
// //AddElement(new PagePDF());
|
|
// AddElement(new SpacePDF(20));
|
|
// }
|
|
//}
|
|
//else
|
|
AddElement(new SpacePDF(15));
|
|
elementsHeightSumWithoutStackedPDF += 40;
|
|
|
|
#region Tabella patrimoni
|
|
if (dati.Tables["patrimonio"].Rows.Count > 1 && nota.Length > 0 && (getNotaRMGrado().Length > 0 || datiSeiUnico.rischioUnit().rischio.mercatiFinanziariAsset.flagfiduciariaPluriMandato))
|
|
{
|
|
AddElement(new SpacePDF(30));
|
|
elementsHeightSumWithoutStackedPDF += 30;
|
|
}
|
|
|
|
var tabella = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit + 10, dati.Tables["patrimonio"])
|
|
{
|
|
Style = Style.ConsulenzaUnica,
|
|
AlternateRow = false,
|
|
ShowSeparationLines = true,
|
|
RowHeight = 20,
|
|
Footer = false,
|
|
HeaderHeight = 20
|
|
};
|
|
elementsHeightSumWithoutStackedPDF += tabella.RowHeight * tabella.RowsCount + tabella.HeaderHeight;
|
|
|
|
#region oldcode
|
|
//bool showGradoCopertura = dati.Tables["patrimonio"].AsEnumerable().FirstOrDefault(s => s.Field<decimal>("GradoCopertura") < 100) != null ? true : false;
|
|
////bool showGradoCopertura = (from l in dati.Tables["patrimonio"].AsEnumerable() where l.Field<decimal>("GradoCopertura") < 100 select l).Count() > 0 ? true : false;
|
|
//tabella.Columns.Add(new ColumnPDF("ImmaginePatrimonio", 25, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Immagine, "ImmaginePatrimonio", string.Empty) { DeltaYContent = 4, ScaleColumnTypeImage = 0.50F });
|
|
|
|
//if (showGradoCopertura)
|
|
//{ tabella.Columns.Add(new ColumnPDF("Patrimonio", 275, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "Patrimonio", "Patrimonio") { FontSize = 7, HeaderFontSize = 7 }); }
|
|
//else { tabella.Columns.Add(new ColumnPDF("Patrimonio", 305, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "Patrimonio", "Patrimonio") { HeaderFontSize = 7, FontSize = 7 }); }
|
|
|
|
|
|
//tabella.Columns.Add(new ColumnPDF("Controvalore", 60, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Decimale, "Controvalore", "Controvalore<br>attuale (€)") { HeaderFontSize = 7, FontSize = 7, PaddingRight = 4 });
|
|
//tabella.Columns.Add(new ColumnPDF("VaR", 70, HorizontalAlignmentType.Centrato, false, false, 7, ColumnType.Testo, "VaRString", "VaR (%)") { HeaderFontSize = 7, FontSize = 7, PaddingRight = 4 });
|
|
//if (showGradoCopertura)
|
|
// tabella.Columns.Add(new ColumnPDF("GradoCopertura", 70, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Decimale, "GradoCopertura", "Grado di <br>copertura (%)") { HeaderFontSize = 7 });
|
|
#endregion oldcode
|
|
|
|
|
|
bool showGradoCopertura = dati.Tables["patrimonio"].AsEnumerable().FirstOrDefault(s => s.Field<decimal>("GradoCopertura") < 100) != null ? true : false;
|
|
//bool showGradoCopertura = (from l in dati.Tables["patrimonio"].AsEnumerable() where l.Field<decimal>("GradoCopertura") < 100 select l).Count() > 0 ? true : false;
|
|
tabella.Columns.Add(new ColumnPDF("ImmaginePatrimonio", 25, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Immagine, "ImmaginePatrimonio", string.Empty) { DeltaYContent = 4, ScaleColumnTypeImage = 0.50F });
|
|
|
|
if (showGradoCopertura)
|
|
{
|
|
tabella.Columns.Add(new ColumnPDF("Patrimonio", 275, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "Patrimonio", "Patrimonio") { FontSize = 7, HeaderFontSize = 7 });
|
|
tabella.Columns.Add(new ColumnPDF("Controvalore", 60, HorizontalAlignmentType.Centrato, false, false, 7, ColumnType.Decimale, "Controvalore", "Controvalore<br>attuale (€)") { HeaderFontSize = 7, FontSize = 7, PaddingRight = 4 });
|
|
tabella.Columns.Add(new ColumnPDF("VaR", 70, HorizontalAlignmentType.Centrato, false, false, 7, ColumnType.Testo, "VaRString", "VaR (%)") { HeaderFontSize = 7, FontSize = 7, PaddingRight = 4 });
|
|
}
|
|
else
|
|
{
|
|
tabella.Columns.Add(new ColumnPDF("Patrimonio", 325, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "Patrimonio", "Patrimonio") { HeaderFontSize = 7, FontSize = 7 });
|
|
tabella.Columns.Add(new ColumnPDF("Controvalore", 90, HorizontalAlignmentType.Centrato, false, false, 7, ColumnType.Decimale, "Controvalore", "Controvalore<br>attuale (€)") { HeaderFontSize = 7, FontSize = 7, PaddingRight = 4 });
|
|
tabella.Columns.Add(new ColumnPDF("VaR", 70, HorizontalAlignmentType.Centrato, false, false, 7, ColumnType.Testo, "VaRString", "VaR (%)") { HeaderFontSize = 7, FontSize = 7, PaddingRight = 4 });
|
|
}
|
|
|
|
if (showGradoCopertura)
|
|
tabella.Columns.Add(new ColumnPDF("GradoCopertura", 70, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Decimale, "GradoCopertura", "Grado di <br>copertura (%)") { HeaderFontSize = 7 });
|
|
|
|
|
|
|
|
|
|
|
|
int i = 0;
|
|
|
|
foreach (DataRow ro in dati.Tables["patrimonio"].Rows)
|
|
{
|
|
tabella.Cells[2, i].HorizontalAlignment =
|
|
tabella.Cells[3, i].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
|
if (showGradoCopertura)
|
|
tabella.Cells[4, i].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
|
i++;
|
|
}
|
|
|
|
if (nota.Length > 0)
|
|
{
|
|
nota = nota.Replace("(*)", "");
|
|
if (_presenzaNotaPatrimonioTerzi && !_presenzaNotaPatrimonioCasa)
|
|
{
|
|
tabella.Notes.Add(new TableNotePDF(TableNotePDF.TableNotePositionType.PièDiTabella, nota, new[] { "Patrimonio" }, "CodicePatrimonio IN ('PT','PC')", TableNotePDF.TableNoteAsteriskPositionType.CorpoTabella) { TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify, FontSize = 6 });
|
|
elementsHeightSumWithoutStackedPDF += 8 + (int)Math.Ceiling((double)nota.Length / 130) * 10; // number of rows
|
|
}
|
|
else if (_presenzaNotaPatrimonioTerzi && _presenzaNotaPatrimonioCasa)
|
|
{
|
|
tabella.Notes.Add(new TableNotePDF(TableNotePDF.TableNotePositionType.PièDiTabella, nota, new[] { "Patrimonio" }, string.Empty, TableNotePDF.TableNoteAsteriskPositionType.CorpoTabella) { TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify, FontSize = 6 });
|
|
elementsHeightSumWithoutStackedPDF += 8 + (int)Math.Ceiling((double)nota.Length / 130) * 10; // number of rows
|
|
}
|
|
else if (!_presenzaNotaPatrimonioTerzi && _presenzaNotaPatrimonioCasa)
|
|
{
|
|
tabella.Notes.Add(new TableNotePDF(TableNotePDF.TableNotePositionType.PièDiTabella, nota, new[] { "Patrimonio" }, "CodicePatrimonio IN ('BF','PC','SPI')", TableNotePDF.TableNoteAsteriskPositionType.CorpoTabella) { TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify, FontSize = 6 });
|
|
elementsHeightSumWithoutStackedPDF += 8 + (int)Math.Ceiling((double)nota.Length / 130) * 10; // number of rows
|
|
}
|
|
}
|
|
|
|
AddElement(tabella);
|
|
// tmp to show text areas
|
|
// datiSeiUnico.rischioUnit().rischio.mercatiFinanziariAsset.flagfiduciariaPluriMandato = true;
|
|
// datiSeiUnico.rischioUnit().rischio.mercatiFinanziariAsset.varInfosFideuram.stat.copertura = 45;
|
|
// tmp
|
|
|
|
if (datiSeiUnico.rischioUnit().rischio.mercatiFinanziariAsset.flagfiduciariaPluriMandato)
|
|
{
|
|
AddElement(new SpacePDF(13));
|
|
string codicemandato = datiSeiUnico.getClienteReport().codiceMandato;
|
|
string testo = "La valutazione di adeguatezza del patrimonio $/Banca/$ in termini di «Rischio Mercato (VaR)» prende in considerazione il patrimonio detenuto presso $/Banca/$ da tutti i mandati fiduciari associati al medesimo fiduciante a cui appartiene il mandato " + codicemandato + ". L'indicatore «Rischio Mercato (VaR)» del patrimonio $/Banca/$, invece, è calcolato considerando esclusivamente i prodotti detenuti dal mandato " + codicemandato + ".";
|
|
var formattedTextToAdd = new FormattedTextAreaPDF(datiSeiUnico.FormatBanca(testo), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 6, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify };
|
|
AddElement(formattedTextToAdd);
|
|
elementsHeightSumWithoutStackedPDF += 13 + formattedTextToAdd.GetHeight(EnvironmentFacade.ReportEnvironment.FontFamily, false);
|
|
}
|
|
if (getNotaRMGrado().Length > 0)
|
|
{
|
|
AddElement(new SpacePDF(13));
|
|
var tmpText = getNotaRMGrado();
|
|
var formattedTextToAdd = new FormattedTextAreaPDF(getNotaRMGrado(), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 6, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify };
|
|
AddElement(formattedTextToAdd);
|
|
elementsHeightSumWithoutStackedPDF += 13 + formattedTextToAdd.GetHeight(EnvironmentFacade.ReportEnvironment.FontFamily, false);
|
|
}
|
|
|
|
var tmpStackedPDFHeight = graficoBarre.GetHeight();
|
|
while (EnvironmentFacade.RendererFacade.YUpperLimit + elementsHeightSumWithoutStackedPDF + tmpStackedPDFHeight > EnvironmentFacade.RendererFacade.YLowerLimit)
|
|
{
|
|
graficoBarre.HeightSingleBar--;
|
|
tmpStackedPDFHeight = graficoBarre.GetHeight();
|
|
}
|
|
#endregion
|
|
|
|
|
|
if (graficoBarre.HeightSingleBar >= 24)
|
|
graficoBarre.HeightSingleBar = 23;
|
|
|
|
}
|
|
public virtual string getNotaRMGrado() //40.5 copertura rischio mercato var e rischio credito
|
|
{
|
|
var gradoCoperturaRM = Convert.ToDecimal(datiSeiUnico.rischioUnit().rischio.mercatiFinanziariAsset.varInfosFideuram.stat.copertura);
|
|
string nota = "";
|
|
|
|
if (gradoCoperturaRM < 90)
|
|
{
|
|
nota += "Il patrimonio che lei detiene presso $/Banca/$ risulta non adeguato al suo profilo finanziario in quanto alcuni prodotti non sono coperti in termini di Rischio Mercato (VaR), determinando un grado di copertura inferiore a 90%: in questo caso, a prescindere dai singoli indicatori di rischio, il patrimonio $/Banca/$ viene considerato sempre come non adeguato.";
|
|
|
|
|
|
}
|
|
return datiSeiUnico.FormatBanca(nota);
|
|
}
|
|
protected sealed override DataTable GetDataTable()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
protected sealed override DataSet GetDataSet()
|
|
{
|
|
var ds = new DataSet();
|
|
ds.Tables.Add(new DataTable("patrimonio"));
|
|
ds.Tables.Add(new DataTable("assetclass"));
|
|
|
|
bool altriIstituti = GetOption<Opzione4>().Valore;
|
|
|
|
var mercatiFinanziariAsset = datiSeiUnico.rischioUnit().rischio.mercatiFinanziariAsset;// new DataServices.Rischio(EnvironmentFacade.ReportEnvironment.Cliente.Chiave).GetRischio().mercatiFinanziariAsset;
|
|
var assetDisplayInfos = datiSeiUnico.displayInfos().assetDisplayInfos;// new DataServices.DisplayInfo(EnvironmentFacade.ReportEnvironment.Cliente.Chiave).GetDisplayInfo().assetDisplayInfos;
|
|
|
|
#region Patrimonio
|
|
|
|
ds.Tables["patrimonio"].Columns.Add(new DataColumn("Patrimonio", typeof(string)));
|
|
ds.Tables["patrimonio"].Columns.Add(new DataColumn("NumeroPatrimonio", typeof(string)));
|
|
ds.Tables["patrimonio"].Columns.Add(new DataColumn("CodicePatrimonio", typeof(string)));
|
|
ds.Tables["patrimonio"].Columns.Add(new DataColumn("ImmaginePatrimonio", typeof(string)));
|
|
ds.Tables["patrimonio"].Columns.Add(new DataColumn("Controvalore", typeof(decimal)));
|
|
ds.Tables["patrimonio"].Columns.Add(new DataColumn("VaR", typeof(decimal)));
|
|
ds.Tables["patrimonio"].Columns.Add(new DataColumn("VaRString", typeof(string)));
|
|
ds.Tables["patrimonio"].Columns.Add(new DataColumn("GradoCopertura", typeof(decimal)));
|
|
string banca = Helper.ReplaceVariables("$/Banca/$", EnvironmentFacade.ReportEnvironment);
|
|
ds.Tables["patrimonio"].Rows.Add(
|
|
string.Format("Patrimonio {0}", Helper.ReplaceVariables("$/Banca/$", EnvironmentFacade.ReportEnvironment)),
|
|
1,
|
|
banca == "Fideuram" ? "BF" : "SPI",
|
|
"PallinoColorato1.png",
|
|
mercatiFinanziariAsset.totaliFideuram.risorseFinanziarie + mercatiFinanziariAsset.totaliFideuram.partiteViaggianti,
|
|
mercatiFinanziariAsset.varComplessivoFideuram,
|
|
mercatiFinanziariAsset.varComplessivoFideuramDecod,
|
|
mercatiFinanziariAsset.varInfosFideuram.stat.copertura
|
|
);
|
|
patrimonio1 = (float)Convert.ToDouble(mercatiFinanziariAsset.varComplessivoFideuramDecod);
|
|
|
|
|
|
if (altriIstituti && mercatiFinanziariAsset.varComplessivoAltriIstituti != 0)
|
|
{
|
|
ds.Tables["patrimonio"].Rows.Add(
|
|
"Patrimonio altri Istituti",
|
|
2,
|
|
"PT",
|
|
"PallinoColorato2.png",
|
|
mercatiFinanziariAsset.totaliAltriIstituti.risorseFinanziarie,
|
|
mercatiFinanziariAsset.varComplessivoAltriIstituti,
|
|
mercatiFinanziariAsset.varComplessivoAltriIstitutiDecod,
|
|
mercatiFinanziariAsset.varInfosAltriIstituti.stat.copertura
|
|
);
|
|
patrimonio2 = (float)Convert.ToDouble(mercatiFinanziariAsset.varComplessivoAltriIstitutiDecod);
|
|
|
|
ds.Tables["patrimonio"].Rows.Add(
|
|
"Patrimonio finanziario complessivo",
|
|
3,
|
|
"PC",
|
|
"PallinoColorato3.png",
|
|
mercatiFinanziariAsset.totaliFideuram.risorseFinanziarie + mercatiFinanziariAsset.totaliFideuram.partiteViaggianti + mercatiFinanziariAsset.totaliAltriIstituti.risorseFinanziarie,
|
|
mercatiFinanziariAsset.varComplessivo,
|
|
mercatiFinanziariAsset.varComplessivoDecod,
|
|
mercatiFinanziariAsset.varInfosComplessivo.stat.copertura
|
|
);
|
|
patrimonio3 = (float)Convert.ToDouble(mercatiFinanziariAsset.varComplessivoDecod);
|
|
}
|
|
#endregion
|
|
|
|
#region Asset
|
|
|
|
ds.Tables["assetclass"].Columns.Add(new DataColumn("Patrimonio", typeof(string)));
|
|
ds.Tables["assetclass"].Columns.Add(new DataColumn("Red", typeof(int)));
|
|
ds.Tables["assetclass"].Columns.Add(new DataColumn("Green", typeof(int)));
|
|
ds.Tables["assetclass"].Columns.Add(new DataColumn("Blue", typeof(int)));
|
|
ds.Tables["assetclass"].Columns.Add(new DataColumn("Percentuale", typeof(decimal)));
|
|
|
|
foreach (var item in from c in assetDisplayInfos
|
|
join l in mercatiFinanziariAsset.listaAssetClass on c.key equals l.id
|
|
orderby c.value.order
|
|
select new
|
|
{
|
|
l.descrizione,
|
|
l.var,
|
|
new ColorPDF(c.value.fill).Red,
|
|
new ColorPDF(c.value.fill).Green,
|
|
new ColorPDF(c.value.fill).Blue
|
|
})
|
|
{
|
|
ds.Tables["assetclass"].Rows.Add(
|
|
item.descrizione,
|
|
item.Red,
|
|
item.Green,
|
|
item.Blue,
|
|
item.var
|
|
);
|
|
|
|
}
|
|
#endregion
|
|
|
|
return ds;
|
|
}
|
|
|
|
public virtual bool _visualizzaAltriIstituti()
|
|
{
|
|
return GetOption<Opzione4>().Valore;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Recupera il testo introduttivo
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public virtual string getTesto()
|
|
{
|
|
string testo = "";
|
|
if (EnvironmentFacade.ReportEnvironment.ReportId == 6)//nuclei
|
|
{
|
|
testo = "In questa scheda il livello di Rischio Mercato (VaR) del patrimonio associato al nucleo che i componenti detengono presso $/Banca/$";
|
|
if (_visualizzaAltriIstituti())
|
|
testo += ", del patrimonio associato al nucleo che i componenti detengono presso altri Istituti e del patrimonio finanziario complessivo associato al nucleo,";
|
|
|
|
testo += " è confrontato con il livello di Rischio Mercato (VaR) dei principali mercati finanziari (asset class) azionari, obbligazionari e monetari.";
|
|
|
|
}
|
|
else
|
|
{
|
|
testo = "In questa scheda il livello di Rischio Mercato (VaR) del patrimonio che lei detiene presso $/Banca/$";
|
|
if (_visualizzaAltriIstituti())
|
|
testo += ", del patrimonio che lei detiene presso altri Istituti e del suo patrimonio finanziario complessivo,";
|
|
|
|
testo += " è confrontato con il livello di Rischio Mercato (VaR) dei principali mercati finanziari (asset class) azionari, obbligazionari e monetari.";
|
|
}
|
|
return testo;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Recupera la nota dinamica
|
|
/// </summary>
|
|
/// <param name="nota"></param>
|
|
/// <returns></returns>
|
|
public virtual string GetNote1()
|
|
{
|
|
|
|
string nota = "";
|
|
string token = "";
|
|
|
|
var patrimonioCasa = datiSeiUnico.pianificazioneUnit().pianificazioneVerticale;
|
|
var patrimonioTerzi = datiSeiUnico.patrimonioUnit().patrimonioTerzi;
|
|
|
|
|
|
decimal CCN_CASA = patrimonioCasa.contoCorrenteNegativo; //cc negativi del patrimonio casa
|
|
decimal CCN_TERZI = patrimonioTerzi.patrimonioTerziBean.contoCorrentiNegativi;
|
|
_presenzaNotaPatrimonioTerzi = CCN_TERZI != 0;
|
|
|
|
var dataMacroAsset = datiSeiUnico.patrimonioUnit().patrimonioCasa.macroAssetClass;
|
|
decimal GPELIGOFONDI_CASA = patrimonioCasa.liqEligoFondiNeg; // liquidità sottostante la GP Eligo Fondi del patrimonio casa
|
|
decimal GPELIGTITOLI_CASA = patrimonioCasa.liqEligoTitoliNeg; //liquidità sottostante la GP Eligo Titoli del patrimonio casa
|
|
// 20181009 AC
|
|
decimal TUOFOGLIO_CASA = patrimonioCasa.liqFogliNeg; //liquidità sottostante Il Mio Foglio del patrimonio casa
|
|
//--20181009
|
|
|
|
// 20181009
|
|
//_presenzaNotaPatrimonioCasa = CCN_CASA != 0 || GPELIGOFONDI_CASA != 0 || GPELIGTITOLI_CASA != 0;
|
|
_presenzaNotaPatrimonioCasa = CCN_CASA != 0 || GPELIGOFONDI_CASA != 0 || GPELIGTITOLI_CASA != 0 || TUOFOGLIO_CASA != 0;
|
|
//--20181009
|
|
|
|
|
|
decimal GC = 100;// (presenzaContocorrenteInMonterio() ? dataMacroAsset.distribuzione.coverageCC : dataMacroAsset.distribuzione.coverage) * 100; ;//(presenzaContocorrenteInMonterio() ? patrimonioFinanziario.distribuzione.coverageCC : patrimonioFinanziario.distribuzione.coverage) * 100; // grado di copertura della distribuzione
|
|
decimal OC_CASA = 0;//patrimonioCasa.totaliPatrimonio.partiteViaggianti; //Operazioni in corso del patrimonio casa
|
|
decimal CC_CASA = 0;// patrimonioCasa.totaliPatrimonio.contoCorrentePositivo; //cc positivo del patrimonio casa
|
|
decimal CC_TERZI = 0;// patrimonioTerzi.totaliPatrimonio.contoCorrentePositivo; //cc positivo del patrimonio terzi
|
|
decimal PNR_CASA = 0; //Patrimonio non rappresentabile per macroassetclass del patrimonio casa
|
|
decimal PNR_TERZI = 0;
|
|
|
|
// 20181009 AC
|
|
//if (CCN_CASA != 0 || GPELIGOFONDI_CASA != 0 || GPELIGTITOLI_CASA != 0)
|
|
if (CCN_CASA != 0 || GPELIGOFONDI_CASA != 0 || GPELIGTITOLI_CASA != 0 || TUOFOGLIO_CASA != 0)
|
|
//--20181009 AC
|
|
{
|
|
nota += token + "Il controvalore ";
|
|
token = " ";
|
|
|
|
if (CCN_CASA != 0 || GPELIGOFONDI_CASA != 0 || GPELIGTITOLI_CASA != 0 || TUOFOGLIO_CASA != 0)
|
|
{
|
|
nota += token + "del patrimonio $/Banca/$";
|
|
token = " ";
|
|
}
|
|
|
|
nota += token + "esclude il saldo negativo";
|
|
token = " ";
|
|
|
|
if (CCN_CASA != 0)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("dei conti correnti ({0} €)", CCN_CASA);
|
|
token = ", ";
|
|
}
|
|
// 20181009 AC
|
|
if (TUOFOGLIO_CASA != 0)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("della liquidità sottostante Il Mio Foglio ({0} €)", TUOFOGLIO_CASA);
|
|
token = ", ";
|
|
}
|
|
//--20181009 AC
|
|
if (GPELIGOFONDI_CASA != 0)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("della liquidità sottostante la GP Eligo Fondi ({0} €)", GPELIGOFONDI_CASA);
|
|
token = ", ";
|
|
}
|
|
if (GPELIGTITOLI_CASA != 0)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("della liquidità sottostante la GP Eligo Titoli ({0} €)", GPELIGTITOLI_CASA);
|
|
//token = ", ";
|
|
}
|
|
token = ". ";
|
|
//if (CCN_TERZI != 0)
|
|
//{
|
|
// if (_visualizzaAltriIstituti())
|
|
// {
|
|
// nota += token + datiSeiUnico.FormatDecimal("dei conti correnti ({0} €) del patrimonio Altri Istituti", CCN_TERZI);
|
|
// ;
|
|
// }
|
|
//}
|
|
}
|
|
if (CCN_TERZI != 0)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("Il controvalore del patrimonio altri Istituti esclude il saldo negativo dei conti correnti ({0} €)", CCN_TERZI);
|
|
token = ". ";
|
|
}
|
|
|
|
if (GC < 100)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("Grado di copertura (%) della rappresentazione grafica per macro asset class pari a {0}", GC);
|
|
token = ": ";
|
|
if (PNR_CASA != 0 || CC_CASA != 0 || OC_CASA != 0 || PNR_TERZI != 0 || CC_TERZI != 0)
|
|
{
|
|
nota += token + "non sono considerati";
|
|
token = " ";
|
|
if (PNR_CASA != 0 || CC_CASA != 0 || OC_CASA != 0)
|
|
{
|
|
if (PNR_CASA != 0)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("i prodotti non rappresentabili ({0} €)", PNR_CASA);
|
|
token = ", ";
|
|
}
|
|
if (CC_CASA != 0)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("i conti correnti ({0} €)", CC_CASA);
|
|
token = ", ";
|
|
}
|
|
if (OC_CASA != 0)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("gli importi relativi alle operazioni in corso ({0} €)", OC_CASA);
|
|
token = ", ";
|
|
}
|
|
token = " ";
|
|
nota += token + "del patrimonio $/Banca/$";
|
|
token = ", ";
|
|
}
|
|
if (PNR_TERZI != 0 || CC_TERZI != 0)
|
|
{
|
|
if (PNR_TERZI != 0)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("i prodotti non rappresentabili ({0} €)", PNR_TERZI);
|
|
token = ", ";
|
|
}
|
|
if (CC_TERZI != 0)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("i conti correnti ({0} €)", CC_TERZI);
|
|
token = ", ";
|
|
}
|
|
token = " ";
|
|
nota += token + "del patrimonio Altri Istituti";
|
|
token = ", ";
|
|
}
|
|
}
|
|
}
|
|
nota += ".";
|
|
|
|
// nota = !nota.Equals("") ? "(*) " + nota : nota;
|
|
return Helper.ReplaceVariables(nota, EnvironmentFacade.ReportEnvironment);
|
|
|
|
}
|
|
|
|
}
|
|
}
|