feature_gesamtsicherheiten

This commit is contained in:
2022-10-28 08:09:42 +02:00
parent 7e25fb4872
commit af481b4d16
3 changed files with 61 additions and 13 deletions

View File

@@ -171,12 +171,22 @@ Public Class cGesamtsicherheitsReferenz
Public Function CalcSaldo() As String
Dim SaldoString As String =
"select SUM(
"select
(select SUM(
case
when gs_art = 'Open' then (gs_sicherheitsbetrag * -1)
when gs_art = 'Close' then gs_sicherheitsbetrag
end) as SicherheitsSaldo
from [tblGesamtsicherheit] Where gs_standort = '" & gsr_standort & "'"
end)
as SicherheitsSaldoGS from [tblGesamtsicherheit] Where gs_standort = '" & gsr_standort & "')+
(select SUM(
case
when gsp_art = 'Open' then (gsp_sicherheitsbetrag * -1)
when gsp_art = 'Close' then gsp_sicherheitsbetrag
end)
as SicherheitsSaldoPositionen from [tblGesamtsicherheitsPositionen] Where gsp_gsid IN (select gs_gsId from [tblGesamtsicherheit] where gs_standort = '" & gsr_standort & "' ))"
Dim dt As New DataTable
Dim mrn As Double = 0