Napi pénztári jelentés javítása
This commit is contained in:
+52
-31
@@ -13,11 +13,12 @@ Imports System.Configuration
|
|||||||
Imports System.Linq
|
Imports System.Linq
|
||||||
Imports System.Linq.Expressions
|
Imports System.Linq.Expressions
|
||||||
Imports DevExpress.ExpressApp.ConditionalAppearance
|
Imports DevExpress.ExpressApp.ConditionalAppearance
|
||||||
|
Imports DevExpress.Xpo.DB
|
||||||
|
|
||||||
<DefaultClassOptions()> _
|
<DefaultClassOptions()>
|
||||||
<NavigationItem(False), CreatableItem(False)> _
|
<NavigationItem(False), CreatableItem(False)>
|
||||||
<DeferredDeletion(False)> _
|
<DeferredDeletion(False)>
|
||||||
<Appearance("Hide DEV when HUF in ReturnHeade", AppearanceItemType.ViewItem, "LiquidAssets.CurrencyName.ShortName='HUF'", TargetItems:="BallanceFromDEV;BallanceToDEV", visibility:=DevExpress.ExpressApp.Editors.ViewItemVisibility.Hide)> _
|
<Appearance("Hide DEV when HUF in ReturnHeade", AppearanceItemType.ViewItem, "LiquidAssets.CurrencyName.ShortName='HUF'", TargetItems:="BallanceFromDEV;BallanceToDEV", Visibility:=DevExpress.ExpressApp.Editors.ViewItemVisibility.Hide)>
|
||||||
Public Class LiquidAssetsReturnHeader 'Pénzeszközök egyenlege
|
Public Class LiquidAssetsReturnHeader 'Pénzeszközök egyenlege
|
||||||
Inherits BaseObject
|
Inherits BaseObject
|
||||||
Private _CustomersFrom As CustomersFrom 'Saját cég
|
Private _CustomersFrom As CustomersFrom 'Saját cég
|
||||||
@@ -41,14 +42,14 @@ Public Class LiquidAssetsReturnHeader 'Pénzeszközök egyenlege
|
|||||||
UserCreated = Session.GetObjectByKey(Of User)(Session.GetKeyValue(SecuritySystem.CurrentUser))
|
UserCreated = Session.GetObjectByKey(Of User)(Session.GetKeyValue(SecuritySystem.CurrentUser))
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
<VisibleInListView(False)> _
|
<VisibleInListView(False)>
|
||||||
<Association("LiquidAssetsReturnHeader-LiquidAssetsReturnRows", GetType(LiquidAssetsReturnRows)), Aggregated()> _
|
<Association("LiquidAssetsReturnHeader-LiquidAssetsReturnRows", GetType(LiquidAssetsReturnRows)), Aggregated()>
|
||||||
ReadOnly Property LiquidAssetsReturnRows As XPCollection(Of LiquidAssetsReturnRows)
|
ReadOnly Property LiquidAssetsReturnRows As XPCollection(Of LiquidAssetsReturnRows)
|
||||||
Get
|
Get
|
||||||
Return GetCollection(Of LiquidAssetsReturnRows)("LiquidAssetsReturnRows")
|
Return GetCollection(Of LiquidAssetsReturnRows)("LiquidAssetsReturnRows")
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
<VisibleInListView(False)> _
|
<VisibleInListView(False)>
|
||||||
ReadOnly Property LiquidAssetsReturnRowsGLRows As XPCollection(Of GLRows)
|
ReadOnly Property LiquidAssetsReturnRowsGLRows As XPCollection(Of GLRows)
|
||||||
Get
|
Get
|
||||||
Dim _GLRows As GLRows
|
Dim _GLRows As GLRows
|
||||||
@@ -62,15 +63,15 @@ Public Class LiquidAssetsReturnHeader 'Pénzeszközök egyenlege
|
|||||||
Return _LiquidAssetsReturnRowsGLRows
|
Return _LiquidAssetsReturnRowsGLRows
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
<VisibleInListView(False)> _
|
<VisibleInListView(False)>
|
||||||
<Association("LiquidAssetsReturnHeader-LiquidAssetsReturnDenomination", GetType(LiquidAssetsReturnDenomination)), Aggregated()> _
|
<Association("LiquidAssetsReturnHeader-LiquidAssetsReturnDenomination", GetType(LiquidAssetsReturnDenomination)), Aggregated()>
|
||||||
ReadOnly Property LiquidAssetsReturnDenomination As XPCollection(Of LiquidAssetsReturnDenomination)
|
ReadOnly Property LiquidAssetsReturnDenomination As XPCollection(Of LiquidAssetsReturnDenomination)
|
||||||
Get
|
Get
|
||||||
Return GetCollection(Of LiquidAssetsReturnDenomination)("LiquidAssetsReturnDenomination")
|
Return GetCollection(Of LiquidAssetsReturnDenomination)("LiquidAssetsReturnDenomination")
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
<ImmediatePostData(True)> _
|
<ImmediatePostData(True)>
|
||||||
Property CustomersFrom As CustomersFrom
|
Property CustomersFrom As CustomersFrom
|
||||||
Get
|
Get
|
||||||
Return _CustomersFrom
|
Return _CustomersFrom
|
||||||
@@ -397,7 +398,7 @@ Public Class LiquidAssetsReturnHeader 'Pénzeszközök egyenlege
|
|||||||
SetPropertyValue("BallanceToDEV", _BallanceToDEV, value)
|
SetPropertyValue("BallanceToDEV", _BallanceToDEV, value)
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
<NonCloneable> _
|
<NonCloneable>
|
||||||
Property ObjectCreated As Date
|
Property ObjectCreated As Date
|
||||||
Get
|
Get
|
||||||
Return _ObjectCreated
|
Return _ObjectCreated
|
||||||
@@ -406,7 +407,7 @@ Public Class LiquidAssetsReturnHeader 'Pénzeszközök egyenlege
|
|||||||
SetPropertyValue("ObjectCreated", _ObjectCreated, value)
|
SetPropertyValue("ObjectCreated", _ObjectCreated, value)
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
<NonCloneable> _
|
<NonCloneable>
|
||||||
Property UserCreated As User
|
Property UserCreated As User
|
||||||
Get
|
Get
|
||||||
Return _UserCreated
|
Return _UserCreated
|
||||||
@@ -415,7 +416,7 @@ Public Class LiquidAssetsReturnHeader 'Pénzeszközök egyenlege
|
|||||||
SetPropertyValue("UserCreated", _UserCreated, value)
|
SetPropertyValue("UserCreated", _UserCreated, value)
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
<Browsable(False)> _
|
<Browsable(False)>
|
||||||
Property GLClosingTime As GLClosingTime
|
Property GLClosingTime As GLClosingTime
|
||||||
Get
|
Get
|
||||||
Return _GLClosingTime
|
Return _GLClosingTime
|
||||||
@@ -432,25 +433,45 @@ Public Class LiquidAssetsReturnHeader 'Pénzeszközök egyenlege
|
|||||||
BallanceFromDEV = 0
|
BallanceFromDEV = 0
|
||||||
BallanceToHUF = 0
|
BallanceToHUF = 0
|
||||||
BallanceToDEV = 0
|
BallanceToDEV = 0
|
||||||
Dim _GLRows_Collection As New XPCollection(Of GLRows)(Session, CriteriaOperator.Parse("GetDate(GLHeader.DateExecution)<? and GLHeader.DocumentNumber<>'' and GLHeader.IsStorno=False", DateFrom.Date))
|
'Dim _GLRows_Collection As New XPCollection(Of GLRows)(Session, CriteriaOperator.Parse("GetDate(GLHeader.DateExecution)<? and GLHeader.DocumentNumber<>'' and GLHeader.IsStorno=False", DateFrom.Date))
|
||||||
Dim query = From _GLRows In _GLRows_Collection _
|
'Dim query = From _GLRows In _GLRows_Collection _
|
||||||
Where _GLRows.GLHeader.DateExecution.Date < DateFrom.Date And _GLRows.LiquidAssets Is Me.LiquidAssets And
|
' Where _GLRows.GLHeader.DateExecution.Date < DateFrom.Date And _GLRows.LiquidAssets Is Me.LiquidAssets And
|
||||||
_GLRows.GLHeader.IsEditable = False And
|
' _GLRows.GLHeader.IsEditable = False And
|
||||||
String.IsNullOrEmpty(_GLRows.GLHeader.DocumentNumber) = False And
|
' String.IsNullOrEmpty(_GLRows.GLHeader.DocumentNumber) = False And
|
||||||
_GLRows.GLHeader IsNot Nothing
|
' _GLRows.GLHeader IsNot Nothing
|
||||||
Group _GLRows By _GLRows.GLHeader.CustomersFrom, _
|
' Group _GLRows By _GLRows.GLHeader.CustomersFrom, _
|
||||||
_GLRows.LiquidAssets Into g = Group _
|
' _GLRows.LiquidAssets Into g = Group _
|
||||||
Select New With {Key .CustomersFrom = CustomersFrom, _
|
' Select New With {Key .CustomersFrom = CustomersFrom, _
|
||||||
Key .LiquidAssets = LiquidAssets, _
|
' Key .LiquidAssets = LiquidAssets, _
|
||||||
Key .InAmountHUF = g.Sum(Function(inv) inv.InAmountHUF), _
|
' Key .InAmountHUF = g.Sum(Function(inv) inv.InAmountHUF), _
|
||||||
Key .OutAmountHUF = g.Sum(Function(inv) inv.OutAmountHUF), _
|
' Key .OutAmountHUF = g.Sum(Function(inv) inv.OutAmountHUF), _
|
||||||
Key .InAmountDEV = g.Sum(Function(inv) inv.InAmountDEV), _
|
' Key .InAmountDEV = g.Sum(Function(inv) inv.InAmountDEV), _
|
||||||
Key .OutAmountDEV = g.Sum(Function(inv) inv.OutAmountDEV)}
|
' Key .OutAmountDEV = g.Sum(Function(inv) inv.OutAmountDEV)}
|
||||||
|
|
||||||
|
'For Each item In query
|
||||||
|
' BallanceFromHUF += item.InAmountHUF - item.OutAmountHUF
|
||||||
|
' BallanceFromDEV += item.InAmountDEV - item.OutAmountDEV
|
||||||
|
'Next
|
||||||
|
Dim _SQL As String
|
||||||
|
Dim _SelectStatementResultRow As SelectStatementResultRow
|
||||||
|
Dim _SelectedData As DevExpress.Xpo.DB.SelectedData = Nothing
|
||||||
|
|
||||||
|
_SQL = " SELECT t2.CustomersFrom,t1.LiquidAssets,ROUND(SUM(t1.InAmountHUF-t1.OutAmountHUF),0),ROUND(SUM(t1.InAmountDEV-t1.OutAmountDEV),2)"
|
||||||
|
_SQL += " FROM GLRows t1 JOIN GLHeader t2 ON"
|
||||||
|
_SQL += " t1.GLHeader=t2.Oid AND t1.GCRecord IS NULL AND t2.GCRecord IS NULL"
|
||||||
|
_SQL += " WHERE DATE(t2.DateExecution)<'" & DateFrom.Date.ToString("yyyy-MM-dd") & "' AND t2.DocumentNumber !='' AND t2.IsStorno!=1 AND t1.LiquidAssets ='" & Me.LiquidAssets.Oid.ToString() & "'"
|
||||||
|
_SQL += " GROUP BY t2.CustomersFrom,t1.LiquidAssets"
|
||||||
|
|
||||||
|
|
||||||
|
_SelectedData = Session.ExecuteQuery(_SQL)
|
||||||
|
If _SelectedData.ResultSet.Length > 0 Then
|
||||||
|
For Each _SelectStatementResultRow In _SelectedData.ResultSet(0).Rows
|
||||||
|
BallanceFromHUF = _SelectStatementResultRow.Values(2)
|
||||||
|
BallanceFromDEV = _SelectStatementResultRow.Values(3)
|
||||||
|
Next
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
For Each item In query
|
|
||||||
BallanceFromHUF += item.InAmountHUF - item.OutAmountHUF
|
|
||||||
BallanceFromDEV += item.InAmountDEV - item.OutAmountDEV
|
|
||||||
Next
|
|
||||||
Dim _LiquidAssetsReturnRows As LiquidAssetsReturnRows
|
Dim _LiquidAssetsReturnRows As LiquidAssetsReturnRows
|
||||||
Dim _ReturnAmountHUF As Double = 0
|
Dim _ReturnAmountHUF As Double = 0
|
||||||
Dim _ReturnAmountDEV As Double = 0
|
Dim _ReturnAmountDEV As Double = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user