|
|
@@ -1035,7 +1035,7 @@ namespace GreenTree.Nachtragsmanagement.Web.Extensions
|
|
|
});
|
|
|
s.Columns.Add(column =>
|
|
|
{
|
|
|
- column.Caption = "Anteil Verh. zu Angeb.";
|
|
|
+ column.Caption = "Verh.-Quote";
|
|
|
column.FieldName = "RelationOfferingToNegotiation";
|
|
|
column.PropertiesEdit.DisplayFormatString = "p2";
|
|
|
column.MinWidth = 115;
|
|
|
@@ -1142,6 +1142,67 @@ namespace GreenTree.Nachtragsmanagement.Web.Extensions
|
|
|
column.Width = new Unit(200, UnitType.Pixel);
|
|
|
});
|
|
|
|
|
|
+ var totalRelationOfferingToDeviationsSum = (decimal)0;
|
|
|
+ var totalRelationOfferingToDeviationsCount = 0;
|
|
|
+
|
|
|
+ var totalPercentageValueSum = (decimal)0;
|
|
|
+ var totalNegotiationValueSum = (decimal)0;
|
|
|
+
|
|
|
+ s.CustomSummaryCalculate = (sender, e) =>
|
|
|
+ {
|
|
|
+ if (e.SummaryProcess == CustomSummaryProcess.Start)
|
|
|
+ {
|
|
|
+ totalRelationOfferingToDeviationsSum = 0;
|
|
|
+ totalRelationOfferingToDeviationsCount = 0;
|
|
|
+
|
|
|
+ totalPercentageValueSum = 0;
|
|
|
+ totalNegotiationValueSum = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (e.SummaryProcess == CustomSummaryProcess.Calculate)
|
|
|
+ {
|
|
|
+ var relationOfferingToDeviationsVal = e.GetValue("RelationOfferingToDeviations");
|
|
|
+
|
|
|
+ if (relationOfferingToDeviationsVal != null)
|
|
|
+ {
|
|
|
+ totalRelationOfferingToDeviationsCount++;
|
|
|
+ totalRelationOfferingToDeviationsSum += Convert.ToDecimal(relationOfferingToDeviationsVal);
|
|
|
+ }
|
|
|
+
|
|
|
+ var percentageVal = e.GetValue("PercentageValue");
|
|
|
+
|
|
|
+ if (percentageVal != null)
|
|
|
+ totalPercentageValueSum += Convert.ToDecimal(percentageVal);
|
|
|
+
|
|
|
+ var negotiationVal = e.GetValue("NegotiationValue");
|
|
|
+
|
|
|
+ if (negotiationVal != null)
|
|
|
+ totalNegotiationValueSum += Convert.ToDecimal(negotiationVal);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (e.SummaryProcess == CustomSummaryProcess.Finalize)
|
|
|
+ {
|
|
|
+ var summaryItem = (ASPxSummaryItem)e.Item;
|
|
|
+
|
|
|
+ if (summaryItem.FieldName == "PercentageValue")
|
|
|
+ e.TotalValue = totalPercentageValueSum;
|
|
|
+
|
|
|
+ if (summaryItem.FieldName == "NegotiationValue")
|
|
|
+ e.TotalValue = totalNegotiationValueSum;
|
|
|
+
|
|
|
+ if (summaryItem.FieldName == "RelationOfferingToDeviations")
|
|
|
+ {
|
|
|
+ if (totalRelationOfferingToDeviationsSum == 0 || totalRelationOfferingToDeviationsCount == 0)
|
|
|
+ e.TotalValue = 0;
|
|
|
+ else
|
|
|
+ e.TotalValue = totalRelationOfferingToDeviationsSum / totalRelationOfferingToDeviationsCount;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (summaryItem.FieldName == "RelationOfferingToNegotiation")
|
|
|
+ e.TotalValue = totalNegotiationValueSum / totalPercentageValueSum;
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
s.TotalSummary.Add(new ASPxSummaryItem
|
|
|
{
|
|
|
SummaryType = DevExpress.Data.SummaryItemType.Count,
|
|
|
@@ -1184,29 +1245,55 @@ namespace GreenTree.Nachtragsmanagement.Web.Extensions
|
|
|
s.TotalSummary.Add(new ASPxSummaryItem
|
|
|
{
|
|
|
FieldName = "PercentageValue",
|
|
|
- SummaryType = DevExpress.Data.SummaryItemType.Sum,
|
|
|
+ SummaryType = DevExpress.Data.SummaryItemType.Custom,
|
|
|
DisplayFormat = "Schätz. bew. ∑<br/><i>{0:c2}</i>"
|
|
|
});
|
|
|
s.GroupSummary.Add(new ASPxSummaryItem
|
|
|
{
|
|
|
FieldName = "PercentageValue",
|
|
|
- SummaryType = DevExpress.Data.SummaryItemType.Sum,
|
|
|
+ SummaryType = DevExpress.Data.SummaryItemType.Custom,
|
|
|
DisplayFormat = "Schätz. bew. ∑ = <i>{0:c2}</i>"
|
|
|
});
|
|
|
|
|
|
s.TotalSummary.Add(new ASPxSummaryItem
|
|
|
{
|
|
|
- SummaryType = DevExpress.Data.SummaryItemType.Sum,
|
|
|
+ SummaryType = DevExpress.Data.SummaryItemType.Custom,
|
|
|
FieldName = "NegotiationValue",
|
|
|
DisplayFormat = "Verhand. ∑<br/><i>{0:c2}</i>"
|
|
|
});
|
|
|
s.GroupSummary.Add(new ASPxSummaryItem
|
|
|
{
|
|
|
- SummaryType = DevExpress.Data.SummaryItemType.Sum,
|
|
|
+ SummaryType = DevExpress.Data.SummaryItemType.Custom,
|
|
|
FieldName = "NegotiationValue",
|
|
|
DisplayFormat = "Verhand.-∑ = {0:c2}"
|
|
|
});
|
|
|
|
|
|
+ s.TotalSummary.Add(new ASPxSummaryItem
|
|
|
+ {
|
|
|
+ SummaryType = DevExpress.Data.SummaryItemType.Custom,
|
|
|
+ FieldName = "RelationOfferingToNegotiation",
|
|
|
+ DisplayFormat = "Verh. Quo. Ø<br/><i>{0:p2}</i>"
|
|
|
+ });
|
|
|
+ s.GroupSummary.Add(new ASPxSummaryItem
|
|
|
+ {
|
|
|
+ SummaryType = DevExpress.Data.SummaryItemType.Custom,
|
|
|
+ FieldName = "RelationOfferingToNegotiation",
|
|
|
+ DisplayFormat = "Verh. Quo. Ø = {0:p2}"
|
|
|
+ });
|
|
|
+
|
|
|
+ s.TotalSummary.Add(new ASPxSummaryItem
|
|
|
+ {
|
|
|
+ SummaryType = DevExpress.Data.SummaryItemType.Custom,
|
|
|
+ FieldName = "RelationOfferingToDeviations",
|
|
|
+ DisplayFormat = "Fak. A./VA Ø<br/><i>{0:n2}</i>"
|
|
|
+ });
|
|
|
+ s.GroupSummary.Add(new ASPxSummaryItem
|
|
|
+ {
|
|
|
+ SummaryType = DevExpress.Data.SummaryItemType.Custom,
|
|
|
+ FieldName = "RelationOfferingToDeviations",
|
|
|
+ DisplayFormat = "Fak. A./VA Ø = {0:n2}"
|
|
|
+ });
|
|
|
+
|
|
|
s.HtmlRowPrepared = (sender, e) =>
|
|
|
{
|
|
|
var state = e.GetValue("State") as StateDataModel;
|