Árfolyam számolás javítás

This commit is contained in:
2017-09-27 12:28:04 +02:00
parent ec3266bc99
commit 8109131541
2 changed files with 44 additions and 44 deletions
@@ -370,28 +370,28 @@ Public Class GLBankVC
_GLRows_Collection.Sorting.Add(New SortProperty("GetDate(GLHeader.DateExecution)", DB.SortingDirection.Ascending)) _GLRows_Collection.Sorting.Add(New SortProperty("GetDate(GLHeader.DateExecution)", DB.SortingDirection.Ascending))
_GLRows_Collection.Sorting.Add(New SortProperty("InAmountDEV", DB.SortingDirection.Descending)) _GLRows_Collection.Sorting.Add(New SortProperty("InAmountDEV", DB.SortingDirection.Descending))
RaiseEvent InitWork(1, 1, _GLRows_Collection.Count) 'RaiseEvent InitWork(1, 1, _GLRows_Collection.Count)
For Each _GLRows In _GLRows_Collection 'For Each _GLRows In _GLRows_Collection
'// A deviza a fix és az MNB árfolyammal újra kell számolni mindent ' '// A deviza a fix és az MNB árfolyammal újra kell számolni mindent
RaiseEvent DoWork() ' RaiseEvent DoWork()
If _GLRows.InAmountDEV > 0 Then ' If _GLRows.InAmountDEV > 0 Then
Dim _CurrencyRate_MNB_Collection = New XPCollection(Of CurrencyRate) _ ' Dim _CurrencyRate_MNB_Collection = New XPCollection(Of CurrencyRate) _
(_uow, CriteriaOperator.Parse("CurrencyName.ShortName=? and IsMNB=True and GetDate(DateValid)<=?", _ ' (_uow, CriteriaOperator.Parse("CurrencyName.ShortName=? and IsMNB=True and GetDate(DateValid)<=?", _
_GLBank.LiquidAssets_Main.CurrencyName.ShortName, _GLRows.GLHeader.DateExecution.Date)) ' _GLBank.LiquidAssets_Main.CurrencyName.ShortName, _GLRows.GLHeader.DateExecution.Date))
_CurrencyRate_MNB_Collection.Sorting.Add(New SortProperty("DateValid", DB.SortingDirection.Descending)) ' _CurrencyRate_MNB_Collection.Sorting.Add(New SortProperty("DateValid", DB.SortingDirection.Descending))
If _CurrencyRate_MNB_Collection.Count > 0 Then ' If _CurrencyRate_MNB_Collection.Count > 0 Then
For Each _CurrencyRate_MNB In _CurrencyRate_MNB_Collection ' For Each _CurrencyRate_MNB In _CurrencyRate_MNB_Collection
If _CurrencyRate_MNB.DateValid.Date = _GLRows.GLHeader.DateExecution.Date Then ' If _CurrencyRate_MNB.DateValid.Date = _GLRows.GLHeader.DateExecution.Date Then
_GLRows.InAmountHUF = Math.Round(_CurrencyRate_MNB.RateAverage * _GLRows.InAmountDEV, 4, MidpointRounding.AwayFromZero) ' _GLRows.InAmountHUF = Math.Round(_CurrencyRate_MNB.RateAverage * _GLRows.InAmountDEV, 4, MidpointRounding.AwayFromZero)
_GLRows.AmountHUF = _GLRows.InAmountHUF ' _GLRows.AmountHUF = _GLRows.InAmountHUF
Exit For ' Exit For
End If ' End If
Next ' Next
End If ' End If
End If ' End If
Next 'Next
RaiseEvent FinalWork 'RaiseEvent FinalWork
_uow.CommitChanges() '_uow.CommitChanges()
_GLRows_Collection = New XPCollection(Of GLRows) _ _GLRows_Collection = New XPCollection(Of GLRows) _
(PersistentCriteriaEvaluationBehavior.InTransaction, _uow, _ (PersistentCriteriaEvaluationBehavior.InTransaction, _uow, _
@@ -913,28 +913,28 @@ Public Class GLCassaVC
_GLRows_Collection.Sorting.Add(New SortProperty("GetDate(GLHeader.DateExecution)", DB.SortingDirection.Ascending)) _GLRows_Collection.Sorting.Add(New SortProperty("GetDate(GLHeader.DateExecution)", DB.SortingDirection.Ascending))
_GLRows_Collection.Sorting.Add(New SortProperty("InAmountDEV", DB.SortingDirection.Descending)) _GLRows_Collection.Sorting.Add(New SortProperty("InAmountDEV", DB.SortingDirection.Descending))
RaiseEvent InitWork(1, 1, _GLRows_Collection.Count) 'RaiseEvent InitWork(1, 1, _GLRows_Collection.Count)
For Each _GLRows In _GLRows_Collection 'For Each _GLRows In _GLRows_Collection
'// A deviza a fix és az MNB árfolyammal újra kell számolni mindent ' '// A deviza a fix és az MNB árfolyammal újra kell számolni mindent
RaiseEvent DoWork() ' RaiseEvent DoWork()
If _GLRows.InAmountDEV > 0 Then ' If _GLRows.InAmountDEV > 0 Then
Dim _CurrencyRate_MNB_Collection = New XPCollection(Of CurrencyRate) _ ' Dim _CurrencyRate_MNB_Collection = New XPCollection(Of CurrencyRate) _
(_uow, CriteriaOperator.Parse("CurrencyName.ShortName=? and IsMNB=True and GetDate(DateValid)<=?", _ ' (_uow, CriteriaOperator.Parse("CurrencyName.ShortName=? and IsMNB=True and GetDate(DateValid)<=?", _
_GLCassa.LiquidAssets_Cassa.CurrencyName.ShortName, _GLRows.GLHeader.DateExecution.Date)) ' _GLCassa.LiquidAssets_Cassa.CurrencyName.ShortName, _GLRows.GLHeader.DateExecution.Date))
_CurrencyRate_MNB_Collection.Sorting.Add(New SortProperty("DateValid", DB.SortingDirection.Descending)) ' _CurrencyRate_MNB_Collection.Sorting.Add(New SortProperty("DateValid", DB.SortingDirection.Descending))
If _CurrencyRate_MNB_Collection.Count > 0 Then ' If _CurrencyRate_MNB_Collection.Count > 0 Then
For Each _CurrencyRate_MNB In _CurrencyRate_MNB_Collection ' For Each _CurrencyRate_MNB In _CurrencyRate_MNB_Collection
If _CurrencyRate_MNB.DateValid.Date = _GLRows.GLHeader.DateExecution.Date Then ' If _CurrencyRate_MNB.DateValid.Date = _GLRows.GLHeader.DateExecution.Date Then
_GLRows.InAmountHUF = Math.Round(_CurrencyRate_MNB.RateAverage * _GLRows.InAmountDEV, 4, MidpointRounding.AwayFromZero) ' _GLRows.InAmountHUF = Math.Round(_CurrencyRate_MNB.RateAverage * _GLRows.InAmountDEV, 4, MidpointRounding.AwayFromZero)
_GLRows.AmountHUF = _GLRows.InAmountHUF ' _GLRows.AmountHUF = _GLRows.InAmountHUF
Exit For ' Exit For
End If ' End If
Next ' Next
End If ' End If
End If ' End If
Next 'Next
RaiseEvent FinalWork 'RaiseEvent FinalWork
_uow.CommitChanges() '_uow.CommitChanges()
_GLRows_Collection = New XPCollection(Of GLRows) _ _GLRows_Collection = New XPCollection(Of GLRows) _
(PersistentCriteriaEvaluationBehavior.InTransaction, _uow, _ (PersistentCriteriaEvaluationBehavior.InTransaction, _uow, _