Fix DocumentTypes for Exports, Prepare Price calculation, load template parameters

This commit is contained in:
Jonathan Jenne 2022-02-28 11:58:01 +01:00
parent 2e7b0bef8a
commit 213bcef732
6 changed files with 188 additions and 81 deletions

View File

@ -80,8 +80,8 @@ Partial Class frmExportMain
Me.LayoutControlItem6 = New DevExpress.XtraLayout.LayoutControlItem() Me.LayoutControlItem6 = New DevExpress.XtraLayout.LayoutControlItem()
Me.LayoutControlItem7 = New DevExpress.XtraLayout.LayoutControlItem() Me.LayoutControlItem7 = New DevExpress.XtraLayout.LayoutControlItem()
Me.LayoutControlItem8 = New DevExpress.XtraLayout.LayoutControlItem() Me.LayoutControlItem8 = New DevExpress.XtraLayout.LayoutControlItem()
Me.LayoutControlItem9 = New DevExpress.XtraLayout.LayoutControlItem()
Me.LayoutControlItem10 = New DevExpress.XtraLayout.LayoutControlItem() Me.LayoutControlItem10 = New DevExpress.XtraLayout.LayoutControlItem()
Me.LayoutControlItem9 = New DevExpress.XtraLayout.LayoutControlItem()
Me.LabelControl2 = New DevExpress.XtraEditors.LabelControl() Me.LabelControl2 = New DevExpress.XtraEditors.LabelControl()
Me.colName2 = New DevExpress.XtraGrid.Columns.GridColumn() Me.colName2 = New DevExpress.XtraGrid.Columns.GridColumn()
Me.colId2 = New DevExpress.XtraGrid.Columns.GridColumn() Me.colId2 = New DevExpress.XtraGrid.Columns.GridColumn()
@ -124,8 +124,8 @@ Partial Class frmExportMain
CType(Me.LayoutControlItem6, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.LayoutControlItem6, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.LayoutControlItem7, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.LayoutControlItem7, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.LayoutControlItem8, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.LayoutControlItem8, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.LayoutControlItem9, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.LayoutControlItem10, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.LayoutControlItem10, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.LayoutControlItem9, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout() Me.SuspendLayout()
' '
'RibbonControl1 'RibbonControl1
@ -422,14 +422,14 @@ Partial Class frmExportMain
' '
'lookupMandator 'lookupMandator
' '
Me.lookupMandator.Location = New System.Drawing.Point(104, 15) Me.lookupMandator.Location = New System.Drawing.Point(112, 15)
Me.lookupMandator.MenuManager = Me.RibbonControl1 Me.lookupMandator.MenuManager = Me.RibbonControl1
Me.lookupMandator.Name = "lookupMandator" Me.lookupMandator.Name = "lookupMandator"
Me.lookupMandator.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}) Me.lookupMandator.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)})
Me.lookupMandator.Properties.NullText = "" Me.lookupMandator.Properties.NullText = ""
Me.lookupMandator.Properties.PopupSizeable = False Me.lookupMandator.Properties.PopupSizeable = False
Me.lookupMandator.Properties.PopupView = Me.GridLookUpEdit1View Me.lookupMandator.Properties.PopupView = Me.GridLookUpEdit1View
Me.lookupMandator.Size = New System.Drawing.Size(179, 20) Me.lookupMandator.Size = New System.Drawing.Size(171, 20)
Me.lookupMandator.StyleController = Me.LayoutControl1 Me.lookupMandator.StyleController = Me.LayoutControl1
Me.lookupMandator.TabIndex = 4 Me.lookupMandator.TabIndex = 4
' '
@ -460,27 +460,27 @@ Partial Class frmExportMain
'dateDocDateFrom 'dateDocDateFrom
' '
Me.dateDocDateFrom.EditValue = Nothing Me.dateDocDateFrom.EditValue = Nothing
Me.dateDocDateFrom.Location = New System.Drawing.Point(104, 195) Me.dateDocDateFrom.Location = New System.Drawing.Point(112, 195)
Me.dateDocDateFrom.MenuManager = Me.RibbonControl1 Me.dateDocDateFrom.MenuManager = Me.RibbonControl1
Me.dateDocDateFrom.Name = "dateDocDateFrom" Me.dateDocDateFrom.Name = "dateDocDateFrom"
Me.dateDocDateFrom.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}) Me.dateDocDateFrom.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)})
Me.dateDocDateFrom.Properties.CalendarTimeProperties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}) Me.dateDocDateFrom.Properties.CalendarTimeProperties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)})
Me.dateDocDateFrom.Properties.CharacterCasing = System.Windows.Forms.CharacterCasing.Lower Me.dateDocDateFrom.Properties.CharacterCasing = System.Windows.Forms.CharacterCasing.Lower
Me.dateDocDateFrom.Properties.SelectionMode = DevExpress.XtraEditors.Repository.CalendarSelectionMode.Multiple Me.dateDocDateFrom.Properties.SelectionMode = DevExpress.XtraEditors.Repository.CalendarSelectionMode.Multiple
Me.dateDocDateFrom.Size = New System.Drawing.Size(179, 20) Me.dateDocDateFrom.Size = New System.Drawing.Size(171, 20)
Me.dateDocDateFrom.StyleController = Me.LayoutControl1 Me.dateDocDateFrom.StyleController = Me.LayoutControl1
Me.dateDocDateFrom.TabIndex = 5 Me.dateDocDateFrom.TabIndex = 5
' '
'lookupAccount 'lookupAccount
' '
Me.lookupAccount.Location = New System.Drawing.Point(104, 105) Me.lookupAccount.Location = New System.Drawing.Point(112, 105)
Me.lookupAccount.MenuManager = Me.RibbonControl1 Me.lookupAccount.MenuManager = Me.RibbonControl1
Me.lookupAccount.Name = "lookupAccount" Me.lookupAccount.Name = "lookupAccount"
Me.lookupAccount.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo), New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Clear)}) Me.lookupAccount.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo), New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Clear)})
Me.lookupAccount.Properties.NullText = "" Me.lookupAccount.Properties.NullText = ""
Me.lookupAccount.Properties.PopupSizeable = False Me.lookupAccount.Properties.PopupSizeable = False
Me.lookupAccount.Properties.PopupView = Me.GridView1 Me.lookupAccount.Properties.PopupView = Me.GridView1
Me.lookupAccount.Size = New System.Drawing.Size(179, 20) Me.lookupAccount.Size = New System.Drawing.Size(171, 20)
Me.lookupAccount.StyleController = Me.LayoutControl1 Me.lookupAccount.StyleController = Me.LayoutControl1
Me.lookupAccount.TabIndex = 7 Me.lookupAccount.TabIndex = 7
' '
@ -520,44 +520,44 @@ Partial Class frmExportMain
' '
'txtDocumentFrom 'txtDocumentFrom
' '
Me.txtDocumentFrom.Location = New System.Drawing.Point(104, 135) Me.txtDocumentFrom.Location = New System.Drawing.Point(112, 135)
Me.txtDocumentFrom.MenuManager = Me.RibbonControl1 Me.txtDocumentFrom.MenuManager = Me.RibbonControl1
Me.txtDocumentFrom.Name = "txtDocumentFrom" Me.txtDocumentFrom.Name = "txtDocumentFrom"
Me.txtDocumentFrom.Size = New System.Drawing.Size(179, 20) Me.txtDocumentFrom.Size = New System.Drawing.Size(171, 20)
Me.txtDocumentFrom.StyleController = Me.LayoutControl1 Me.txtDocumentFrom.StyleController = Me.LayoutControl1
Me.txtDocumentFrom.TabIndex = 10 Me.txtDocumentFrom.TabIndex = 10
' '
'txtDocumentTo 'txtDocumentTo
' '
Me.txtDocumentTo.Location = New System.Drawing.Point(104, 165) Me.txtDocumentTo.Location = New System.Drawing.Point(112, 165)
Me.txtDocumentTo.MenuManager = Me.RibbonControl1 Me.txtDocumentTo.MenuManager = Me.RibbonControl1
Me.txtDocumentTo.Name = "txtDocumentTo" Me.txtDocumentTo.Name = "txtDocumentTo"
Me.txtDocumentTo.Size = New System.Drawing.Size(179, 20) Me.txtDocumentTo.Size = New System.Drawing.Size(171, 20)
Me.txtDocumentTo.StyleController = Me.LayoutControl1 Me.txtDocumentTo.StyleController = Me.LayoutControl1
Me.txtDocumentTo.TabIndex = 11 Me.txtDocumentTo.TabIndex = 11
' '
'dateDocDateTo 'dateDocDateTo
' '
Me.dateDocDateTo.EditValue = Nothing Me.dateDocDateTo.EditValue = Nothing
Me.dateDocDateTo.Location = New System.Drawing.Point(104, 225) Me.dateDocDateTo.Location = New System.Drawing.Point(112, 225)
Me.dateDocDateTo.MenuManager = Me.RibbonControl1 Me.dateDocDateTo.MenuManager = Me.RibbonControl1
Me.dateDocDateTo.Name = "dateDocDateTo" Me.dateDocDateTo.Name = "dateDocDateTo"
Me.dateDocDateTo.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}) Me.dateDocDateTo.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)})
Me.dateDocDateTo.Properties.CalendarTimeProperties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}) Me.dateDocDateTo.Properties.CalendarTimeProperties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)})
Me.dateDocDateTo.Size = New System.Drawing.Size(179, 20) Me.dateDocDateTo.Size = New System.Drawing.Size(171, 20)
Me.dateDocDateTo.StyleController = Me.LayoutControl1 Me.dateDocDateTo.StyleController = Me.LayoutControl1
Me.dateDocDateTo.TabIndex = 12 Me.dateDocDateTo.TabIndex = 12
' '
'comboDocumentType 'comboDocumentType
' '
Me.comboDocumentType.Location = New System.Drawing.Point(104, 75) Me.comboDocumentType.Location = New System.Drawing.Point(112, 45)
Me.comboDocumentType.MenuManager = Me.RibbonControl1 Me.comboDocumentType.MenuManager = Me.RibbonControl1
Me.comboDocumentType.Name = "comboDocumentType" Me.comboDocumentType.Name = "comboDocumentType"
Me.comboDocumentType.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo), New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Clear)}) Me.comboDocumentType.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)})
Me.comboDocumentType.Properties.NullText = "" Me.comboDocumentType.Properties.NullText = ""
Me.comboDocumentType.Properties.PopupSizeable = False Me.comboDocumentType.Properties.PopupSizeable = False
Me.comboDocumentType.Properties.PopupView = Me.GridView3 Me.comboDocumentType.Properties.PopupView = Me.GridView3
Me.comboDocumentType.Size = New System.Drawing.Size(179, 20) Me.comboDocumentType.Size = New System.Drawing.Size(171, 20)
Me.comboDocumentType.StyleController = Me.LayoutControl1 Me.comboDocumentType.StyleController = Me.LayoutControl1
Me.comboDocumentType.TabIndex = 13 Me.comboDocumentType.TabIndex = 13
' '
@ -570,12 +570,12 @@ Partial Class frmExportMain
' '
'comboDocumentKind 'comboDocumentKind
' '
Me.comboDocumentKind.Location = New System.Drawing.Point(104, 45) Me.comboDocumentKind.Location = New System.Drawing.Point(112, 75)
Me.comboDocumentKind.MenuManager = Me.RibbonControl1 Me.comboDocumentKind.MenuManager = Me.RibbonControl1
Me.comboDocumentKind.Name = "comboDocumentKind" Me.comboDocumentKind.Name = "comboDocumentKind"
Me.comboDocumentKind.Properties.AllowMultiSelect = True Me.comboDocumentKind.Properties.AllowMultiSelect = True
Me.comboDocumentKind.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo), New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Clear)}) Me.comboDocumentKind.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo), New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Clear)})
Me.comboDocumentKind.Size = New System.Drawing.Size(179, 20) Me.comboDocumentKind.Size = New System.Drawing.Size(171, 20)
Me.comboDocumentKind.StyleController = Me.LayoutControl1 Me.comboDocumentKind.StyleController = Me.LayoutControl1
Me.comboDocumentKind.TabIndex = 14 Me.comboDocumentKind.TabIndex = 14
' '
@ -583,7 +583,7 @@ Partial Class frmExportMain
' '
Me.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.[True] Me.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.[True]
Me.Root.GroupBordersVisible = False Me.Root.GroupBordersVisible = False
Me.Root.Items.AddRange(New DevExpress.XtraLayout.BaseLayoutItem() {Me.LayoutControlItem1, Me.EmptySpaceItem1, Me.LayoutControlItem3, Me.LayoutControlItem2, Me.LayoutControlItem5, Me.LayoutControlItem6, Me.LayoutControlItem7, Me.LayoutControlItem8, Me.LayoutControlItem9, Me.LayoutControlItem10}) Me.Root.Items.AddRange(New DevExpress.XtraLayout.BaseLayoutItem() {Me.LayoutControlItem1, Me.EmptySpaceItem1, Me.LayoutControlItem3, Me.LayoutControlItem2, Me.LayoutControlItem5, Me.LayoutControlItem6, Me.LayoutControlItem7, Me.LayoutControlItem8, Me.LayoutControlItem10, Me.LayoutControlItem9})
Me.Root.Name = "Root" Me.Root.Name = "Root"
Me.Root.Size = New System.Drawing.Size(298, 538) Me.Root.Size = New System.Drawing.Size(298, 538)
Me.Root.TextVisible = False Me.Root.TextVisible = False
@ -596,7 +596,7 @@ Partial Class frmExportMain
Me.LayoutControlItem1.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5) Me.LayoutControlItem1.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5)
Me.LayoutControlItem1.Size = New System.Drawing.Size(278, 30) Me.LayoutControlItem1.Size = New System.Drawing.Size(278, 30)
Me.LayoutControlItem1.Text = "Mandant" Me.LayoutControlItem1.Text = "Mandant"
Me.LayoutControlItem1.TextSize = New System.Drawing.Size(77, 13) Me.LayoutControlItem1.TextSize = New System.Drawing.Size(85, 13)
' '
'EmptySpaceItem1 'EmptySpaceItem1
' '
@ -614,7 +614,7 @@ Partial Class frmExportMain
Me.LayoutControlItem3.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5) Me.LayoutControlItem3.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5)
Me.LayoutControlItem3.Size = New System.Drawing.Size(278, 30) Me.LayoutControlItem3.Size = New System.Drawing.Size(278, 30)
Me.LayoutControlItem3.Text = "Konto" Me.LayoutControlItem3.Text = "Konto"
Me.LayoutControlItem3.TextSize = New System.Drawing.Size(77, 13) Me.LayoutControlItem3.TextSize = New System.Drawing.Size(85, 13)
' '
'LayoutControlItem2 'LayoutControlItem2
' '
@ -624,7 +624,7 @@ Partial Class frmExportMain
Me.LayoutControlItem2.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5) Me.LayoutControlItem2.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5)
Me.LayoutControlItem2.Size = New System.Drawing.Size(278, 30) Me.LayoutControlItem2.Size = New System.Drawing.Size(278, 30)
Me.LayoutControlItem2.Text = "Belegdatum Von" Me.LayoutControlItem2.Text = "Belegdatum Von"
Me.LayoutControlItem2.TextSize = New System.Drawing.Size(77, 13) Me.LayoutControlItem2.TextSize = New System.Drawing.Size(85, 13)
' '
'LayoutControlItem5 'LayoutControlItem5
' '
@ -643,7 +643,7 @@ Partial Class frmExportMain
Me.LayoutControlItem6.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5) Me.LayoutControlItem6.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5)
Me.LayoutControlItem6.Size = New System.Drawing.Size(278, 30) Me.LayoutControlItem6.Size = New System.Drawing.Size(278, 30)
Me.LayoutControlItem6.Text = "BelegNr Von" Me.LayoutControlItem6.Text = "BelegNr Von"
Me.LayoutControlItem6.TextSize = New System.Drawing.Size(77, 13) Me.LayoutControlItem6.TextSize = New System.Drawing.Size(85, 13)
' '
'LayoutControlItem7 'LayoutControlItem7
' '
@ -653,7 +653,7 @@ Partial Class frmExportMain
Me.LayoutControlItem7.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5) Me.LayoutControlItem7.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5)
Me.LayoutControlItem7.Size = New System.Drawing.Size(278, 30) Me.LayoutControlItem7.Size = New System.Drawing.Size(278, 30)
Me.LayoutControlItem7.Text = "BelegNr Bis" Me.LayoutControlItem7.Text = "BelegNr Bis"
Me.LayoutControlItem7.TextSize = New System.Drawing.Size(77, 13) Me.LayoutControlItem7.TextSize = New System.Drawing.Size(85, 13)
' '
'LayoutControlItem8 'LayoutControlItem8
' '
@ -663,31 +663,31 @@ Partial Class frmExportMain
Me.LayoutControlItem8.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5) Me.LayoutControlItem8.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5)
Me.LayoutControlItem8.Size = New System.Drawing.Size(278, 30) Me.LayoutControlItem8.Size = New System.Drawing.Size(278, 30)
Me.LayoutControlItem8.Text = "Belegdatum Bis" Me.LayoutControlItem8.Text = "Belegdatum Bis"
Me.LayoutControlItem8.TextSize = New System.Drawing.Size(77, 13) Me.LayoutControlItem8.TextSize = New System.Drawing.Size(85, 13)
'
'LayoutControlItem9
'
Me.LayoutControlItem9.Control = Me.comboDocumentType
Me.LayoutControlItem9.Location = New System.Drawing.Point(0, 60)
Me.LayoutControlItem9.Name = "LayoutControlItem9"
Me.LayoutControlItem9.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5)
Me.LayoutControlItem9.Size = New System.Drawing.Size(278, 30)
Me.LayoutControlItem9.Text = "Belegtyp"
Me.LayoutControlItem9.TextSize = New System.Drawing.Size(77, 13)
' '
'LayoutControlItem10 'LayoutControlItem10
' '
Me.LayoutControlItem10.Control = Me.comboDocumentKind Me.LayoutControlItem10.Control = Me.comboDocumentKind
Me.LayoutControlItem10.Location = New System.Drawing.Point(0, 30) Me.LayoutControlItem10.Location = New System.Drawing.Point(0, 60)
Me.LayoutControlItem10.Name = "LayoutControlItem10" Me.LayoutControlItem10.Name = "LayoutControlItem10"
Me.LayoutControlItem10.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5) Me.LayoutControlItem10.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5)
Me.LayoutControlItem10.Size = New System.Drawing.Size(278, 30) Me.LayoutControlItem10.Size = New System.Drawing.Size(278, 30)
Me.LayoutControlItem10.Text = "Belegart" Me.LayoutControlItem10.Text = "Belegart"
Me.LayoutControlItem10.TextSize = New System.Drawing.Size(77, 13) Me.LayoutControlItem10.TextSize = New System.Drawing.Size(85, 13)
'
'LayoutControlItem9
'
Me.LayoutControlItem9.Control = Me.comboDocumentType
Me.LayoutControlItem9.Location = New System.Drawing.Point(0, 30)
Me.LayoutControlItem9.Name = "LayoutControlItem9"
Me.LayoutControlItem9.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5)
Me.LayoutControlItem9.Size = New System.Drawing.Size(278, 30)
Me.LayoutControlItem9.Text = "Belegtyp"
Me.LayoutControlItem9.TextSize = New System.Drawing.Size(85, 13)
' '
'LabelControl2 'LabelControl2
' '
Me.LabelControl2.Appearance.Font = New System.Drawing.Font("Tahoma", 48.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.LabelControl2.Appearance.Font = New System.Drawing.Font("Tahoma", 48.0!)
Me.LabelControl2.Appearance.ForeColor = System.Drawing.Color.Silver Me.LabelControl2.Appearance.ForeColor = System.Drawing.Color.Silver
Me.LabelControl2.Appearance.Options.UseFont = True Me.LabelControl2.Appearance.Options.UseFont = True
Me.LabelControl2.Appearance.Options.UseForeColor = True Me.LabelControl2.Appearance.Options.UseForeColor = True
@ -770,8 +770,8 @@ Partial Class frmExportMain
CType(Me.LayoutControlItem6, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.LayoutControlItem6, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.LayoutControlItem7, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.LayoutControlItem7, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.LayoutControlItem8, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.LayoutControlItem8, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.LayoutControlItem9, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.LayoutControlItem10, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.LayoutControlItem10, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.LayoutControlItem9, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False) Me.ResumeLayout(False)
Me.PerformLayout() Me.PerformLayout()

View File

@ -89,7 +89,13 @@ Public Class frmExportMain
Select(AddressOf MapDocumentTypeFromEnum). Select(AddressOf MapDocumentTypeFromEnum).
ToList() ToList()
Dim oDocType = CurrentTemplate.GetParameter("DOCTYPE")
Dim oPreselectedDocType As Integer = 0
If oDocType IsNot Nothing Then
Integer.TryParse(oDocType, oPreselectedDocType)
End If
comboDocumentType.EditValue = oPreselectedDocType
If ConfigManager.Config.LastUsedMandator <> "" Then If ConfigManager.Config.LastUsedMandator <> "" Then
lookupMandator.EditValue = Winline.Mandators. lookupMandator.EditValue = Winline.Mandators.
@ -101,8 +107,15 @@ Public Class frmExportMain
End Try End Try
End Sub End Sub
Private Function MapDocumentTypeToEnum(Of T)(pValue As Integer) As T
Return [Enum].Parse(GetType(T), pValue)
End Function
Private Function MapDocumentTypeFromEnum(pValue As WinlineData.DocumentType) Private Function MapDocumentTypeFromEnum(pValue As WinlineData.DocumentType)
Select Case pValue Select Case pValue
Case WinlineData.DocumentType.Undefined
Return New KeyValuePair(Of String, Integer)("Alle", pValue)
Case WinlineData.DocumentType.IncomingOffer Case WinlineData.DocumentType.IncomingOffer
Return New KeyValuePair(Of String, Integer)("Angebot EK", pValue) Return New KeyValuePair(Of String, Integer)("Angebot EK", pValue)
@ -156,7 +169,7 @@ Public Class frmExportMain
ConfigManager.Save() ConfigManager.Save()
End Sub End Sub
Private Sub lookup_Properties_ButtonClick(sender As Object, e As DevExpress.XtraEditors.Controls.ButtonPressedEventArgs) Handles comboDocumentKind.Properties.ButtonClick, lookupAccount.Properties.ButtonClick, comboDocumentType.ButtonClick Private Sub lookup_Properties_ButtonClick(sender As Object, e As DevExpress.XtraEditors.Controls.ButtonPressedEventArgs) Handles lookupAccount.Properties.ButtonClick
Dim oLookup As GridLookUpEdit = sender Dim oLookup As GridLookUpEdit = sender
If e.Button.Kind = DevExpress.XtraEditors.Controls.ButtonPredefines.Clear Then If e.Button.Kind = DevExpress.XtraEditors.Controls.ButtonPredefines.Clear Then
oLookup.EditValue = Nothing oLookup.EditValue = Nothing
@ -170,9 +183,6 @@ Public Class frmExportMain
End If End If
End Sub End Sub
Private Sub SearchDocuments() Private Sub SearchDocuments()
Try Try
dateDocDateFrom.DoValidate() dateDocDateFrom.DoValidate()
@ -189,6 +199,7 @@ Public Class frmExportMain
Dim oDocNumberFrom = Utils.NotNull(txtDocumentFrom.EditValue, String.Empty) Dim oDocNumberFrom = Utils.NotNull(txtDocumentFrom.EditValue, String.Empty)
Dim oDocNumberTo = Utils.NotNull(txtDocumentTo.EditValue, String.Empty) Dim oDocNumberTo = Utils.NotNull(txtDocumentTo.EditValue, String.Empty)
Dim oDocType As WinlineData.DocumentType = MapDocumentTypeToEnum(Of WinlineData.DocumentType)(comboDocumentType.EditValue)
If oMandator Is Nothing Then If oMandator Is Nothing Then
FormHelper.ShowWarning("Bitte einen Mandanten auswählen!") FormHelper.ShowWarning("Bitte einen Mandanten auswählen!")
@ -196,7 +207,7 @@ Public Class frmExportMain
End If End If
'TODO: Make Document Type configurable 'TODO: Make Document Type configurable
Dim oDocuments = Winline.GetDocuments(oMandator, CurrentTemplate, comboDocumentType.EditValue, New WinlineData.GetDocumentArgs With { Dim oDocuments = Winline.GetDocuments(oMandator, CurrentTemplate, oDocType, New WinlineData.GetDocumentArgs With {
.Account = oAccount, .Account = oAccount,
.Kinds = oKinds, .Kinds = oKinds,
.DateFrom = oDateFrom, .DateFrom = oDateFrom,

View File

@ -52,6 +52,21 @@ Namespace Documents
End Get End Get
End Property End Property
''' <summary>
''' Finds the first occurrence of Field and returns its value
''' </summary>
Public Function GetFieldValue(pField As String) As String
For Each oRow In Rows
For Each oField In oRow.Fields
If oField.Key = pField Then
Return oField.Value.Final
End If
Next
Next
Return Nothing
End Function
Public Overrides Function Equals(obj As Object) As Boolean Public Overrides Function Equals(obj As Object) As Boolean
Return FullName = DirectCast(obj, Document).FullName Return FullName = DirectCast(obj, Document).FullName
End Function End Function

View File

@ -86,6 +86,11 @@ Namespace Documents
End Try End Try
End Function End Function
Public Sub ReplaceDocument(pDocument As Document)
Dim oIndex = Files.IndexOf(pDocument)
Files.Item(oIndex) = pDocument
End Sub
Private Function IncludeSchema(pDocument As Document, pTemplate As Template) As Document Private Function IncludeSchema(pDocument As Document, pTemplate As Template) As Document
pDocument.Schema = pTemplate pDocument.Schema = pTemplate
@ -243,7 +248,9 @@ Namespace Documents
Else Else
pDocument = ApplyDefinedItemFunctionsForImport(pDocument, oMandator, pTemplate) pDocument = ApplyDefinedItemFunctionsForImport(pDocument, oMandator, pTemplate)
pDocument = ApplyDynamicItemFunctionsForImport(pDocument, oMandator) pDocument = ApplyDynamicItemFunctionsForImport(pDocument, oMandator)
pDocument = ApplyPriceFunctions(pDocument, oMandator, pTemplate)
' These functions will only be applied if the document does not have errors
pDocument = MaybeApplyPriceFunctions(pDocument, oMandator, pTemplate)
End If End If
pDocument.Mandator = oMandator pDocument.Mandator = oMandator
@ -256,7 +263,11 @@ Namespace Documents
''' This needs to be strictly seperated from `ApplyDefinedItemFunctionsForImport` ''' This needs to be strictly seperated from `ApplyDefinedItemFunctionsForImport`
''' because prices can only be calculated if GLN and EAN functions were already (successfully) processed ''' because prices can only be calculated if GLN and EAN functions were already (successfully) processed
''' </summary> ''' </summary>
Private Function ApplyPriceFunctions(pDocument As Document, pMandator As Mandator, pTemplate As Template) As Document Public Function MaybeApplyPriceFunctions(pDocument As Document, pMandator As Mandator, pTemplate As Template) As Document
If pDocument.HasErrors Then
Return pDocument
End If
For Each oRow As DocumentRow In pDocument.Rows For Each oRow As DocumentRow In pDocument.Rows
Dim oTable = pTemplate.Tables.Where(Function(table) table.Name = oRow.TableName).SingleOrDefault() Dim oTable = pTemplate.Tables.Where(Function(table) table.Name = oRow.TableName).SingleOrDefault()
@ -273,16 +284,20 @@ Namespace Documents
Dim oFunctionName = oColumn.Config?.Function?.Name Dim oFunctionName = oColumn.Config?.Function?.Name
' TODO: Make more nice ' TODO: Make more nice
Dim oParams = oColumn.Config?.Function.Params Dim oParams = oColumn.Config?.Function?.Params
Dim oParamList = oParams.Split("|").ToList()
Dim oParamsDict As New Dictionary(Of String, String) Dim oParamsDict As New Dictionary(Of String, String)
If oParams IsNot Nothing AndAlso oParams <> String.Empty Then
Dim oParamList = oParams.Split("|").ToList()
For Each oParam In oParamList For Each oParam In oParamList
Dim oParamSplit = oParam.Split("=") Dim oParamSplit = oParam.Split("=")
oParamsDict.Add(oParamSplit(0), oParamSplit(1)) oParamsDict.Add(oParamSplit(0), oParamSplit(1))
Next Next
End If
If oFunctionName = "PRICE" Then If oFunctionName = "PRICE" Then
SetPrice(oRow, oField.Key, oParamsDict, pMandator, pTemplate) SetPrice(oRow, oField.Key, oParamsDict, pDocument, pMandator, pTemplate)
End If End If
Next Next
Next Next
@ -363,17 +378,23 @@ Namespace Documents
Return pDocument Return pDocument
End Function End Function
Private Sub SetPrice(pRow As DocumentRow, pPriceField As String, oFieldMap As Dictionary(Of String, String), pMandator As Mandator, pTemplate As Template) Private Sub SetPrice(pRow As DocumentRow, pPriceField As String, oFieldMap As Dictionary(Of String, String), pDocument As Document, pMandator As Mandator, pTemplate As Template)
Dim oPriceItem As DocumentRow.FieldValue = pRow.Fields.GetOrDefault(pPriceField) Dim oPriceItem As DocumentRow.FieldValue = pRow.Fields.GetOrDefault(pPriceField)
Dim oArticleNumberField As String = oFieldMap.GetOrDefault("Article", Nothing)
Dim oAccountNumberField As String = oFieldMap.GetOrDefault("Account", Nothing)
Dim oDocumentDateField As String = oFieldMap.GetOrDefault("DocumentDate", Nothing)
' These fields are fetched from the current row
Dim oArticleNumberField As String = oFieldMap.GetOrDefault("Article", Nothing)
Dim oArticleNumber As String = pRow.Fields.Item(oArticleNumberField).Final
' These fields a fetched from the head row, ie. the first row
Dim oAccountNumberField As String = oFieldMap.GetOrDefault("Account", Nothing)
Dim oAccountNumber = pDocument.GetFieldValue(oAccountNumberField)
Dim oDocumentDateField As String = oFieldMap.GetOrDefault("DocumentDate", Nothing)
Dim oDocumentDate = pDocument.GetFieldValue(oDocumentDateField)
' TODO: Add Field Names as Constants
' TODO: Check for missing values ' TODO: Check for missing values
Dim oArticleNumber As String = pRow.Fields.Item(oArticleNumberField).Final
Dim oAccountNumber As String = pRow.Fields.Item(oAccountNumberField).Final
Dim oDocumentDate As Date = pRow.Fields.Item(oDocumentDateField).Final
Dim oQuantity As Integer = 1 Dim oQuantity As Integer = 1
Dim oArticlePrice As Double = Winline.TryGetArticlePrice(oArticleNumber, oAccountNumber, oQuantity, oDocumentDate, pMandator, pTemplate) Dim oArticlePrice As Double = Winline.TryGetArticlePrice(oArticleNumber, oAccountNumber, oQuantity, oDocumentDate, pMandator, pTemplate)

View File

@ -1,4 +1,7 @@
Namespace Templates Imports DigitalData.Modules.Language
Namespace Templates
Public Class Template Public Class Template
Public Property Guid As Integer Public Property Guid As Integer
Public Property Name As String Public Property Name As String
@ -33,6 +36,38 @@
End Get End Get
End Property End Property
Public Function GetParameter(pName As String) As String
Dim oParam1 As String = Utils.NotNull(Parameter1, String.Empty)
Dim oParam2 As String = Utils.NotNull(Parameter2, String.Empty)
Dim oParamValue1 = TryGetParameter(oParam1)
Dim oParamValue2 = TryGetParameter(oParam2)
If oParamValue1 IsNot Nothing AndAlso oParamValue1.Item1 = pName Then
Return oParamValue1.Item2
End If
If oParamValue2 IsNot Nothing AndAlso oParamValue2.Item1 = pName Then
Return oParamValue2.Item2
End If
Return Nothing
End Function
Private Function TryGetParameter(pParameterString As String) As Tuple(Of String, String)
If pParameterString <> String.Empty Then
Dim oSplit = pParameterString.Split("=").ToList()
If oSplit.Count = 2 Then
Return New Tuple(Of String, String)(oSplit.First, oSplit.Last)
Else
Return Nothing
End If
Else
Return Nothing
End If
End Function
Class Table Class Table
Public Property Name As String Public Property Name As String
Public Property Columns As New List(Of Column) Public Property Columns As New List(Of Column)

View File

@ -10,7 +10,6 @@ Namespace Winline
Public Class WinlineData Public Class WinlineData
Inherits BaseClass Inherits BaseClass
Private ReadOnly Property Database As MSSQLServer
Private ReadOnly Property Config As GeneralConfig Private ReadOnly Property Config As GeneralConfig
Private ReadOnly Property MandatorConfig As MandatorConfig Private ReadOnly Property MandatorConfig As MandatorConfig
Private ReadOnly Property MappingConfig As MappingConfig Private ReadOnly Property MappingConfig As MappingConfig
@ -24,23 +23,23 @@ Namespace Winline
Public Years As List(Of Integer) Public Years As List(Of Integer)
Public Sub New(pLogConfig As LogConfig, pDatabase As MSSQLServer, pConfig As GeneralConfig, pMappingConfig As MappingConfig, pMandatorConfig As MandatorConfig) Public Sub New(pLogConfig As LogConfig, pDatabase As MSSQLServer, pConfig As GeneralConfig, pMappingConfig As MappingConfig, pMandatorConfig As MandatorConfig)
MyBase.New(pLogConfig) MyBase.New(pLogConfig, pDatabase)
Patterns = New Patterns(pLogConfig, pConfig) Patterns = New Patterns(pLogConfig, pConfig)
Database = pDatabase
Config = pConfig Config = pConfig
MandatorConfig = pMandatorConfig MandatorConfig = pMandatorConfig
MappingConfig = pMappingConfig MappingConfig = pMappingConfig
End Sub End Sub
Public Enum DocumentType Public Enum DocumentType
OutgoingOffer = 1 Undefined
OutgoingOrder = 2 OutgoingOffer
OutgoingDeliveryNote = 3 OutgoingOrder
OutgoingInvoice = 4 OutgoingDeliveryNote
IncomingOffer = -1 OutgoingInvoice
IncomingOrder = -2 IncomingOffer
IncomingDeliveryNote = -3 IncomingOrder
IncomingInvoice = -4 IncomingDeliveryNote
IncomingInvoice
End Enum End Enum
Public Class GetDocumentArgs Public Class GetDocumentArgs
@ -308,17 +307,18 @@ Namespace Winline
Try Try
Dim oYear As Integer = Config.GetWinLineYear() Dim oYear As Integer = Config.GetWinLineYear()
Dim oSQL As String = $" Dim oSQL As String = $"
EXECUTE [PRCUST_GET_ACCOUNT_PRICE_CONDITION_VALUES] EXECUTE [{pMandator.Database}].[dbo].[PRCUST_GET_ACCOUNT_PRICE_CONDITION_VALUES]
'{pAccountNumber}', '{pAccountNumber}',
'*', '*',
'{pArticle}', '{pArticle}',
'{pQuantity}', '{pQuantity}',
{pDocumentDate:yyyy-MM-dd}, '{pDocumentDate:dd.MM.yyyy}',
{pDocumentDate:yyyy-MM-dd}, '{pDocumentDate:dd.MM.yyyy}',
'{pMandator.Id}', '{pMandator.Id}',
{oYear}, {oYear},
1008, 1008,
NULL, NULL,
1,
'Multitool/{pTemplate.Name}', 'Multitool/{pTemplate.Name}',
'CalcPricing' 'CalcPricing'
" "
@ -567,14 +567,39 @@ Namespace Winline
Return Nothing Return Nothing
End Function End Function
Public Function GetDocuments(pMandator As Mandator, pTemplate As Template, pDocumentType As Integer, pOptions As GetDocumentArgs) As List(Of ExportDocument) Public Function GetDocuments(pMandator As Mandator, pTemplate As Template, pDocumentType As DocumentType, pOptions As GetDocumentArgs) As List(Of ExportDocument)
Try Try
Dim oYear As Integer = Config.GetWinLineYear() Dim oYear As Integer = Config.GetWinLineYear()
Dim oTypeConstraint = "" Dim oTypeConstraint
If pDocumentType <> 0 Then Select Case pDocumentType
oTypeConstraint = $"T.c139 = {pDocumentType} AND " Case DocumentType.OutgoingOffer
End If oTypeConstraint = $"T.c137 = 1 AND c139 = 1 AND "
Case DocumentType.OutgoingOffer
oTypeConstraint = $"T.c137 = 1 AND c139 = 2 AND "
Case DocumentType.OutgoingDeliveryNote
oTypeConstraint = $"T.c137 = 1 AND (c139 = 3 OR c139 = -3) AND "
Case DocumentType.OutgoingInvoice
oTypeConstraint = $"T.c137 = 1 AND c139 = 4 AND "
Case DocumentType.IncomingOffer
oTypeConstraint = $"T.c137 = 2 AND c139 = 1 AND "
Case DocumentType.IncomingOrder
oTypeConstraint = $"T.c137 = 2 AND c139 = 2 AND "
Case DocumentType.IncomingDeliveryNote
oTypeConstraint = $"T.c137 = 2 AND c139 = 3 AND "
Case DocumentType.IncomingInvoice
oTypeConstraint = $"T.c137 = 2 AND c139 = 4 AND "
Case Else
oTypeConstraint = ""
End Select
Dim oAccountConstraint = "" Dim oAccountConstraint = ""
If pOptions.Account IsNot Nothing Then If pOptions.Account IsNot Nothing Then