project QadFinancials > class BDDocument > business logic query DDocumentInvoiceXrefPostByStatus

Description

Retrive all the allocation of the Invoice by payment status and Payment type


Parameters


icDocumentStatuscharacter
icDocumentTypecharacter
iiDInvoiceIdinteger
iiCompanyIdintegerCompany id
iiDDocumentIdinteger
icGLTypeCodecharacter


query condition


  each DDocumentInvoiceXref where
DDocumentInvoiceXref.DInvoice_ID = iiDInvoiceId AND
DDocumentInvoiceXref.DDocument_ID = iiDDocumentId

      first DDocument (inner-join) where
DDocument.Company_Id = iiCompanyId AND
DDocument.DDocument_ID = DDocumentInvoiceXref.DDocument_ID AND
DDocument.DDocumentStatus can-do icDocumentStatus AND
DDocument.DDocumentType = icDocumentType

          each DDocumentPostingLine (inner-join) where
DDocumentPostingLine.DDocument_ID = DDocument.DDocument_ID AND

              first PostingLine1 (inner-join) where
PostingLine1.Company_Id = iiCompanyId AND
PostingLine1.PostingLine_ID = DDocumentPostingLine.PostingLine_ID AND

                  first Posting (inner-join) where
Posting.Company_Id = iiCompanyId AND
Posting.Posting_ID = PostingLine1.Posting_ID AND

                      each PostingLine2 (inner-join) where
PostingLine2.Company_Id = iiCompanyId AND
PostingLine2.Posting_ID = Posting.Posting_ID AND

                          first GL (inner-join) where
GL.SharedSet_Id = vi_GL_sharedset(iiCompanyId) AND
GL.GL_ID = PostingLine2.GL_ID AND
GL.GLTypeCode = icGLTypeCode


query resultset tqDDocumentInvoiceXrefPostByStat


field namedata typedb fielddescription
tiDDocument_IDintegerDDocumentInvoiceXref.DDocument_IDLink to DDocument
tdDDocumentInvoiceXrefAlloTCdecimalDDocumentInvoiceXref.DDocumentInvoiceXrefAlloTCTC Allocated Amount. This field indicates the invocie amount already Allocated in transaction currency.
tdDDocumentInvoiceXrefDiscTCdecimalDDocumentInvoiceXref.DDocumentInvoiceXrefDiscTCTC Discount Amount. This field indicates the discount amount of the invoice already allocated by transaction currency.
tcDDocumentStatuscharacterDDocument.DDocumentStatusStatus. The payment status. The default value for a new record is Initial.
tcDDocumentTypecharacterDDocument.DDocumentTypePayment Instrument. The system displays the payment instrument associated with the payment format linked to the customer bank.
tiDInvoice_IDintegerDDocumentInvoiceXref.DInvoice_IDLink to DInvoice
tcGLTypeCodecharacterGL.GLTypeCodeA code identifying the type of account.


Internal usage


QadFinancials
method BDInvoice.CreateDInvoiceMovementsSuspTax