Procedura-GroupedVATSummaryAcc

Parametry:

NázevPopisDatový typ
AFirmSelIDChar(10)
ADivisionsSelIDChar(10)
ABusOrdersSelIDChar(10)
ABusTransactionsSelIDChar(10)
ABusProjectsSelIDChar(10)
AVATDateFromFloat(0, 0)
AVATDateToFloat(0, 0)
ADivisionsWithChildsChar(1)
ABusOrdersWithChildsChar(1)
ABusTransactionsWithChildsChar(1)
ABusProjectsWithChildsChar(1)
AVATCountry_IDChar(10)

Návratové hodnoty:

NázevPopisDatový typ
VATIndex_IDChar(10)
TAmountWithoutVATNumeric(15, 2)
TAmountNumeric(15, 2)
ForeignTAmountWithoutVATNumeric(15, 2)
ForeignTAmountNumeric(15, 2)

Závislosti:

NázevPopisTřída
GroupedVATOtherExpensesProcedures
GroupedVATOtherIncomesProcedures

Tělo:

BEGIN
  /* radky OSTP */
  FOR
    SELECT
      A.VATIndex_ID,
      SUM(A.TAmountWithoutVAT),
      SUM(A.TAmount),
      SUM(A.ForeignTAmountWithoutVAT),
      SUM(A.ForeignTAmount)
    FROM
      GroupedVATOtherIncomes(:AFirmSelID, :ADivisionsSelID, :ABusOrdersSelID,
        :ABusTransactionsSelID, :ABusProjectsSelID, :AVATDateFrom, :AVATDateTo, :ADivisionsWithChilds,
        :ABusOrdersWithChilds, :ABusTransactionsWithChilds, :ABusProjectsWithChilds, :AVATCountry_ID) A
    WHERE
      A.VATIndex_ID IS NOT NULL
    GROUP BY
      A.VATIndex_ID
    INTO
      :VATIndex_ID, :TAmountWithoutVAT, :TAmount, :ForeignTAmountWithoutVAT, :ForeignTAmount
  DO BEGIN
    SUSPEND;
  END
  /* radky OSTV */
  FOR
    SELECT
      A.VATIndex_ID,
      SUM(A.TAmountWithoutVAT),
      SUM(A.TAmount),
      SUM(A.ForeignTAmountWithoutVAT),
      SUM(A.ForeignTAmount)
    FROM
      GroupedVATOtherExpenses(:AFirmSelID, :ADivisionsSelID, :ABusOrdersSelID,
        :ABusTransactionsSelID, :ABusProjectsSelID, :AVATDateFrom, :AVATDateTo, :ADivisionsWithChilds,
        :ABusOrdersWithChilds, :ABusTransactionsWithChilds, :ABusProjectsWithChilds, :AVATCountry_ID) A
    WHERE
      A.VATIndex_ID IS NOT NULL
    GROUP BY
      A.VATIndex_ID
    INTO
      :VATIndex_ID, :TAmountWithoutVAT, :TAmount, :ForeignTAmountWithoutVAT, :ForeignTAmount
  DO BEGIN
    SUSPEND;
  END
END;

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