523 lines
24 KiB
VB.net
523 lines
24 KiB
VB.net
Imports System
|
|
Imports System.ComponentModel
|
|
Imports DevExpress.Xpo
|
|
Imports DevExpress.Data.Filtering
|
|
|
|
Imports DevExpress.ExpressApp
|
|
Imports DevExpress.Persistent.Base
|
|
Imports DevExpress.Persistent.BaseImpl
|
|
Imports DevExpress.Persistent.Validation
|
|
Imports DevExpress.Persistent.Base.General
|
|
Imports System.Data.SqlClient
|
|
Imports System.Configuration
|
|
Imports System.Linq
|
|
Imports System.Linq.Expressions
|
|
Imports DevExpress.ExpressApp.ConditionalAppearance
|
|
'<Appearance("Disable, all properties when IsEditable = False GLBank",
|
|
' AppearanceItemType:="ViewItem",
|
|
' TargetItems:="*",
|
|
' Criteria:="IsEditable=False",
|
|
' Enabled:=False,
|
|
' Context:="DetailView")> _
|
|
<DefaultClassOptions()> _
|
|
<NavigationItem("FinancialTransactions")> _
|
|
<DefaultProperty("DisplayName")> _
|
|
<Appearance("Hide properties if Correction",
|
|
AppearanceItemType:="ViewItem",
|
|
TargetItems:="row_AmountDEV;row_CurrencyRate2;row_CurrencyRate;row_CurrencyName2;row_AmountDEV2",
|
|
Criteria:="row_TransactionType in (5,6)",
|
|
Visibility:=Editors.ViewItemVisibility.Hide)> _
|
|
<Appearance("Hide row_AmountDEV in GLBank",
|
|
AppearanceItemType:="ViewItem",
|
|
TargetItems:="row_AmountDEV",
|
|
Criteria:="LiquidAssets_Main.CurrencyName.ShortName = 'HUF'",
|
|
Visibility:=Editors.ViewItemVisibility.Hide)> _
|
|
<Appearance("Hide row_CurrencyRate in GLBank",
|
|
TargetItems:="row_CurrencyRate",
|
|
Criteria:="LiquidAssets_Main.CurrencyName.ShortName = 'HUF' and row_CurrencyName2.ShortName='HUF'",
|
|
Visibility:=Editors.ViewItemVisibility.Hide)> _
|
|
<Appearance("Hide row_CurrencyRate2 in GLBank",
|
|
TargetItems:="row_CurrencyRate2",
|
|
Criteria:="LiquidAssets_Main.CurrencyName.ShortName = row_CurrencyName2.ShortName",
|
|
Visibility:=Editors.ViewItemVisibility.Hide)> _
|
|
<Appearance("Hide row_CurrencyRate2 in GLBank and HUF",
|
|
TargetItems:="row_CurrencyRate2",
|
|
Criteria:="LiquidAssets_Main.CurrencyName.ShortName ='HUF' or row_CurrencyName2.ShortName='HUF'",
|
|
Visibility:=Editors.ViewItemVisibility.Hide)> _
|
|
<Appearance("ChartOfAccounts-hide",
|
|
TargetItems:="row_ChartOfAccounts",
|
|
Criteria:="row_TransactionType in (0,1) OR IsEditable=False",
|
|
Visibility:=Editors.ViewItemVisibility.Hide)> _
|
|
<Appearance("Normal transactions hide",
|
|
TargetItems:="row_CurrencyName2;row_CurrencyRate2",
|
|
Criteria:="row_TransactionType in (2,3,4) OR IsEditable=False",
|
|
Visibility:=Editors.ViewItemVisibility.Hide)> _
|
|
<Appearance("Partnerconnection-hide",
|
|
TargetItems:="row_PCIGroup;row_PartnerType",
|
|
Criteria:="row_TransactionType in (2,3) OR IsEditable=False",
|
|
Visibility:=Editors.ViewItemVisibility.Hide)> _
|
|
<Appearance("Hide GLCassa-LiquidAssets",
|
|
AppearanceItemType:="ViewItem",
|
|
TargetItems:="LiquidAssets_Main",
|
|
Criteria:="(IsNull(LiquidAssets_Main))=False",
|
|
Enabled:=False,
|
|
Context:="DetailView")> _
|
|
<Appearance("Hide DEV info in HUF",
|
|
AppearanceItemType:="ViewItem",
|
|
TargetItems:="TotalInAmountDEV;TotalOutAmountDEV;BallanceDEV;CloseDEV",
|
|
Criteria:="CurrencyName.ShortName='HUF'",
|
|
Visibility:=Editors.ViewItemVisibility.Hide,
|
|
Context:="DetailView")> _
|
|
<Appearance("Hide HUF info in DEV",
|
|
AppearanceItemType:="ViewItem",
|
|
TargetItems:="TotalInAmountHUF;TotalOutAmountHUF;BallanceHUF;CloseHUF",
|
|
Criteria:="CurrencyName.ShortName!='HUF'",
|
|
Visibility:=Editors.ViewItemVisibility.Hide,
|
|
Context:="DetailView")> _
|
|
<Appearance("Disable GLBank.row_AmountHUF when DEV != HUF",
|
|
AppearanceItemType:="ViewItem",
|
|
TargetItems:="row_AmountHUF",
|
|
Criteria:="LiquidAssets_Main.CurrencyName.ShortName != 'HUF' and not (row_TransactionType in (5,6))",
|
|
Enabled:=False,
|
|
Context:="DetailView")> _
|
|
<Appearance("Hide row_Amount2 when CurrencyName2=CurrencyName",
|
|
AppearanceItemType:="ViewItem",
|
|
criteria:="row_CurrencyName2.ShortName=LiquidAssets_Main.CurrencyName.ShortName",
|
|
TargetItems:="row_CurrencyRate2;row_AmountDEV2",
|
|
visibility:=Editors.ViewItemVisibility.Hide)> _
|
|
<Appearance("Hide row_ info when IsEditable=False",
|
|
AppearanceItemType:="ViewItem",
|
|
criteria:="IsEditable=False",
|
|
TargetItems:="row_PartnerType;row_TransactionType;row_ChartOfAccounts;" + _
|
|
"row_PCIGroup;row_AmountDEV2;row_CurrencyRate;row_CurrencyRate2;row_CurrencyName2",
|
|
visibility:=Editors.ViewItemVisibility.Hide)> _
|
|
<Appearance("Hide aImportSavedBank when CurrencyName2=CurrencyName",
|
|
AppearanceItemType:="Action",
|
|
criteria:="LiquidAssets_Main.CurrencyName.ShortName<>'HUF'",
|
|
TargetItems:="aImportSavedBank",
|
|
visibility:=DevExpress.ExpressApp.Editors.ViewItemVisibility.Hide)> _
|
|
<Appearance("Hide aImportPCIGroupBank when row_PartnerType=-1",
|
|
AppearanceItemType:="Action",
|
|
criteria:="row_PartnerType=-1",
|
|
TargetItems:="aImportPCIGroupBank",
|
|
visibility:=DevExpress.ExpressApp.Editors.ViewItemVisibility.Hide)> _
|
|
<Appearance("Hide aGetCurrencyRateBank",
|
|
AppearanceItemType:="Action",
|
|
targetitems:="aGetCurrencyRateBank",
|
|
criteria:="CurrencyName.ShortName='HUF'",
|
|
visibility:=DevExpress.ExpressApp.Editors.ViewItemVisibility.Hide)> _
|
|
<RuleCriteria("RuleCriteria GLAccounts-row_ChartOfAccounts", "aToTable_GLBank_Contexts", "row_ChartOfAccounts.Children.Count=0", "Csak gyermek objektum választható ki!", SkipNullOrEmptyValues:=False)> _
|
|
Public Class GLBank
|
|
Inherits GLHeader
|
|
Private _PartnerType As ePartnerType
|
|
Private _TransactionType As eTransactionType
|
|
|
|
Private _ChartOfAccounts As ChartOfAccounts
|
|
Private _TotalInAmountHUF As Double = 0
|
|
Private _TotalOutAmountHUF As Double = 0
|
|
Private _TotalInAmountDEV As Double = 0
|
|
Private _TotalOutAmountDEV As Double = 0
|
|
Private _LiquidAssets As LiquidAssets
|
|
Private _BallanceHUF As Double
|
|
Private _BallanceDEV As Double
|
|
Private _PCIGroup As PCIGroup
|
|
Private _GLHeader_RateDiff As GLHeader 'Kapcsolódó árf. kül. elszámolási vegyes bizonylat
|
|
|
|
'-- A másodlagos
|
|
Private _row_CurrencyRate As Double
|
|
Private _row_AmountDEV2 As Double = 0
|
|
Private _row_CurrencyRate2 As Double = 0
|
|
Private _row_CurrencyName2 As CurrencyName
|
|
Private _BankImportHeaderSum As BankImportHeaderSum
|
|
Public Sub New(ByVal session As Session)
|
|
MyBase.New(session)
|
|
End Sub
|
|
Public Overrides Sub AfterConstruction()
|
|
MyBase.AfterConstruction()
|
|
If Session.IsNewObject(Me) Then
|
|
Me.GLDocumentType = eGLDocumentType.eGLBank
|
|
Me.DateExecution = Now
|
|
Me.row_PartnerType = ePartnerType.eNotSet
|
|
Me.row_TransactionType = eTransactionType.eNotSet
|
|
End If
|
|
End Sub
|
|
|
|
<NonPersistent()> _
|
|
<VisibleInListView(False)> _
|
|
<RuleValueComparison("GLBank-row_PartnerType", "aToTable_GLBank_Contexts", ValueComparisonType.NotEquals, ePartnerType.eNotSet, TargetCriteria:="row_TransactionType in (0,1)")> _
|
|
Property row_PartnerType() As ePartnerType
|
|
Get
|
|
Return _PartnerType
|
|
End Get
|
|
Set(ByVal value As ePartnerType)
|
|
SetPropertyValue("row_PartnerType", _PartnerType, value)
|
|
End Set
|
|
End Property
|
|
<NonPersistent()> _
|
|
<ImmediatePostData(True)> _
|
|
<VisibleInListView(False)> _
|
|
<RuleValueComparison("GLBank-row_TransactionType", "aToTable_GLBank_Contexts", ValueComparisonType.NotEquals, eTransactionType.eNotSet)> _
|
|
Property row_TransactionType() As eTransactionType
|
|
Get
|
|
Return _TransactionType
|
|
End Get
|
|
Set(ByVal value As eTransactionType)
|
|
SetPropertyValue("row_TransactionType", _TransactionType, value)
|
|
If Session.IsObjectsLoading = False And Session.IsObjectsSaving = False Then
|
|
If LiquidAssets_Main IsNot Nothing Then
|
|
Select Case row_TransactionType
|
|
Case eTransactionType.eNormalCredit, eTransactionType.eNormalDebit, eTransactionType.eNotSet, eTransactionType.eCorrectionCreditHUF, eTransactionType.eCorrectionDebitHUF
|
|
row_PartnerType = ePartnerType.eNotSet
|
|
row_CurrencyName2 = LiquidAssets_Main.CurrencyName
|
|
Case eTransactionType.ePartnerCredit
|
|
row_PartnerType = ePartnerType.eReceivables
|
|
Case eTransactionType.ePartnerDebit
|
|
row_PartnerType = ePartnerType.ePayabels
|
|
End Select
|
|
End If
|
|
End If
|
|
End Set
|
|
End Property
|
|
<NonPersistent()> _
|
|
<DataSourceCriteria("AccountYear=GetYear('@This.DateExecution')")> _
|
|
<RuleRequiredField("GLBank-row_ChartOfAccounts", "aToTable_GLBank_Contexts", TargetCriteria:="row_TransactionType in (2,3,4)")> _
|
|
<VisibleInListView(False)> _
|
|
Property row_ChartOfAccounts() As ChartOfAccounts
|
|
Get
|
|
Return _ChartOfAccounts
|
|
End Get
|
|
Set(ByVal value As ChartOfAccounts)
|
|
SetPropertyValue("row_ChartOfAccounts", _ChartOfAccounts, value)
|
|
End Set
|
|
End Property
|
|
<NonPersistent()> _
|
|
<ImmediatePostData(True)> _
|
|
<DataSourceCriteria("CustomersFrom='@This.CustomersFrom' and PartnerType='@This.row_PartnerType' and BallanceState=0 and isnull(CurrencyName_Account)=False ")> _
|
|
<VisibleInListView(False)> _
|
|
Property row_PCIGroup() As PCIGroup
|
|
Get
|
|
Return _PCIGroup
|
|
End Get
|
|
Set(ByVal value As PCIGroup)
|
|
SetPropertyValue("row_PCIGroup", _PCIGroup, value)
|
|
If Session.IsObjectsLoading = False And Session.IsObjectsSaving = False Then
|
|
If value IsNot Nothing Then
|
|
row_ConnectInfo = value.ConnectInfo
|
|
row_Customer = value.Customers
|
|
row_PartnerType = value.PartnerType
|
|
If value.CurrencyName_Account Is Nothing Then
|
|
If Me.CurrencyName.ShortName = "HUF" Then
|
|
Me.row_AmountHUF = Math.Abs(value.BallanceHUF)
|
|
row_CurrencyName2 = Session.FindObject(Of CurrencyName)(CriteriaOperator.Parse("ShortName='HUF'"))
|
|
Else
|
|
row_CurrencyName2 = Session.FindObject(Of CurrencyName)(CriteriaOperator.Parse("ShortName='HUF'"))
|
|
|
|
End If
|
|
Else
|
|
If value.CurrencyName_Account.ShortName = "HUF" Then
|
|
If Me.CurrencyName.ShortName = "HUF" Then
|
|
Me.row_AmountHUF = Math.Abs(value.BallanceHUF)
|
|
row_CurrencyName2 = Session.FindObject(Of CurrencyName)(CriteriaOperator.Parse("ShortName='HUF'"))
|
|
Else
|
|
row_CurrencyName2 = Session.FindObject(Of CurrencyName)(CriteriaOperator.Parse("ShortName='HUF'"))
|
|
|
|
End If
|
|
Else
|
|
If Me.CurrencyName.ShortName = value.CurrencyName_Account.ShortName Then
|
|
Me.row_AmountDEV = Math.Abs(value.BallanceDEV)
|
|
row_CurrencyName2 = Session.FindObject(Of CurrencyName)(CriteriaOperator.Parse("ShortName=?", value.CurrencyName_Account.ShortName))
|
|
Else
|
|
row_CurrencyName2 = Session.FindObject(Of CurrencyName)(CriteriaOperator.Parse("ShortName=?", value.CurrencyName_Account.ShortName))
|
|
End If
|
|
End If
|
|
End If
|
|
|
|
End If
|
|
End If
|
|
End Set
|
|
End Property
|
|
<ImmediatePostData(True)> _
|
|
<DataSourceCriteria("LiquidAssetsType=1 and CustomerFrom='@This.CustomersFrom'")> _
|
|
<RuleRequiredField("GLBank-LiquidAssets_Cassa", "aFinal_GLBank_Context")> _
|
|
<RuleRequiredField("GLBank-LiquidAssets_Cassa2", "aFinalAndNew_GLBank_Context")> _
|
|
<VisibleInListView(False)> _
|
|
Property LiquidAssets_Main() As LiquidAssets
|
|
Get
|
|
Return _LiquidAssets
|
|
End Get
|
|
Set(ByVal value As LiquidAssets)
|
|
SetPropertyValue("LiquidAssets_Main", _LiquidAssets, value)
|
|
If Session.IsObjectsSaving = False And Session.IsObjectsLoading = False Then
|
|
row_LiquidAssets = value
|
|
row_CurrencyName2 = value.CurrencyName
|
|
If value IsNot Nothing Then
|
|
|
|
Me.CurrencyName = value.CurrencyName
|
|
Me.row_CurrencyName2 = CurrencyName
|
|
|
|
If Me.DateExecution > Now.AddYears(-1) Then
|
|
BallanceHUF = GetBallanceHUF(value, Me.DateExecution)
|
|
BallanceDEV = GetBallanceDEV(value, Me.DateExecution)
|
|
End If
|
|
End If
|
|
End If
|
|
End Set
|
|
End Property
|
|
<NonPersistent()> _
|
|
<ImmediatePostData(True)> _
|
|
<VisibleInListView(False)> _
|
|
<RuleRange("GLBank-row_CurrencyRate", "aToTable_GLBank_Contexts", 0.01, 999999, TargetCriteria:="LiquidAssets_Main.CurrencyName.ShortName != 'HUF' and not (row_TransactionType in (5,6))")> _
|
|
Property row_CurrencyRate As Double
|
|
Get
|
|
Return _row_CurrencyRate
|
|
End Get
|
|
Set(value As Double)
|
|
SetPropertyValue("row_CurrencyRate", _row_CurrencyRate, value)
|
|
If Session.IsObjectsLoading = False And Session.IsObjectsSaving = False Then
|
|
If row_CurrencyName2 Is Nothing Then row_CurrencyName2 = LiquidAssets_Main.CurrencyName
|
|
|
|
If LiquidAssets_Main.CurrencyName.ShortName = "HUF" And row_CurrencyName2.ShortName <> "HUF" Then
|
|
If row_CurrencyRate <> 0 Then row_AmountDEV2 = Math.Round(row_AmountHUF / row_CurrencyRate, 2, MidpointRounding.AwayFromZero)
|
|
End If
|
|
If LiquidAssets_Main.CurrencyName.ShortName <> "HUF" And row_CurrencyName2.ShortName = "HUF" Then
|
|
row_AmountHUF = row_AmountDEV * Math.Round(row_CurrencyRate, 2, MidpointRounding.AwayFromZero)
|
|
row_AmountDEV2 = row_AmountHUF
|
|
End If
|
|
If LiquidAssets_Main.CurrencyName.ShortName <> "HUF" And row_CurrencyName2.ShortName <> "HUF" Then
|
|
row_AmountHUF = row_AmountDEV * Math.Round(row_CurrencyRate, 2, MidpointRounding.AwayFromZero)
|
|
|
|
End If
|
|
End If
|
|
End Set
|
|
End Property
|
|
<NonPersistent()> _
|
|
<ImmediatePostData(True)> _
|
|
<VisibleInListView(False)> _
|
|
Property row_AmountDEV2 As Double
|
|
Get
|
|
Return _row_AmountDEV2
|
|
End Get
|
|
Set(value As Double)
|
|
SetPropertyValue("row_AmountDEV2", _row_AmountDEV2, value)
|
|
If Session.IsObjectsLoading = False And Session.IsObjectsSaving = False Then
|
|
If row_CurrencyName2 Is Nothing Then row_CurrencyName2 = LiquidAssets_Main.CurrencyName
|
|
If LiquidAssets_Main.CurrencyName.ShortName <> "HUF" And _
|
|
row_CurrencyName2.ShortName <> "HUF" And _
|
|
LiquidAssets_Main.CurrencyName.ShortName <> row_CurrencyName2.ShortName Then
|
|
If row_AmountDEV <> 0 Then
|
|
row_CurrencyRate2 = Math.Round(row_AmountDEV2 / row_AmountDEV, 4, MidpointRounding.AwayFromZero)
|
|
End If
|
|
End If
|
|
End If
|
|
End Set
|
|
End Property
|
|
<NonPersistent()> _
|
|
<ImmediatePostData(True)> _
|
|
<VisibleInListView(False)> _
|
|
<RuleRange("GLBank.CurrencyName.ToTable", "aToTable_GLBank_Contexts", 0.01, 999999999999999999, _
|
|
TargetCriteria:="LiquidAssets_Main.CurrencyName.ShortName != row_CurrencyName2.ShortName and " +
|
|
"LiquidAssets_Main.CurrencyName.ShortName !='HUF' and " +
|
|
"row_CurrencyName2.ShortName !='HUF'")> _
|
|
Property row_CurrencyRate2 As Double
|
|
Get
|
|
Return _row_CurrencyRate2
|
|
End Get
|
|
Set(ByVal value As Double)
|
|
SetPropertyValue("row_CurrencyRate2", _row_CurrencyRate2, value)
|
|
End Set
|
|
End Property
|
|
<NonPersistent()> _
|
|
<ImmediatePostData(True)> _
|
|
<VisibleInListView(False)> _
|
|
Property row_CurrencyName2 As CurrencyName
|
|
Get
|
|
Return _row_CurrencyName2
|
|
End Get
|
|
Set(value As CurrencyName)
|
|
SetPropertyValue("row_CurrencyName2", _row_CurrencyName2, value)
|
|
If Session.IsObjectsLoading = False And Session.IsObjectsSaving = False Then
|
|
row_AmountDEV2 = 0
|
|
row_CurrencyRate2 = 0
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Property TotalInAmountHUF As Double
|
|
Get
|
|
Return _TotalInAmountHUF
|
|
End Get
|
|
Set(ByVal value As Double)
|
|
SetPropertyValue("TotalInAmountHUF", _TotalInAmountHUF, value)
|
|
End Set
|
|
End Property
|
|
Property TotalOutAmountHUF As Double
|
|
Get
|
|
Return _TotalOutAmountHUF
|
|
End Get
|
|
Set(ByVal value As Double)
|
|
SetPropertyValue("TotalOutAmountHUF", _TotalOutAmountHUF, value)
|
|
End Set
|
|
End Property
|
|
Property TotalInAmountDEV As Double
|
|
Get
|
|
Return _TotalInAmountDEV
|
|
End Get
|
|
Set(ByVal value As Double)
|
|
SetPropertyValue("TotalInAmountDEV", _TotalInAmountDEV, value)
|
|
End Set
|
|
End Property
|
|
Property TotalOutAmountDEV As Double
|
|
Get
|
|
Return _TotalOutAmountDEV
|
|
End Get
|
|
Set(ByVal value As Double)
|
|
SetPropertyValue("TotalOutAmountDEV", _TotalOutAmountDEV, value)
|
|
End Set
|
|
End Property
|
|
Property BallanceHUF As Double
|
|
Get
|
|
Return _BallanceHUF
|
|
End Get
|
|
Set(ByVal value As Double)
|
|
SetPropertyValue("BallanceHUF", _BallanceHUF, value)
|
|
End Set
|
|
End Property
|
|
Property BallanceDEV As Double
|
|
Get
|
|
Return _BallanceDEV
|
|
End Get
|
|
Set(ByVal value As Double)
|
|
SetPropertyValue("BallanceDEV", _BallanceDEV, value)
|
|
End Set
|
|
End Property
|
|
Property BankImportHeaderSum As BankImportHeaderSum
|
|
Get
|
|
Return _BankImportHeaderSum
|
|
End Get
|
|
Set(value As BankImportHeaderSum)
|
|
SetPropertyValue("BankImportHeaderSum", _BankImportHeaderSum, value)
|
|
End Set
|
|
End Property
|
|
Property GLHeader_RateDiff As GLHeader
|
|
Get
|
|
Return _GLHeader_RateDiff
|
|
End Get
|
|
Set(value As GLHeader)
|
|
SetPropertyValue("GLHeader_RateDiff", _GLHeader_RateDiff, value)
|
|
End Set
|
|
End Property
|
|
|
|
Sub RecalculateTotal()
|
|
Dim _GLRows As GLRows
|
|
TotalInAmountHUF = 0
|
|
TotalOutAmountHUF = 0
|
|
TotalInAmountDEV = 0
|
|
TotalOutAmountDEV = 0
|
|
For Each _GLRows In Me.GLRows
|
|
Me.TotalInAmountHUF += _GLRows.InAmountHUF
|
|
Me.TotalOutAmountHUF += _GLRows.OutAmountHUF
|
|
Me.TotalInAmountDEV += _GLRows.InAmountDEV
|
|
Me.TotalOutAmountDEV += _GLRows.OutAmountDEV
|
|
Next
|
|
Me.Save()
|
|
End Sub
|
|
Function GetBallanceHUF(ByVal _LiquidAssets As LiquidAssets, ByVal _ToDate As Date) As Double
|
|
Dim _GLBank_Collection As New XPCollection(Of GLBank)(Session, _
|
|
CriteriaOperator.Parse("LiquidAssets_Main=? and DateExecution<=? and IsEditable=False", _LiquidAssets, DateAdd(DateInterval.Minute, 1439, _ToDate.Date)))
|
|
Dim _GLBank As GLBank
|
|
Dim _GLRows As GLRows
|
|
Dim _InAmountHUF As Double = 0
|
|
Dim _OutAmountHUF As Double = 0
|
|
|
|
For Each _GLBank In _GLBank_Collection
|
|
For Each _GLRows In _GLBank.GLRows
|
|
_InAmountHUF += _GLRows.InAmountHUF
|
|
_OutAmountHUF += _GLRows.OutAmountHUF
|
|
Next
|
|
Next
|
|
Return _InAmountHUF - _OutAmountHUF
|
|
End Function
|
|
Function GetBallanceDEV(ByVal _LiquidAssets As LiquidAssets, ByVal _ToDate As Date) As Double
|
|
Dim _GLBank_Collection As New XPCollection(Of GLBank)(Session, _
|
|
CriteriaOperator.Parse("LiquidAssets_Main=? and GetDate(DateExecution)<=? and IsEditable=False", _LiquidAssets, _ToDate.Date))
|
|
Dim _GLBank As GLBank
|
|
Dim _GLRows As GLRows
|
|
Dim _InAmountDEV As Double = 0
|
|
Dim _OutAmountDEV As Double = 0
|
|
|
|
For Each _GLBank In _GLBank_Collection
|
|
For Each _GLRows In _GLBank.GLRows
|
|
_InAmountDEV += _GLRows.InAmountDEV
|
|
_OutAmountDEV += _GLRows.OutAmountDEV
|
|
Next
|
|
Next
|
|
Return _InAmountDEV - _OutAmountDEV
|
|
End Function
|
|
|
|
ReadOnly Property CloseHUF As Double
|
|
Get
|
|
Return BallanceHUF + TotalInAmountHUF - TotalOutAmountHUF
|
|
End Get
|
|
End Property
|
|
ReadOnly Property CloseDEV As Double
|
|
Get
|
|
Return BallanceDEV + TotalInAmountDEV - TotalOutAmountDEV
|
|
End Get
|
|
End Property
|
|
ReadOnly Property DisplayName As String
|
|
Get
|
|
If Me.LiquidAssets_Main IsNot Nothing Then
|
|
Return Me.LiquidAssets_Main.ShortName
|
|
Else
|
|
Return Nothing
|
|
End If
|
|
End Get
|
|
End Property
|
|
|
|
<RuleValueComparison("GLBank-row_AmountDEV", "aToTable_GLBank_Contexts", ValueComparisonType.GreaterThan, 0, TargetCriteria:="CurrencyName.ShortName != 'HUF' and not (row_TransactionType in (5,6))")> _
|
|
Overrides Property row_AmountDEV As Double
|
|
Get
|
|
Return MyBase.row_AmountDEV
|
|
End Get
|
|
Set(value As Double)
|
|
MyBase.row_AmountDEV = value
|
|
If Session.IsObjectsLoading = False And Session.IsObjectsSaving = False Then
|
|
If row_CurrencyName2 Is Nothing Then row_CurrencyName2 = LiquidAssets_Main.CurrencyName
|
|
If Me.row_CurrencyRate > 0 Then
|
|
Me.row_AmountHUF = value * Me.row_CurrencyRate
|
|
End If
|
|
If LiquidAssets_Main.CurrencyName.ShortName <> "HUF" Then
|
|
If LiquidAssets_Main.CurrencyName.ShortName = row_CurrencyName2.ShortName Then
|
|
Else
|
|
row_AmountDEV2 = row_AmountDEV * Math.Round(row_CurrencyRate2, 2, MidpointRounding.AwayFromZero)
|
|
End If
|
|
End If
|
|
End If
|
|
End Set
|
|
End Property
|
|
<RuleRequiredField("GLBank-row_Customers", "aToTable_GLBank_Contexts", TargetCriteria:="row_TransactionType in (0,1)")> _
|
|
<ImmediatePostData(True)> _
|
|
Overrides Property row_Customer As Customers
|
|
Get
|
|
Return MyBase.row_Customer
|
|
End Get
|
|
Set(value As Customers)
|
|
MyBase.row_Customer = value
|
|
End Set
|
|
End Property
|
|
Overrides Property row_Controlling As Controlling
|
|
Get
|
|
Return MyBase.row_Controlling
|
|
End Get
|
|
Set(value As Controlling)
|
|
MyBase.row_Controlling = value
|
|
If Session.IsObjectsSaving = False And Session.IsObjectsLoading = False Then
|
|
If value.ChartOfAccounts IsNot Nothing Then
|
|
|
|
row_ChartOfAccounts = value.GetChartOfAccounts(Me.DateExecution.Year, False)
|
|
End If
|
|
End If
|
|
End Set
|
|
End Property
|
|
End Class
|