Devizás bank kerekítési probléma javítása

This commit is contained in:
2017-09-27 12:03:14 +02:00
parent 159a71d3d0
commit 1def145a4c
3 changed files with 11 additions and 11 deletions
@@ -279,11 +279,11 @@ Public Class GLBank
If row_CurrencyRate <> 0 Then row_AmountDEV2 = Math.Round(row_AmountHUF / row_CurrencyRate, 2, MidpointRounding.AwayFromZero) If row_CurrencyRate <> 0 Then row_AmountDEV2 = Math.Round(row_AmountHUF / row_CurrencyRate, 2, MidpointRounding.AwayFromZero)
End If End If
If LiquidAssets_Main.CurrencyName.ShortName <> "HUF" And row_CurrencyName2.ShortName = "HUF" Then If LiquidAssets_Main.CurrencyName.ShortName <> "HUF" And row_CurrencyName2.ShortName = "HUF" Then
row_AmountHUF = row_AmountDEV * Math.Round(row_CurrencyRate, 2, MidpointRounding.AwayFromZero) row_AmountHUF = row_AmountDEV * Math.Round(row_CurrencyRate, 4, MidpointRounding.AwayFromZero)
row_AmountDEV2 = row_AmountHUF row_AmountDEV2 = row_AmountHUF
End If End If
If LiquidAssets_Main.CurrencyName.ShortName <> "HUF" And row_CurrencyName2.ShortName <> "HUF" Then If LiquidAssets_Main.CurrencyName.ShortName <> "HUF" And row_CurrencyName2.ShortName <> "HUF" Then
row_AmountHUF = row_AmountDEV * Math.Round(row_CurrencyRate, 2, MidpointRounding.AwayFromZero) row_AmountHUF = row_AmountDEV * Math.Round(row_CurrencyRate, 4, MidpointRounding.AwayFromZero)
End If End If
End If End If
@@ -382,7 +382,7 @@ Public Class GLBankVC
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, 2, 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
@@ -409,7 +409,7 @@ Public Class GLBankVC
'// Árfolyamok helyrerakása '// Árfolyamok helyrerakása
If _GLRows.OutAmountDEV > 0 Then If _GLRows.OutAmountDEV > 0 Then
If _SumAmountDEV <> 0 Then If _SumAmountDEV <> 0 Then
_GLRows.OutAmountHUF = Math.Round(_GLRows.OutAmountDEV * (_SumAmountHUF / _SumAmountDEV), 2, MidpointRounding.AwayFromZero) _GLRows.OutAmountHUF = Math.Round(_GLRows.OutAmountDEV * (_SumAmountHUF / _SumAmountDEV), 4, MidpointRounding.AwayFromZero)
_GLRows.AmountHUF = _GLRows.OutAmountHUF _GLRows.AmountHUF = _GLRows.OutAmountHUF
_GLRows.Save() _GLRows.Save()
_uow.CommitChanges() _uow.CommitChanges()
@@ -426,7 +426,7 @@ Public Class GLBankVC
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.OutAmountHUF = Math.Round(_CurrencyRate_MNB.RateAverage * _GLRows.OutAmountDEV, 2, MidpointRounding.AwayFromZero) _GLRows.OutAmountHUF = Math.Round(_CurrencyRate_MNB.RateAverage * _GLRows.OutAmountDEV, 4, MidpointRounding.AwayFromZero)
_GLRows.AmountHUF = _GLRows.OutAmountHUF _GLRows.AmountHUF = _GLRows.OutAmountHUF
_GLRows.Save() _GLRows.Save()
_uow.CommitChanges() _uow.CommitChanges()
@@ -440,14 +440,14 @@ Public Class GLBankVC
End If End If
End If End If
_SumAmountDEV -= Math.Round(_GLRows.OutAmountDEV, 2, MidpointRounding.AwayFromZero) _SumAmountDEV -= Math.Round(_GLRows.OutAmountDEV, 4, MidpointRounding.AwayFromZero)
_SumAmountHUF -= Math.Round(_GLRows.OutAmountHUF, 2, MidpointRounding.AwayFromZero) _SumAmountHUF -= Math.Round(_GLRows.OutAmountHUF, 4, MidpointRounding.AwayFromZero)
If _SumAmountDEV < 0 Then _SumAmountDEV = 0 If _SumAmountDEV < 0 Then _SumAmountDEV = 0
If _SumAmountHUF < 0 Then _SumAmountHUF = 0 If _SumAmountHUF < 0 Then _SumAmountHUF = 0
Else Else
_SumAmountDEV += Math.Round(_GLRows.InAmountDEV, 2, MidpointRounding.AwayFromZero) _SumAmountDEV += Math.Round(_GLRows.InAmountDEV, 4, MidpointRounding.AwayFromZero)
_SumAmountHUF += Math.Round(_GLRows.InAmountHUF, 2, MidpointRounding.AwayFromZero) _SumAmountHUF += Math.Round(_GLRows.InAmountHUF, 4, MidpointRounding.AwayFromZero)
End If End If
Next Next
_uow.CommitChanges() _uow.CommitChanges()
@@ -271,11 +271,11 @@ Public Class GLCassa
If row_CurrencyRate <> 0 Then row_AmountDEV2 = Math.Round(row_AmountHUF / row_CurrencyRate, 2, MidpointRounding.AwayFromZero) If row_CurrencyRate <> 0 Then row_AmountDEV2 = Math.Round(row_AmountHUF / row_CurrencyRate, 2, MidpointRounding.AwayFromZero)
End If End If
If LiquidAssets_Cassa.CurrencyName.ShortName <> "HUF" And row_CurrencyName2.ShortName = "HUF" Then If LiquidAssets_Cassa.CurrencyName.ShortName <> "HUF" And row_CurrencyName2.ShortName = "HUF" Then
row_AmountHUF = row_AmountDEV * Math.Round(row_CurrencyRate, 2, MidpointRounding.AwayFromZero) row_AmountHUF = row_AmountDEV * Math.Round(row_CurrencyRate, 4, MidpointRounding.AwayFromZero)
row_AmountDEV2 = row_AmountHUF row_AmountDEV2 = row_AmountHUF
End If End If
If LiquidAssets_Cassa.CurrencyName.ShortName <> "HUF" And row_CurrencyName2.ShortName <> "HUF" Then If LiquidAssets_Cassa.CurrencyName.ShortName <> "HUF" And row_CurrencyName2.ShortName <> "HUF" Then
row_AmountHUF = row_AmountDEV * Math.Round(row_CurrencyRate, 2, MidpointRounding.AwayFromZero) row_AmountHUF = row_AmountDEV * Math.Round(row_CurrencyRate, 4, MidpointRounding.AwayFromZero)
End If End If
End If End If