SELECT {FIELDS} FROM
ReverseChargeDeclarations A
{JOIN}
{WHERE}
{ORDERBY}
| Alias | CLSID objektu | Prefix | Popis |
|---|---|---|---|
| A | XCBZKJFXQOR4B41FSW0E3SIGNO | ||
| DQ | OFTMKVQH3ZD13ACL03KIU0CLP4 | DocQueue | Řada dokladů |
| F | 4K3EXM5PQBCL35CH000ILPWJF4 | Firm | Firma |
| P | CAQPAYUOXVCL3ACL03KIU0CLP4 | Period | Období |
| SU2 | 22AHIVDVAVE13C5S00CA141B44 | SUCorrectedBy | Uživatel |
| SU1 | 22AHIVDVAVE13C5S00CA141B44 | SUCreatedBy | Uživatel |
| Jméno | Typ | Velikost | Výraz | CLSID | Popis |
|---|---|---|---|---|---|
| DocNumber | dtString | 16 |
DQ.Code || '-' || CAST(A.OrdNumber AS VARCHAR(10)) || '/' || P.Code |
Číslo dokladu |
SELECT {FIELDS} FROM
ReverseChargeDeclarations2 A
{JOIN}
WHERE
A.Parent_ID=:ID
ORDER BY
A.PosIndex
| Alias | CLSID objektu | Prefix | Popis |
|---|---|---|---|
| A | DZXHVYD4EYG43H4XOC512DGQVW | ||
| BO | K2WTYL304VD13ACL03KIU0CLP4 | BusOrder | Zakázka |
| BP | QOKMKIQUJF34L3DUICTBWEDQJC | BusProject | Projekt |
| BT | KAWTYL304VD13ACL03KIU0CLP4 | BusTransaction | Obch. případ |
| DV | O1X54EUXPZCL35CH000ILPWJF4 | Division | Středisko |
SELECT {FIELDS} FROM
GeneralLedger A
{JOIN}
WHERE
R.REL_DEF=46 AND
R.LEFTSIDE_ID=:ID
| Alias | CLSID objektu | Prefix | Popis |
|---|---|---|---|
| A | C3S1BMBT4RD13ACL03KIU0CLP4 | ||
| R | 01ZXNDSYDVD135SA02K2CQM5AW | Relation | Vazba mezi doklady |
A.SDocumentType = {:VALUE}
A.SDocumentType IN ({:LIST})
A.Amount BETWEEN {:LOW} and {:HIGH}
A.LocalAmount BETWEEN {:LOW} and {:HIGH}
A.VATDate$DATE >= {:LOW} and
A.VATDate$DATE < {:HIGH}
A.VATDeductionDate$DATE >= {:LOW} and
A.VATDeductionDate$DATE < {:HIGH}
##CASEOR {:VALUE} #
##1# (A.ID in (
select A.ID from ReverseChargeDeclarations A
where
((select SUM(RI.AmountWithoutVAT) from ReceivedInvoices RI where
A.SDocumentType = '04' and RI.ID = A.SDocument_ID) >
(select SUM(R.SourceAmount) from ReverseChargeDeclarations2 R where Parent_ID = A.ID))
or
((select SUM(RCN.AmountWithoutVAT) from ReceivedCreditNotes RCN where
A.SDocumentType = '61' and RCN.ID = A.SDocument_ID) >
(select SUM(R.SourceAmount) from ReverseChargeDeclarations2 R where Parent_ID = A.ID))
or
((select SUM(CP.AmountWithoutVAT) from CashPaid CP where
A.SDocumentType = '06' and CP.ID = A.SDocument_ID) >
(select SUM(R.SourceAmount) from ReverseChargeDeclarations2 R where Parent_ID = A.ID))
or
((select SUM(RCP.AmountWithoutVAT) from RefundedCashPaid RCP where
A.SDocumentType = '08' and RCP.ID = A.SDocument_ID) >
(select SUM(R.SourceAmount) from ReverseChargeDeclarations2 R where Parent_ID = A.ID))
or
((select SUM(CD2.CustomsAmount + CD2.ImportTax + CD2.SpendingTax
+ CD2.VATAmount + CD2.VATBaseAmount + CD2.VATBaseCorrection)
from CustomsDeclarations2 CD2
inner join CustomsDeclarations CD on CD.ID = CD2.Parent_ID
where A.SDocumentType = '12' and CD.ID = A.SDocument_ID) >
(select SUM(R.SourceAmount) from ReverseChargeDeclarations2 R where Parent_ID = A.ID))))
##2# (A.ID in (
select A.ID from ReverseChargeDeclarations A
where
((select SUM(RI.AmountWithoutVAT) from ReceivedInvoices RI where
A.SDocumentType = '04' and RI.ID = A.SDocument_ID) <
(select SUM(R.SourceAmount) from ReverseChargeDeclarations2 R where Parent_ID = A.ID))
or
((select SUM(RCN.AmountWithoutVAT) from ReceivedCreditNotes RCN where
A.SDocumentType = '61' and RCN.ID = A.SDocument_ID) <
(select SUM(R.SourceAmount) from ReverseChargeDeclarations2 R where Parent_ID = A.ID))
or
((select SUM(CP.AmountWithoutVAT) from CashPaid CP where
A.SDocumentType = '06' and CP.ID = A.SDocument_ID) <
(select SUM(R.SourceAmount) from ReverseChargeDeclarations2 R where Parent_ID = A.ID))
or
((select SUM(RCP.AmountWithoutVAT) from RefundedCashPaid RCP where
A.SDocumentType = '08' and RCP.ID = A.SDocument_ID) <
(select SUM(R.SourceAmount) from ReverseChargeDeclarations2 R where Parent_ID = A.ID))
or
((select SUM(CD2.CustomsAmount + CD2.ImportTax + CD2.SpendingTax
+ CD2.VATAmount + CD2.VATBaseAmount + CD2.VATBaseCorrection)
from CustomsDeclarations2 CD2
inner join CustomsDeclarations CD on CD.ID = CD2.Parent_ID
where A.SDocumentType = '12' and CD.ID = A.SDocument_ID) <
(select SUM(R.SourceAmount) from ReverseChargeDeclarations2 R where Parent_ID = A.ID))))
##END#
{:ANDWHERE}
TableName=ReverseChargeDeclarations2
A.SDocument_ID = {:VALUE}
A.SDocument_ID IN ({:LIST})
A.DocDate$DATE
A.OrdNumber
A.LocalAmount
F.Name Collate PXW_CSY {DIR},A.Firm_IDP.Code Collate PXW_CSY {DIR},A.Period_IDDQ.Code Collate PXW_CSY {DIR},A.DocQueue_IDSU1.Name Collate PXW_CSY {DIR}, A.CreatedBy_IDSU2.Name Collate PXW_CSY {DIR}, A.CorrectedBy_IDDQ.Code Collate PXW_CSY {DIR},
P.Code Collate PXW_CSY {DIR},
A.OrdNumberA.Description Collate PXW_CSY
A.AccDate$DATE
Generated by ABRA Software a.s. 27.10.2021 16:36