BEGIN
/* GroupedVATSummaryInv Line03 */
/* radky FV */
FOR
SELECT
A.VATIndex_ID,
SUM(A.TAmountWithoutVAT),
SUM(A.TAmount),
SUM(A.ForeignTAmountWithoutVAT),
SUM(A.ForeignTAmount)
FROM
GroupedVATIssInv(: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 FP */
FOR
SELECT
A.VATIndex_ID,
SUM(A.TAmountWithoutVAT),
SUM(A.TAmount),
SUM(A.ForeignTAmountWithoutVAT),
SUM(A.ForeignTAmount)
FROM
GroupedVATRecInv(: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 DV */
FOR
SELECT
A.VATIndex_ID,
SUM(-1 * A.TAmountWithoutVAT),
SUM(-1 * A.TAmount),
SUM(-1 * A.ForeignTAmountWithoutVAT),
SUM(-1 * A.ForeignTAmount)
FROM
GroupedVATIssCreditNot(: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 DP */
FOR
SELECT
A.VATIndex_ID,
SUM(-1 * A.TAmountWithoutVAT),
SUM(-1 * A.TAmount),
SUM(-1 * A.ForeignTAmountWithoutVAT),
SUM(-1 * A.ForeignTAmount)
FROM
GroupedVATRecCreditNot(: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 DRC */
FOR
SELECT
A.VATIndex_ID,
SUM(A.TAmountWithoutVAT),
SUM(A.TAmount),
SUM(A.ForeignTAmountWithoutVAT),
SUM(A.ForeignTAmount)
FROM
GroupedVATRevCharge(: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 JCD */
FOR
SELECT
A.VATIndex_ID,
SUM(A.TAmountWithoutVAT),
SUM(A.TAmount),
SUM(A.ForeignTAmountWithoutVAT),
SUM(A.ForeignTAmount)
FROM
GroupedVATCustDeclaration(: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 PCV Potvrzeni celnice o vyvozu */
FOR
SELECT
A.VATIndex_ID,
SUM(A.TAmountWithoutVAT),
SUM(A.TAmount),
SUM(A.ForeignTAmountWithoutVAT),
SUM(A.ForeignTAmount)
FROM
GroupedVATCustConfirmation(: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;