Procedura-ABI_GetSummaredPaymentsOnRow

Parametry:

NázevPopisDatový typ
APDocumentTypeChar(2)
APDocument_IDChar(10)
AComputedRowChar(10)

Návratové hodnoty:

NázevPopisDatový typ
DocDate$DATEFloat(0, 0)
AmountNumeric(15, 2)

Tělo:

begin
  Amount = 0;
  DocDate$DATE = 0;
  FOR
    select LocalAmount, DocumentType, Document_ID from Payments
      where PDocumenttype=:APDocumentType and PDocument_ID=:APDocument_ID and ComputedRow=:AComputedRow
      INTO :mAmount, :mType, :mID
  DO begin
    Amount = :Amount + :mAmount;
    if (mType = '09') then
      select DocDate$Date from BankStatements2 where ID=:mID into :mDate;
    else if (mType = '01') then
      select DocDate$Date from OtherIncomes where ID=:mID into :mDate;
    else if (mType = '02') then
      select DocDate$Date from OtherExpenses where ID=:mID into :mDate;
    else if (mType = '05') then
      select DocDate$Date from CashReceived where ID=:mID into :mDate;
    else if (mType = '06') then
      select DocDate$Date from CashPaid where ID=:mID into :mDate;
    else if (mType = 'U0') then
      select PaymentDate$Date from IssuedDepositUsages where ID=:mID into :mDate;
    else if (mType = 'U1') then
      select PaymentDate$Date from ReceivedDepositUsages where ID=:mID into :mDate;
    else if (mType = 'CM') then
      select DocDate$Date from Compensations2 where ID=:mID into :mDate;
    if (mDate > :DocDate$Date) then
      DocDate$Date = mDate;
  end
  suspend;
end

Generated by ABRA Software a.s. 27.10.2021 16:34:12