Currency Summary EUR
This commit is contained in:
parent
4554c5841d
commit
65b73b45bf
@ -482,7 +482,7 @@ Public Class ClassControlCreator
|
|||||||
Return control
|
Return control
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function CreateExistingGridControl(row As DataRow, DT_MY_COLUMNS As DataTable, designMode As Boolean) As GridControl
|
Public Function CreateExistingGridControl(row As DataRow, DT_MY_COLUMNS As DataTable, designMode As Boolean, pcurrencySymbol As String) As GridControl
|
||||||
Dim oGridControlCreator = New ControlCreator.GridControl(LogConfig, GridTables)
|
Dim oGridControlCreator = New ControlCreator.GridControl(LogConfig, GridTables)
|
||||||
Dim oControl As GridControl = CreateBaseControl(New GridControl(), row, designMode)
|
Dim oControl As GridControl = CreateBaseControl(New GridControl(), row, designMode)
|
||||||
Dim oControlId = DirectCast(oControl.Tag, ControlMetadata).Guid
|
Dim oControlId = DirectCast(oControl.Tag, ControlMetadata).Guid
|
||||||
@ -586,7 +586,7 @@ Public Class ClassControlCreator
|
|||||||
End Try
|
End Try
|
||||||
End If
|
End If
|
||||||
|
|
||||||
oGridControlCreator.ConfigureViewColumns(DT_MY_COLUMNS, oView, oControl)
|
oGridControlCreator.ConfigureViewColumns(DT_MY_COLUMNS, oView, oControl, pcurrencySymbol)
|
||||||
oGridControlCreator.ConfigureViewEvents(DT_MY_COLUMNS, oView, oControl, oControlId)
|
oGridControlCreator.ConfigureViewEvents(DT_MY_COLUMNS, oView, oControl, oControlId)
|
||||||
|
|
||||||
' 08.11.2021: Fix editor being empty on first open
|
' 08.11.2021: Fix editor being empty on first open
|
||||||
|
|||||||
@ -144,8 +144,16 @@ Namespace ControlCreator
|
|||||||
Return oEditor
|
Return oEditor
|
||||||
End If
|
End If
|
||||||
End Function
|
End Function
|
||||||
|
' Hilfsroutine: passt NUR das Summary-Item an (ohne FormatInfo)
|
||||||
|
Private Sub ApplyCurrencySummaryFormat(oCol As GridColumn, currencySymbol As String)
|
||||||
|
oCol.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum
|
||||||
|
' Variante A: Standard-Währungsformat aus aktueller Kultur
|
||||||
|
' oCol.SummaryItem.DisplayFormat = "SUM: {0:C2}"
|
||||||
|
|
||||||
Public Sub ConfigureViewColumns(pColumnTable As DataTable, pGridView As GridView, pGrid As DevExpress.XtraGrid.GridControl)
|
' Variante B: Kulturunabhängig, Symbol explizit anhängen
|
||||||
|
oCol.SummaryItem.DisplayFormat = $"SUM: {{0:N2}} {currencySymbol}"
|
||||||
|
End Sub
|
||||||
|
Public Sub ConfigureViewColumns(pColumnTable As DataTable, pGridView As GridView, pGrid As DevExpress.XtraGrid.GridControl, pcurrencySymbol As String)
|
||||||
Dim oShouldDisplayFooter As Boolean = False
|
Dim oShouldDisplayFooter As Boolean = False
|
||||||
|
|
||||||
|
|
||||||
@ -192,8 +200,7 @@ Namespace ControlCreator
|
|||||||
oShouldDisplayFooter = True
|
oShouldDisplayFooter = True
|
||||||
|
|
||||||
Case Constants.AGGREGATE_TOTAL_CURRENCY
|
Case Constants.AGGREGATE_TOTAL_CURRENCY
|
||||||
oCol.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum
|
ApplyCurrencySummaryFormat(oCol, pcurrencySymbol)
|
||||||
oCol.SummaryItem.DisplayFormat = "SUM: {0:C2}"
|
|
||||||
oShouldDisplayFooter = True
|
oShouldDisplayFooter = True
|
||||||
|
|
||||||
Case Constants.AGGREGATE_TOTAL_AVG
|
Case Constants.AGGREGATE_TOTAL_AVG
|
||||||
|
|||||||
@ -295,7 +295,7 @@ Public Class frmFormDesigner
|
|||||||
Dim oDTColumnsPerDevExGrid As DataTable = DatabaseFallback.GetDatatableECM(oSQL) ', "FDesignLaodControls")
|
Dim oDTColumnsPerDevExGrid As DataTable = DatabaseFallback.GetDatatableECM(oSQL) ', "FDesignLaodControls")
|
||||||
|
|
||||||
|
|
||||||
Dim table = ControlCreator.CreateExistingGridControl(row, oDTColumnsPerDevExGrid, True)
|
Dim table = ControlCreator.CreateExistingGridControl(row, oDTColumnsPerDevExGrid, True, "EUR")
|
||||||
|
|
||||||
AddHandler table.MouseClick, AddressOf gridControl_MouseClick
|
AddHandler table.MouseClick, AddressOf gridControl_MouseClick
|
||||||
' AddHandler table.ColumnHeaderMouseClick, AddressOf table_ColumnHeaderMouseClick
|
' AddHandler table.ColumnHeaderMouseClick, AddressOf table_ColumnHeaderMouseClick
|
||||||
|
|||||||
@ -355,7 +355,7 @@ Public Class frmMassValidator
|
|||||||
LOGGER.Debug("Versuch Tabelle zu laden")
|
LOGGER.Debug("Versuch Tabelle zu laden")
|
||||||
Dim oDTMyColumns As DataTable = DatabaseFallback.GetDatatableECM($"SELECT * FROM TBPM_CONTROL_TABLE WHERE CONTROL_ID = {oControlRow.Item("GUID")} ORDER BY SEQUENCE") ', "MV_LoadControls1")
|
Dim oDTMyColumns As DataTable = DatabaseFallback.GetDatatableECM($"SELECT * FROM TBPM_CONTROL_TABLE WHERE CONTROL_ID = {oControlRow.Item("GUID")} ORDER BY SEQUENCE") ', "MV_LoadControls1")
|
||||||
|
|
||||||
oControl = ControlCreator.CreateExistingGridControl(oControlRow, oDTMyColumns, False)
|
oControl = ControlCreator.CreateExistingGridControl(oControlRow, oDTMyColumns, False, CURRENT_DOC_CURRENCY)
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
If oControl IsNot Nothing AndAlso TypeOf oControl IsNot Label Then
|
If oControl IsNot Nothing AndAlso TypeOf oControl IsNot Label Then
|
||||||
|
|||||||
@ -75,6 +75,7 @@ Public Class frmValidator
|
|||||||
Private CountAction As Int16 = 0
|
Private CountAction As Int16 = 0
|
||||||
Public Shared Property WMDocPathWindows As String
|
Public Shared Property WMDocPathWindows As String
|
||||||
Private Property DocPathWindows As String
|
Private Property DocPathWindows As String
|
||||||
|
Private Property DocCurrency As String = "EUR"
|
||||||
'Anzahl der Validierungsdokumente
|
'Anzahl der Validierungsdokumente
|
||||||
Private Property Amount_Docs2Validate As Integer
|
Private Property Amount_Docs2Validate As Integer
|
||||||
Private Property first_control As Control
|
Private Property first_control As Control
|
||||||
@ -1137,7 +1138,7 @@ Public Class frmValidator
|
|||||||
Continue For
|
Continue For
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim oGrid = ControlCreator.CreateExistingGridControl(oControlRow, oFilteredDatatable, False)
|
Dim oGrid = ControlCreator.CreateExistingGridControl(oControlRow, oFilteredDatatable, False, DocCurrency)
|
||||||
oMyControl = oGrid
|
oMyControl = oGrid
|
||||||
'AddHandler oGrid.Views(0).c AddressOf GridView_CustomColumnDisplayText
|
'AddHandler oGrid.Views(0).c AddressOf GridView_CustomColumnDisplayText
|
||||||
|
|
||||||
@ -2795,24 +2796,24 @@ Public Class frmValidator
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If Not IsNothing(oCurrency) Then
|
If Not IsNothing(oCurrency) Then
|
||||||
|
DocCurrency = oCurrency
|
||||||
Dim oValueType = oCurrency.GetType.ToString
|
Dim oValueType = DocCurrency.GetType.ToString
|
||||||
If IsDBNull(oCurrency) Then
|
If IsDBNull(DocCurrency) Then
|
||||||
oCurrency = "EUR"
|
DocCurrency = "EUR"
|
||||||
Else
|
Else
|
||||||
Try
|
Try
|
||||||
oCurrency = oCurrency.ToString
|
DocCurrency = DocCurrency.ToString
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
MyValidationLogger.Warn($"Unexpected error in Converting oCurreny to string: " & ex.Message)
|
MyValidationLogger.Warn($"Unexpected error in Converting oCurreny to string: " & ex.Message)
|
||||||
oCurrency = "EUR"
|
DocCurrency = "EUR"
|
||||||
End Try
|
End Try
|
||||||
End If
|
End If
|
||||||
If oCurrency <> String.Empty Then
|
If DocCurrency <> String.Empty Then
|
||||||
If oCurrency.ToString.Length <> 3 Then
|
If DocCurrency.ToString.Length <> 3 Then
|
||||||
MyValidationLogger.Info("oCurrency-Length = 3 - Setting to EUR")
|
MyValidationLogger.Info("DocCurrency-Length = 3 - Setting to EUR")
|
||||||
oCurrency = "EUR"
|
DocCurrency = "EUR"
|
||||||
End If
|
End If
|
||||||
MyValidationLogger.Debug($"oCurrency = {oCurrency}")
|
MyValidationLogger.Debug($"DocCurrency = {DocCurrency}")
|
||||||
For Each oControl As Control In PanelValidatorControl.Controls
|
For Each oControl As Control In PanelValidatorControl.Controls
|
||||||
Try
|
Try
|
||||||
Dim oMeta = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata)
|
Dim oMeta = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata)
|
||||||
@ -2824,7 +2825,7 @@ Public Class frmValidator
|
|||||||
DT_COLUMNS_GRID.Select(oExpression, "SEQUENCE").CopyToDataTable(oFilteredDatatable, LoadOption.PreserveChanges)
|
DT_COLUMNS_GRID.Select(oExpression, "SEQUENCE").CopyToDataTable(oFilteredDatatable, LoadOption.PreserveChanges)
|
||||||
|
|
||||||
Dim oCultureInfo As CultureInfo = New CultureInfo("de-DE")
|
Dim oCultureInfo As CultureInfo = New CultureInfo("de-DE")
|
||||||
oCultureInfo.NumberFormat.CurrencySymbol = oCurrency
|
oCultureInfo.NumberFormat.CurrencySymbol = DocCurrency
|
||||||
Dim riTextEdit As RepositoryItemTextEdit = New RepositoryItemTextEdit()
|
Dim riTextEdit As RepositoryItemTextEdit = New RepositoryItemTextEdit()
|
||||||
riTextEdit.MaskSettings.Configure(Of MaskSettings.Numeric)(Sub(settings)
|
riTextEdit.MaskSettings.Configure(Of MaskSettings.Numeric)(Sub(settings)
|
||||||
settings.MaskExpression = "c"
|
settings.MaskExpression = "c"
|
||||||
@ -2858,7 +2859,7 @@ Public Class frmValidator
|
|||||||
End Try
|
End Try
|
||||||
Next
|
Next
|
||||||
Else
|
Else
|
||||||
MyValidationLogger.Warn($"oCurrency is String.empty! ")
|
MyValidationLogger.Warn($"DocCurrency is String.empty! ")
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
MyValidationLogger.Warn($"oCurrency is Nothing - Check PROFIL_CURRENCY_ATTRIBUTE! ")
|
MyValidationLogger.Warn($"oCurrency is Nothing - Check PROFIL_CURRENCY_ATTRIBUTE! ")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user