570 lines
32 KiB
C#
570 lines
32 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 Consulenza.ReportWriter.Business.CUSTOM_PDF.ConsulenzaUnica;
|
|
using System.Linq;
|
|
|
|
namespace Consulenza.ReportWriter.Manager.Section.Unica
|
|
{
|
|
public class S58 : Entity.Section
|
|
{
|
|
/// <summary>
|
|
///S58.PropostaRappresentazioneAssetClass idSezione = 101
|
|
/// </summary>
|
|
public S58(EnvironmentFacade environmentFacade, int idSection)
|
|
: base(environmentFacade, idSection)
|
|
{
|
|
try
|
|
{
|
|
Draw();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
SectionLogger.Write("S58", ex.Message, SectionLoggerMessageLevel.E, EnvironmentFacade.ReportEnvironment);
|
|
}
|
|
}
|
|
|
|
protected override sealed void Draw()
|
|
{
|
|
var dati = GetDataSet();
|
|
string signValue = isControvalore() ? "(€)" : "(%)";
|
|
bool isAdeguata = datiSeiUnico.flagAdeguatezzaPro();
|
|
|
|
AddElement(new PagePDF(PagePDF.PagePDFType.Generic));
|
|
var intestazione = new SectionHeadingPDF(
|
|
(isAdeguata ? "Proposta" : "Operazioni richieste") + ": rappresentazione per asset class Pino",
|
|
|
|
EnvironmentFacade.RendererFacade.XLeftLimit,
|
|
EnvironmentFacade.RendererFacade.YUpperLimit,
|
|
EnvironmentFacade.ReportEnvironment.FontFamily);
|
|
|
|
AddElement(intestazione.ToElement());
|
|
|
|
#region Sintesi portafoglio
|
|
if (dati.Tables["AssetClass"].Rows.Count > 0)
|
|
{
|
|
if (getTesto1().Length > 0)
|
|
{
|
|
AddElement(new SpacePDF(20));
|
|
AddElement(new FormattedTextAreaPDF(getTesto1(), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize=7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
AddElement(new SpacePDF(25));
|
|
}
|
|
|
|
FormattedTextAreaPDF captionAttuale = new FormattedTextAreaPDF("Controvalore attuale (€)", EnvironmentFacade.RendererFacade.XLeftLimit, 130) {FontSize=7, BackGroundMarginLeft = 5, BackGroundColor = ColorPDF.Standard_Grigio_SfondoColonnaTabella, FontColor = ColorPDF.Nero, FontBold = true, AutoIncrementYWritable = false };
|
|
AddElement(captionAttuale);
|
|
FormattedTextAreaPDF ctvAttuale = new FormattedTextAreaPDF(Helper.FormatCurrency(dati.Tables["labelControvalore"].Rows[0]["ctvAttuale"].ToString()), EnvironmentFacade.RendererFacade.XLeftLimit + 145) { FontSize = 7, BackGroundColor = ColorPDF.Bianco, AutoIncrementYWritable = false };
|
|
AddElement(ctvAttuale);
|
|
FormattedTextAreaPDF captionProposto = new FormattedTextAreaPDF("Controvalore "+ ( isAdeguata ? "proposto (€)" : "prospettico (€)"), EnvironmentFacade.RendererFacade.XLeftLimit + 280, 140) { FontSize = 7, BackGroundMarginLeft = 5, BackGroundColor = ColorPDF.Standard_Grigio_SfondoColonnaTabella, FontColor = ColorPDF.Nero, FontBold = true, AutoIncrementYWritable = false };
|
|
AddElement(captionProposto);
|
|
FormattedTextAreaPDF ctvProposto = new FormattedTextAreaPDF(Helper.FormatCurrency(dati.Tables["labelControvalore"].Rows[0]["ctvProposto"].ToString()), EnvironmentFacade.RendererFacade.XLeftLimit + 435) { FontSize = 7, BackGroundColor = ColorPDF.Bianco, AutoIncrementYWritable = true };
|
|
AddElement(ctvProposto);
|
|
|
|
AddElement(new SpacePDF(20));
|
|
|
|
|
|
//AddElement(new FormattedTextAreaPDF("Asset class", EnvironmentFacade.RendererFacade.XLeftLimit, 135) { BackGroundColor = ColorPDF.Standard_Grigio_SfondoColonnaTabella, FontBold = true, FontSize = 7, FontColor = ColorPDF.ConsulenzaUnica_Rosso, AutoIncrementYWritable = false, BackGroundMarginLeft = 5 });
|
|
//AddElement(new FormattedTextAreaPDF("Portafoglio attuale " + signValue, EnvironmentFacade.RendererFacade.XLeftLimit + 140, 190) { BackGroundColor = ColorPDF.Standard_Grigio_SfondoColonnaTabella, FontBold = true, FontSize = 7, FontColor = ColorPDF.ConsulenzaUnica_Rosso, AutoIncrementYWritable = false, BackGroundMarginLeft = 5 });
|
|
//AddElement(new FormattedTextAreaPDF("Portafoglio proposto " + signValue, EnvironmentFacade.RendererFacade.XLeftLimit + 340, 190) { BackGroundColor = ColorPDF.Standard_Grigio_SfondoColonnaTabella, FontBold = true, FontSize = 7, FontColor = ColorPDF.ConsulenzaUnica_Rosso, BackGroundMarginLeft = 5 }); //340 = + 145 + 195
|
|
|
|
#region ASSET ASSET
|
|
|
|
var tabellaAsset = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dati.Tables["AssetClass"])
|
|
{
|
|
Style = Style.ConsulenzaUnica,
|
|
Header = true,
|
|
Footer = false,
|
|
AlternateRow = false,
|
|
RowHeight = 25,
|
|
ShowSeparationLines = false,
|
|
PageBreak = true,
|
|
HeaderTextHorizontalAlign = HorizontalAlignmentType.Sinistra,
|
|
ShowBorderHeader = true
|
|
|
|
};
|
|
// tabellaAsset.Columns.Add(new ColumnPDF("oggetto", 17, HorizontalAlignmentType.Destra, false, false, 7, ColumnType.Objectpdf, "", string.Empty) { PaddingLeft = 3, DeltaYContent = 7 });
|
|
tabellaAsset.Columns.Add(new ColumnPDF("descrizione", 150, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "Descrizione", "Asset class") { HeaderFontSize = 7, FontSize = 7 });
|
|
tabellaAsset.Columns.Add(new ColumnPDF("portafoglioattuale", 185, HorizontalAlignmentType.Destra, false, false, 7, ColumnType.Objectpdf, "ValoreAttuale", "Portafoglio attuale " + signValue) {HeaderPaddingRight=80, PaddingRight=20, HeaderFontSize = 7, DeltaYContent = 2, FontSize = 7 });
|
|
tabellaAsset.Columns.Add(new ColumnPDF("portafoglioproposto", 185, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Objectpdf, "ValoreProposto", "Portafoglio " + (isAdeguata ? "proposto " : "prospettico ") + signValue) { HeaderFontSize = 7,HeaderPaddingLeft=10, PaddingLeft=3.5f, DeltaYContent = 2, FontSize = 7 });
|
|
|
|
|
|
int o = 0;
|
|
var list = new List<double>();
|
|
list.Add(Convert.ToDouble(dati.Tables["AssetClass"].AsEnumerable().Max(x => x["ValoreAttuale"])));
|
|
list.Add(Convert.ToDouble(dati.Tables["AssetClass"].AsEnumerable().Max(x => x["ValoreProposto"])));
|
|
var max = (float)Helper.Round(list.Max());
|
|
float larghezzaBarra = 0;
|
|
float deltaXBarra = 0;
|
|
var width = 0;
|
|
foreach (DataRow row in dati.Tables["AssetClass"].Rows)
|
|
{
|
|
var colore = new ColorPDF(Convert.ToInt32(row["Red"]), Convert.ToInt32(row["Green"]), Convert.ToInt32(row["Blue"]));
|
|
|
|
int indexportafoglioattuale = 1;
|
|
int indexportafoglioproposto = 2;
|
|
width = tabellaAsset.Columns[indexportafoglioattuale].Width - (isControvalore() ? 50 : 20);
|
|
//tabellaAsset.Cells[indexOggetto, o].ValueObject = new CirclePDF(13, 13, colore);
|
|
|
|
#region barra colonna attuale
|
|
larghezzaBarra = Helper.GetWidthProportional(Convert.ToDouble(row["ValoreAttuale"]) == 0 ? (float)0.01 : (float)Convert.ToDouble(row["ValoreAttuale"]), max, width);
|
|
/**************************** Modifica aladdin 17062021 - Andrea *************************************************************************/
|
|
//deltaXBarra = Convert.ToDouble(row["ValoreAttuale"]) == 0 ? -larghezzaBarra + 10 : -larghezzaBarra + (isControvalore() ? 0 : 7);
|
|
deltaXBarra = Convert.ToDouble(row["ValoreAttuale"]) == 0 ? larghezzaBarra + 5 : larghezzaBarra + (isControvalore() ? 0 : 7);
|
|
/**************************************************************************************************************************************/
|
|
|
|
//deltaXBarra = -larghezzaBarra + (isControvalore() ? 0 : 7);
|
|
|
|
/**************************** Modifica aladdin 17062021 - Andrea *************************************************************************/
|
|
tabellaAsset.Columns[1].HorizontalAlignment = HorizontalAlignmentType.Sinistra;
|
|
/**************************************************************************************************************************************/
|
|
|
|
if (Convert.ToDouble(row["ValoreAttuale"]) == 0)
|
|
{
|
|
tabellaAsset.Cells[indexportafoglioattuale, o].ValueObjectList = new List<Business.Entity.ObjectPDF>()
|
|
{
|
|
new FormattedTextAreaPDF(isControvalore() ? Helper.FormatCurrency(row["ValoreAttuale"].ToString()) : Helper.FormatDecimal(row["ValoreAttuale"].ToString(), 2), deltaXBarra-10, isControvalore()? 50 : 35)
|
|
{
|
|
DeltaY = 3,
|
|
/**************************** Modifica aladdin 17062021 - Andrea *************************************************************************/
|
|
//TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Left,
|
|
TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Right,
|
|
/*****************************************************************************************************************************************/
|
|
DeltaX =isControvalore()? deltaXBarra+20 : deltaXBarra,
|
|
FontSize = 7
|
|
},
|
|
new RectanglePDF(12, 1 , ColorPDF.Bianco){DeltaY = 3}
|
|
};
|
|
}
|
|
else{
|
|
|
|
tabellaAsset.Cells[indexportafoglioattuale, o].ValueObjectList = new List<Business.Entity.ObjectPDF>()
|
|
{
|
|
|
|
new FormattedTextAreaPDF(isControvalore() ? Helper.FormatCurrency(row["ValoreAttuale"].ToString()) : Helper.FormatDecimal(row["ValoreAttuale"].ToString(), 2),deltaXBarra, isControvalore()? 50 : 35)
|
|
{
|
|
DeltaY = 3,
|
|
/**************************** Modifica aladdin 17062021 - Andrea *************************************************************************/
|
|
//TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Left,
|
|
TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Right,
|
|
/*****************************************************************************************************************************************/
|
|
DeltaX = deltaXBarra,
|
|
FontSize = 7
|
|
},
|
|
new RectanglePDF(12, larghezzaBarra , colore){DeltaY = 5}
|
|
};
|
|
}
|
|
#endregion
|
|
|
|
#region barra colonna proposto
|
|
width = tabellaAsset.Columns[indexportafoglioproposto].Width - (isControvalore() ? 50 : 20);
|
|
larghezzaBarra = Helper.GetWidthProportional(Convert.ToDouble(row["ValoreProposto"]) == 0 ? (float)0.01 : (float)Convert.ToDouble(row["ValoreProposto"]), max, width);
|
|
deltaXBarra = Convert.ToDouble(row["ValoreProposto"]) == 0 ? isControvalore() ? larghezzaBarra - 20 : larghezzaBarra - 10 : isControvalore() ? larghezzaBarra + 3 : larghezzaBarra - 5;
|
|
// deltaXBarra = isControvalore() ? larghezzaBarra : larghezzaBarra - 5;
|
|
if (Convert.ToDouble(row["ValoreProposto"]) == 0)
|
|
{
|
|
tabellaAsset.Cells[indexportafoglioproposto, o].ValueObjectList = new List<Business.Entity.ObjectPDF>()
|
|
{
|
|
|
|
new RectanglePDF(12, 1 , ColorPDF.Bianco){DeltaY = 3},
|
|
new FormattedTextAreaPDF(isControvalore() ? Helper.FormatCurrency(row["ValoreProposto"].ToString()) :Helper.FormatDecimal(row["ValoreProposto"].ToString(), 2), deltaXBarra-10, isControvalore()? 50 : 35)
|
|
{
|
|
DeltaY = 3,
|
|
TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Right,
|
|
DeltaX = deltaXBarra-10,
|
|
FontSize = 7
|
|
}
|
|
};
|
|
}
|
|
else
|
|
{
|
|
tabellaAsset.Cells[indexportafoglioproposto, o].ValueObjectList = new List<Business.Entity.ObjectPDF>()
|
|
{
|
|
new RectanglePDF(12, larghezzaBarra , colore){DeltaY = 5},
|
|
new FormattedTextAreaPDF(isControvalore() ? Helper.FormatCurrency(row["ValoreProposto"].ToString()) :Helper.FormatDecimal(row["ValoreProposto"].ToString(), 2),deltaXBarra, isControvalore()? 50 : 35)
|
|
{
|
|
DeltaY = 3,
|
|
TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Right,
|
|
DeltaX = deltaXBarra,
|
|
FontSize = 7
|
|
}
|
|
};
|
|
}
|
|
#endregion
|
|
o++;
|
|
}
|
|
AddElement(tabellaAsset);
|
|
|
|
AddElement(new SpacePDF(10));
|
|
|
|
string note = "*";
|
|
if (GetNota1().Length > 0)
|
|
{
|
|
tabellaAsset.Notes.Add(
|
|
new TableNotePDF(TableNotePDF.TableNotePositionType.PièDiTabella,
|
|
GetNota1(),
|
|
new[] { "" },
|
|
string.Empty,
|
|
TableNotePDF.TableNoteAsteriskPositionType.CorpoTabella) { FontSize = 6, TextHorizontalAlign= ceTe.DynamicPDF.TextAlign.Justify }
|
|
);
|
|
captionAttuale.Text += note;
|
|
note += "*";
|
|
}
|
|
|
|
if (GetNota2().Length > 0)
|
|
{
|
|
//AddElement(new SpacePDF(15));
|
|
tabellaAsset.Notes.Add(
|
|
new TableNotePDF(TableNotePDF.TableNotePositionType.PièDiTabella,
|
|
GetNota2(),
|
|
new[] { "" },
|
|
string.Empty,
|
|
TableNotePDF
|
|
.TableNoteAsteriskPositionType.CorpoTabella) { FontSize = 6, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify }
|
|
);
|
|
captionProposto.Text += note;
|
|
note += "*";
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
#endregion
|
|
|
|
}
|
|
|
|
|
|
protected sealed override DataTable GetDataTable()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
protected sealed override DataSet GetDataSet()
|
|
{
|
|
var ds = new DataSet();
|
|
ds.Tables.Add(new DataTable("labelControvalore"));
|
|
ds.Tables.Add(new DataTable("AssetClass"));
|
|
ds.Tables.Add(new DataTable("AssetDisplayInfos"));
|
|
ds.Tables.Add(new DataTable("prodottiAsset"));
|
|
ds.Tables.Add(new DataTable("prodotti"));
|
|
|
|
ds.Tables["labelControvalore"].Columns.Add("ctvAttuale", typeof(decimal));
|
|
ds.Tables["labelControvalore"].Columns.Add("ctvProposto", typeof(decimal));
|
|
|
|
ds.Tables["AssetClass"].Columns.Add(new DataColumn("Descrizione", 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("ValoreAttuale", typeof(decimal)));
|
|
ds.Tables["AssetClass"].Columns.Add(new DataColumn("ValoreProposto", typeof(decimal)));
|
|
|
|
ds.Tables["AssetDisplayInfos"].Columns.Add(new DataColumn("codice", typeof(string)));
|
|
ds.Tables["AssetDisplayInfos"].Columns.Add(new DataColumn("ordine", typeof(int)));
|
|
ds.Tables["AssetDisplayInfos"].Columns.Add(new DataColumn("Red", typeof(int)));
|
|
ds.Tables["AssetDisplayInfos"].Columns.Add(new DataColumn("Green", typeof(int)));
|
|
ds.Tables["AssetDisplayInfos"].Columns.Add(new DataColumn("Blue", typeof(int)));
|
|
|
|
ds.Tables["prodottiAsset"].Columns.Add(new DataColumn("presenzaAzionario", typeof(bool)));
|
|
ds.Tables["prodottiAsset"].Columns.Add(new DataColumn("presenzaObbligazionario", typeof(bool)));
|
|
ds.Tables["prodottiAsset"].Columns.Add(new DataColumn("presenzaMonetario", typeof(bool)));
|
|
ds.Tables["prodottiAsset"].Columns.Add(new DataColumn("presenzaFlessibili", typeof(bool)));
|
|
ds.Tables["prodottiAsset"].Columns.Add(new DataColumn("presenzaAlternative", typeof(bool)));
|
|
ds.Tables["prodottiAsset"].Columns.Add(new DataColumn("presenzaMonetarioValuteEstere", typeof(bool)));
|
|
ds.Tables["prodottiAsset"].Columns.Add(new DataColumn("presenzaAltro", typeof(bool)));
|
|
|
|
ds.Tables["prodotti"].Columns.Add(new DataColumn("CodiceAreaBisogno", typeof(string)));
|
|
ds.Tables["prodotti"].Columns.Add(new DataColumn("DescrizioneAreaBisogno", typeof(string)));
|
|
ds.Tables["prodotti"].Columns.Add(new DataColumn("DescrizioneProgetto", typeof(string)));
|
|
ds.Tables["prodotti"].Columns.Add(new DataColumn("DescrizioneProdotto", typeof(string)));
|
|
ds.Tables["prodotti"].Columns.Add(new DataColumn("ValoreProdotto", typeof(decimal)));
|
|
ds.Tables["prodotti"].Columns.Add(new DataColumn("ValoreProdottoString", typeof(string)));
|
|
ds.Tables["prodotti"].Columns.Add(new DataColumn("ValoreAzionario", typeof(decimal)));
|
|
ds.Tables["prodotti"].Columns.Add(new DataColumn("ValoreAzionarioString", typeof(string)));
|
|
ds.Tables["prodotti"].Columns.Add(new DataColumn("ValoreObbligazionario", typeof(decimal)));
|
|
ds.Tables["prodotti"].Columns.Add(new DataColumn("ValoreObbligazionarioString", typeof(string)));
|
|
ds.Tables["prodotti"].Columns.Add(new DataColumn("ValoreMonetario", typeof(decimal)));
|
|
ds.Tables["prodotti"].Columns.Add(new DataColumn("ValoreMonetarioString", typeof(string)));
|
|
ds.Tables["prodotti"].Columns.Add(new DataColumn("ValoreFlessibili", typeof(decimal)));
|
|
ds.Tables["prodotti"].Columns.Add(new DataColumn("ValoreFlessibiliString", typeof(string)));
|
|
ds.Tables["prodotti"].Columns.Add(new DataColumn("ValoreAlternative", typeof(decimal)));
|
|
ds.Tables["prodotti"].Columns.Add(new DataColumn("ValoreAlternativeString", typeof(string)));
|
|
ds.Tables["prodotti"].Columns.Add(new DataColumn("ValoreMonetarioValuteEstere", typeof(decimal)));
|
|
ds.Tables["prodotti"].Columns.Add(new DataColumn("ValoreMonetarioValuteEstereString", typeof(string)));
|
|
ds.Tables["prodotti"].Columns.Add(new DataColumn("ValoreAltro", typeof(decimal)));
|
|
ds.Tables["prodotti"].Columns.Add(new DataColumn("ValoreAltroString", typeof(string)));
|
|
ds.Tables["prodotti"].Columns.Add(new DataColumn("OrdinamentoAreaBisogno", typeof(int)));
|
|
ds.Tables["prodotti"].Columns.Add(new DataColumn("FontBold", typeof(bool)));
|
|
ds.Tables["prodotti"].Columns.Add(new DataColumn("ReplaceIfZero", typeof(string)));
|
|
ds.Tables["prodotti"].Columns.Add(new DataColumn("CanLastRow", typeof(bool)));
|
|
|
|
var dataDettaglioProdotti = datiSeiUnico.propostaUnit().dettaglioProdotti;
|
|
var dataDettaglioProdottiExtraRisorseFinanziarie = datiSeiUnico.GetListaProdottiPatrimonioAltro();
|
|
|
|
var displayInfos = datiSeiUnico.displayInfos();
|
|
var dataPatrimonioCasa = datiSeiUnico.propostaUnit().stDettaglioProposta;
|
|
|
|
|
|
var assetClassAttuale = datiSeiUnico.patrimonioUnit().patrimonioCasa.assetClass;
|
|
var assetClassProposto = datiSeiUnico.propostaUnit().assetClass;
|
|
#region GraficoSintesi
|
|
|
|
|
|
ds.Tables["labelControvalore"].Rows.Add(
|
|
Helper.FormatCurrency(datiSeiUnico.ATTUTALE_TOTALEPOSITIVO.ToString()),
|
|
Helper.FormatCurrency(datiSeiUnico.PROPOSTO_TOTALEPOSITIVO.ToString().ToString())
|
|
);
|
|
|
|
foreach (var displayInfo in from o in displayInfos.assetDisplayInfos orderby o.value.order select o)
|
|
{
|
|
var attuale = (from o in assetClassAttuale.distribuzione.elencoSlice
|
|
where o.codice == displayInfo.key && o.sliceRappresentabile
|
|
select o).LastOrDefault();
|
|
var proposto = (from o in assetClassProposto.distribuzione.elencoSlice
|
|
where o.codice == displayInfo.key && o.sliceRappresentabile
|
|
select o).LastOrDefault();
|
|
|
|
bool attualeExist = false;
|
|
bool propostoExist = false;
|
|
|
|
if (attuale != null)
|
|
if (presenzaContocorrenteInMonterio() ? attuale.ctvCC != 0 : attuale.ctv != 0)
|
|
attualeExist = true;
|
|
if (proposto != null)
|
|
if (presenzaContocorrenteInMonterio() ? proposto.ctvCC != 0 : proposto.ctv != 0)
|
|
attualeExist = true;
|
|
|
|
|
|
if (attuale != null || proposto != null)
|
|
{
|
|
if (attualeExist || propostoExist)
|
|
{
|
|
DataRow dr = ds.Tables["AssetClass"].NewRow();
|
|
dr["Red"] = new ColorPDF(displayInfo.value.fill).Red;
|
|
dr["Green"] = new ColorPDF(displayInfo.value.fill).Green;
|
|
dr["Blue"] = new ColorPDF(displayInfo.value.fill).Blue;
|
|
dr["ValoreProposto"] = 0;
|
|
dr["ValoreAttuale"] = 0;
|
|
ds.Tables["AssetClass"].Rows.Add(dr);
|
|
if (attuale != null)
|
|
{
|
|
dr["Descrizione"] = attuale.descrizione;
|
|
dr["ValoreAttuale"] = presenzaContocorrenteInMonterio() ?
|
|
isControvalore() ? attuale.ctvCC : attuale.pesoCC * 100 :
|
|
isControvalore() ? attuale.ctv : attuale.peso * 100;
|
|
|
|
}
|
|
if (proposto != null)
|
|
{
|
|
dr["Descrizione"] = proposto.descrizione;
|
|
dr["ValoreProposto"] = presenzaContocorrenteInMonterio() ?
|
|
isControvalore() ? proposto.ctvCC : proposto.pesoCC * 100 :
|
|
isControvalore() ? proposto.ctv : proposto.peso * 100;
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
#endregion
|
|
|
|
return ds;
|
|
}
|
|
|
|
public virtual bool presenzaContocorrenteInMonterio()
|
|
{
|
|
return GetOption<Opzione4>().Valore;
|
|
}
|
|
public virtual bool isControvalore()
|
|
{
|
|
return !GetOption<Opzione3>().Valore;
|
|
}
|
|
|
|
public virtual string getTesto1()
|
|
{
|
|
bool isAdeguata = datiSeiUnico.flagAdeguatezzaPro();
|
|
string nota = "";
|
|
if(isAdeguata)
|
|
nota = "Nei grafici sottostanti è riportato il confronto, sulla base delle principali asset class finanziarie, " +
|
|
"tra il patrimonio che lei attualmente detiene presso $/Banca/$ (\"portafoglio attuale\") e il patrimonio derivante dalla presente proposta (\"portafoglio proposto\"), " +
|
|
"con evidenza dell'esposizione, in termini {0}, del singolo patrimonio a ciascuna asset class.";
|
|
else
|
|
nota = "Nei grafici sottostanti è riportato il confronto, sulla base delle principali asset class finanziarie, " +
|
|
"tra il patrimonio che lei attualmente detiene presso $/Banca/$ (\"portafoglio attuale\") e il patrimonio derivante dalle operazioni da lei richieste al suo private banker (\"portafoglio prospettico\"), " +
|
|
"con evidenza dell'esposizione, in termini {0}, del singolo patrimonio a ciascuna asset class.";
|
|
return datiSeiUnico.FormatBanca(nota, isControvalore() ? "di controvalore" : "percentuali");
|
|
}
|
|
|
|
|
|
public virtual string GetNota1()
|
|
{
|
|
|
|
decimal contoCorrenteNegativo = datiSeiUnico.ATTUTALE_CCN;
|
|
decimal liqEligoFondiNeg = datiSeiUnico.ATTUTALE_GPELIGOFONDI;
|
|
decimal liqEligoTitoliNeg = datiSeiUnico.ATTUTALE_GPELIGOTITOLI;
|
|
// 20181009 AC
|
|
decimal liqTuoFoglioNeg = datiSeiUnico.ATTUTALE_TUOFOGLIO;
|
|
//--20181009 AC
|
|
|
|
string nota = "";
|
|
string token = " ";
|
|
|
|
// 20181009 AC
|
|
//if (contoCorrenteNegativo != 0 || liqEligoFondiNeg != 0 || liqEligoTitoliNeg != 0)
|
|
if (contoCorrenteNegativo != 0 || liqEligoFondiNeg != 0 || liqEligoTitoliNeg != 0 ||liqTuoFoglioNeg!=0)
|
|
//--20181009 AC
|
|
{
|
|
nota += "Il controvalore del portafoglio attuale esclude il saldo negativo";
|
|
|
|
if (contoCorrenteNegativo != 0)
|
|
{
|
|
nota += token + "dei conti correnti (" + Helper.FormatCurrencyWithSymbol(contoCorrenteNegativo.ToString()) + ")";
|
|
token = ", ";
|
|
}
|
|
// 20181009 AC
|
|
if (liqTuoFoglioNeg != 0)
|
|
{
|
|
nota += token + "della liquidità sottostante Il Mio Foglio (" + Helper.FormatCurrencyWithSymbol(liqTuoFoglioNeg.ToString()) + ")";
|
|
token = ", ";
|
|
}
|
|
//--20181009 AC
|
|
if (liqEligoFondiNeg != 0)
|
|
{
|
|
nota += token + "della liquidità sottostante la GP Eligo Fondi (" + Helper.FormatCurrencyWithSymbol(liqEligoFondiNeg.ToString()) + ")";
|
|
token = ", ";
|
|
}
|
|
if (liqEligoTitoliNeg != 0)
|
|
{
|
|
nota += token + "della liquidità sottostante la GP Eligo Titoli (" + Helper.FormatCurrencyWithSymbol(liqEligoTitoliNeg.ToString()) + ")";
|
|
token = ", ";
|
|
}
|
|
nota += ". ";
|
|
token = "";
|
|
}
|
|
|
|
|
|
var macroAssetClass = datiSeiUnico.patrimonioUnit().patrimonioCasa.macroAssetClass;
|
|
decimal gradoCopertura = presenzaContocorrenteInMonterio() ? macroAssetClass.distribuzione.coverageCC * 100 : macroAssetClass.distribuzione.coverage * 100;
|
|
decimal totaleNonRappr = macroAssetClass.distribuzione.totaleNonRappr;
|
|
decimal contoCorrente = presenzaContocorrenteInMonterio() ? 0 : datiSeiUnico.ATTUTALE_CC;
|
|
decimal partiteViaggianti = datiSeiUnico.ATTUTALE_OC;
|
|
|
|
if (gradoCopertura < 100)
|
|
{
|
|
nota += "Grado di copertura (%) della rappresentazione grafica per macro asset class del portafoglio attuale pari a " + Helper.FormatDecimal(gradoCopertura.ToString(), 2) + ":";
|
|
token = " ";
|
|
|
|
if (totaleNonRappr != 0 || contoCorrente != 0 || partiteViaggianti != 0)
|
|
{
|
|
nota += token + "non sono considerati";
|
|
if (totaleNonRappr != 0)
|
|
{
|
|
nota += token + "i prodotti non rappresentabili (" + Helper.FormatCurrencyWithSymbol(totaleNonRappr.ToString()) + ")";
|
|
token = ", ";
|
|
}
|
|
if (contoCorrente != 0)
|
|
{
|
|
nota += token + "i conti correnti (" + Helper.FormatCurrencyWithSymbol(contoCorrente.ToString()) + ")";
|
|
token = ", ";
|
|
}
|
|
if (partiteViaggianti != 0)
|
|
{
|
|
nota += token + "gli importi relativi alle operazioni in corso (" + Helper.FormatCurrencyWithSymbol(partiteViaggianti.ToString()) + ")";
|
|
token = ", ";
|
|
}
|
|
nota += ". ";
|
|
}
|
|
}
|
|
return nota;
|
|
}
|
|
public virtual string GetNota2()
|
|
{
|
|
|
|
decimal contoCorrenteNegativo = datiSeiUnico.PROPOSTO_CCN;
|
|
decimal liqEligoFondiNeg = datiSeiUnico.PROPOSTO_GPELIGOFONDI;
|
|
decimal liqEligoTitoliNeg = datiSeiUnico.PROPOSTO_GPELIGOTITOLI;
|
|
// 20181009 AC
|
|
decimal liqTuoFoglioNeg = datiSeiUnico.PROPOSTO_TUOFOGLIO;
|
|
//--20181009
|
|
|
|
string nota = "";
|
|
string token = " ";
|
|
if (contoCorrenteNegativo != 0 || liqEligoFondiNeg != 0 || liqEligoTitoliNeg != 0)
|
|
{
|
|
nota += "Il controvalore del portafoglio " + (datiSeiUnico.flagAdeguatezzaPro() ? "proposto" : "prospettico") + " esclude il saldo negativo";
|
|
|
|
if (contoCorrenteNegativo != 0)
|
|
{
|
|
nota += token + "dei conti correnti (" + Helper.FormatCurrencyWithSymbol(contoCorrenteNegativo.ToString()) + ")";
|
|
token = ", ";
|
|
}
|
|
// 20181009 AC
|
|
|
|
if (liqTuoFoglioNeg != 0)
|
|
{
|
|
nota += token + "della liquidità sottostante Il Mio Foglio (" + Helper.FormatCurrencyWithSymbol(liqTuoFoglioNeg.ToString()) + ")";
|
|
token = ", ";
|
|
}
|
|
//--20181009 AC
|
|
if (liqEligoFondiNeg != 0)
|
|
{
|
|
nota += token + "della liquidità sottostante la GP Eligo Fondi (" + Helper.FormatCurrencyWithSymbol(liqEligoFondiNeg.ToString()) + ")";
|
|
token = ", ";
|
|
}
|
|
if (liqEligoTitoliNeg != 0)
|
|
{
|
|
nota += token + "della liquidità sottostante la GP Eligo Titoli (" + Helper.FormatCurrencyWithSymbol(liqEligoTitoliNeg.ToString()) + ")";
|
|
token = ", ";
|
|
}
|
|
nota += ". ";
|
|
token = "";
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var macroAssetClass = datiSeiUnico.propostaUnit().macroAssetClass;
|
|
decimal gradoCopertura = presenzaContocorrenteInMonterio() ? macroAssetClass.distribuzione.coverageCC * 100 : macroAssetClass.distribuzione.coverage * 100;
|
|
decimal totaleNonRappr = macroAssetClass.distribuzione.totaleNonRappr;
|
|
decimal contoCorrente = presenzaContocorrenteInMonterio() ? 0 : datiSeiUnico.PROPOSTO_CC;
|
|
decimal partiteViaggianti = datiSeiUnico.PROPOSTO_OC;
|
|
|
|
|
|
if (gradoCopertura < 100)
|
|
{
|
|
nota += "Grado di copertura (%) della rappresentazione grafica per macro asset class del portafoglio " + (datiSeiUnico.flagAdeguatezzaPro() ? "proposto" : "prospettico") + " pari a " + Helper.FormatDecimal(gradoCopertura.ToString(), 2) + ":";
|
|
token = " ";
|
|
|
|
if (totaleNonRappr != 0 || contoCorrente != 0 || partiteViaggianti != 0)
|
|
{
|
|
nota += token + "non sono considerati ";
|
|
if (totaleNonRappr != 0)
|
|
{
|
|
nota += token + "i prodotti non rappresentabili (" + Helper.FormatCurrencyWithSymbol(totaleNonRappr.ToString()) + ")";
|
|
token = ", ";
|
|
}
|
|
if (contoCorrente != 0)
|
|
{
|
|
nota += token + "i conti correnti (" + Helper.FormatCurrencyWithSymbol(contoCorrente.ToString()) + ")";
|
|
token = ", ";
|
|
}
|
|
if (partiteViaggianti != 0)
|
|
{
|
|
nota += token + "gli importi relativi alle operazioni in corso (" + Helper.FormatCurrencyWithSymbol(partiteViaggianti.ToString()) + ")";
|
|
token = ", ";
|
|
}
|
|
nota += ". ";
|
|
}
|
|
}
|
|
return nota;
|
|
}
|
|
|
|
|
|
}
|
|
}
|