project QadFinancials > class BDDocumentReport > method DDocumentReportDraft

report procedure


Parameters


icLanguageCodeinputcharacter
tFilterinputtemp-table
dcrDDocumentReportDraftoutputdataset
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BDDocumentReport.test


program code (program4/bddocumentreport.p)

empty temp-table tqDDocumentReportDraft.

<M-1 run GetReportLabels (input  'DDocumentReportDraft':U (icReportName), 
                          input  icLanguageCode (icLanguageCode), 
                          input  tFilter (tFilter), 
                          output tqHeader (tqHeader), 
                          output tqFilter (tqFilter), 
                          output tqText (tqText), 
                          output oiReturnStatus (oiReturnStatus)) in BDDocumentReport>

if oiReturnStatus <> 0
then return.

<M-3 run SetDataItemsBasesOnFilterTT
   (output oiReturnStatus (oiReturnStatus)) in BDDocumentReport>
if oiReturnStatus <> 0
then return.

empty temp-table tDDocumentReportAll.
<M-2 run DDocumentReportAll (output tDDocumentReportAll (tDDocumentReportAll), 
                             input  {&DOCUMENTTYPEDEBTOR-DRAFT} (icDocumentType), 
                             output oiReturnStatus (oiReturnStatus)) in BDDocumentReport>

define variable cDDocRepDocumentType as character no-undo.
assign cDDocRepDocumentType = {&DOCUMENTTYPEDEBTOR-DRAFT-TR}.

for each tDDocumentReportAll where tDDocumentReportAll.tcDDocRepDocumentType = {&DOCUMENTTYPEDEBTOR-DRAFT}:
    create tqDDocumentReportDraft.
    buffer-copy tDDocumentReportAll to tqDDocumentReportDraft.
    assign tqDDocumentReportDraft.tcDDocRepDocumentType = cDDocRepDocumentType.
    /*
    assign tqDDocumentReportDraft.tcDDocRepDocumentType           = {&DOCUMENTTYPEDEBTOR-DRAFT-TR}
           tqDDocumentReportDraft.tiDDocumentID                   = tDDocumentReportAll.tiDDocumentID
           tqDDocumentReportDraft.tiDDocRepYear                   = tDDocumentReportAll.tiDDocRepYear
           tqDDocumentReportDraft.tiDDocRepNumber                 = tDDocumentReportAll.tiDDocRepNumber                  
           tqDDocumentReportDraft.tcDDocRepDocumentStatus         = tDDocumentReportAll.tcDDocRepDocumentStatus          
           tqDDocumentReportDraft.tcDDocRepReference              = tDDocumentReportAll.tcDDocRepReference               
           tqDDocumentReportDraft.ttDDocRepDueDate                = tDDocumentReportAll.ttDDocRepDueDate                 
           tqDDocumentReportDraft.tdDDocRepAmount                 = tDDocumentReportAll.tdDDocRepAmount                  
           tqDDocumentReportDraft.tcDDocRepAmountInText           = tDDocumentReportAll.tcDDocRepAmountInText            
           tqDDocumentReportDraft.tcDDocRepCurrency               = tDDocumentReportAll.tcDDocRepCurrency                
           tqDDocumentReportDraft.ttDDocRepCreationDate           = tDDocumentReportAll.ttDDocRepCreationDate            
           tqDDocumentReportDraft.tcDDocRepCompanyBRCode          = tDDocumentReportAll.tcDDocRepCompanyBRCode           
           tqDDocumentReportDraft.tcDDocRepCompanyName1           = tDDocumentReportAll.tcDDocRepCompanyName1            
           tqDDocumentReportDraft.tcDDocRepCompanyName2           = tDDocumentReportAll.tcDDocRepCompanyName2            
           tqDDocumentReportDraft.tcDDocRepCompanyStreet1         = tDDocumentReportAll.tcDDocRepCompanyStreet1          
           tqDDocumentReportDraft.tcDDocRepCompanyStreet2         = tDDocumentReportAll.tcDDocRepCompanyStreet2          
           tqDDocumentReportDraft.tcDDocRepCompanyZip             = tDDocumentReportAll.tcDDocRepCompanyZip              
           tqDDocumentReportDraft.tcDDocRepCompanyCity            = tDDocumentReportAll.tcDDocRepCompanyCity             
           tqDDocumentReportDraft.tcDDocRepCompanyCounty          = tDDocumentReportAll.tcDDocRepCompanyCounty           
           tqDDocumentReportDraft.tcDDocRepCompanyCountry         = tDDocumentReportAll.tcDDocRepCompanyCountry          
           tqDDocumentReportDraft.tcDDocRepCompanyBankNumber      = tDDocumentReportAll.tcDDocRepCompanyBankNumber       
           tqDDocumentReportDraft.tcDDocRepCompanyBankNumberForm  = tDDocumentReportAll.tcDDocRepCompanyBankNumberForm
           tqDDocumentReportDraft.tcDDocRepCompanyBankNumberExten = tDDocumentReportAll.tcDDocRepCompanyBankNumberExten  
           tqDDocumentReportDraft.tcDDocRepCompanyBankNumberValid = tDDocumentReportAll.tcDDocRepCompanyBankNumberValid  
           tqDDocumentReportDraft.tcDDocRepCompanyBankNumberSwift = tDDocumentReportAll.tcDDocRepCompanyBankNumberSwift  
           tqDDocumentReportDraft.tcDDocRepCompanyBankBRCode      = tDDocumentReportAll.tcDDocRepCompanyBankBRCode       
           tqDDocumentReportDraft.tcDDocRepCompanyBankName1       = tDDocumentReportAll.tcDDocRepCompanyBankName1        
           tqDDocumentReportDraft.tcDDocRepCompanyBankName2       = tDDocumentReportAll.tcDDocRepCompanyBankName2        
           tqDDocumentReportDraft.tcDDocRepCompanyBankStreet1     = tDDocumentReportAll.tcDDocRepCompanyBankStreet1      
           tqDDocumentReportDraft.tcDDocRepCompanyBankStreet2     = tDDocumentReportAll.tcDDocRepCompanyBankStreet2      
           tqDDocumentReportDraft.tcDDocRepCompanyBankZip         = tDDocumentReportAll.tcDDocRepCompanyBankZip          
           tqDDocumentReportDraft.tcDDocRepCompanyBankCity        = tDDocumentReportAll.tcDDocRepCompanyBankCity         
           tqDDocumentReportDraft.tcDDocRepCompanyBankCounty      = tDDocumentReportAll.tcDDocRepCompanyBankCounty       
           tqDDocumentReportDraft.tcDDocRepCompanyBankCountry     = tDDocumentReportAll.tcDDocRepCompanyBankCountry.     
        
    assign tqDDocumentReportDraft.tcDDocRepDebtorBRCode             = tDDocumentReportAll.tcDDocRepDebtorBRCode              
           tqDDocumentReportDraft.tcDDocRepDebtorName1              = tDDocumentReportAll.tcDDocRepDebtorName1               
           tqDDocumentReportDraft.tcDDocRepDebtorName2              = tDDocumentReportAll.tcDDocRepDebtorName2               
           tqDDocumentReportDraft.tcDDocRepDebtorStreet1            = tDDocumentReportAll.tcDDocRepDebtorStreet1             
           tqDDocumentReportDraft.tcDDocRepDebtorStreet2            = tDDocumentReportAll.tcDDocRepDebtorStreet2             
           tqDDocumentReportDraft.tcDDocRepDebtorZip                = tDDocumentReportAll.tcDDocRepDebtorZip                 
           tqDDocumentReportDraft.tcDDocRepDebtorCity               = tDDocumentReportAll.tcDDocRepDebtorCity                
           tqDDocumentReportDraft.tcDDocRepDebtorCounty             = tDDocumentReportAll.tcDDocRepDebtorCounty              
           tqDDocumentReportDraft.tcDDocRepDebtorCountry            = tDDocumentReportAll.tcDDocRepDebtorCountry             
           tqDDocumentReportDraft.tcDDocRepDebtorCode               = tDDocumentReportAll.tcDDocRepDebtorCode                
           tqDDocumentReportDraft.tcDDocRepDebtorVatNumber          = tDDocumentReportAll.tcDDocRepDebtorVatNumber           
           tqDDocumentReportDraft.tcDDocRepDebtorBankNumber         = tDDocumentReportAll.tcDDocRepDebtorBankNumber          
           tqDDocumentReportDraft.tcDDocRepDebtorBankNumberForm     = tDDocumentReportAll.tcDDocRepDebtorBankNumberForm
           tqDDocumentReportDraft.tcDDocRepDebtorBankNumberExtent   = tDDocumentReportAll.tcDDocRepDebtorBankNumberExtent    
           tqDDocumentReportDraft.tcDDocRepDebtorBankNumberVal      = tDDocumentReportAll.tcDDocRepDebtorBankNumberVal       
           tqDDocumentReportDraft.tcDDocRepDebtorBankNumberSwift    = tDDocumentReportAll.tcDDocRepDebtorBankNumberSwift     
           tqDDocumentReportDraft.tcDDocRepDebtorBankBRCode         = tDDocumentReportAll.tcDDocRepDebtorBankBRCode          
           tqDDocumentReportDraft.tcDDocRepDebtorBankBRName1        = tDDocumentReportAll.tcDDocRepDebtorBankBRName1         
           tqDDocumentReportDraft.tcDDocRepDebtorBankBRName2        = tDDocumentReportAll.tcDDocRepDebtorBankBRName2         
           tqDDocumentReportDraft.tcDDocRepDebtorBankBRStreet1      = tDDocumentReportAll.tcDDocRepDebtorBankBRStreet1       
           tqDDocumentReportDraft.tcDDocRepDebtorBankBRStreet2      = tDDocumentReportAll.tcDDocRepDebtorBankBRStreet2       
           tqDDocumentReportDraft.tcDDocRepDebtorBankBRZip          = tDDocumentReportAll.tcDDocRepDebtorBankBRZip           
           tqDDocumentReportDraft.tcDDocRepDebtorBankBRCity         = tDDocumentReportAll.tcDDocRepDebtorBankBRCity          
           tqDDocumentReportDraft.tcDDocRepDebtorBankBRCounty       = tDDocumentReportAll.tcDDocRepDebtorBankBRCounty        
           tqDDocumentReportDraft.tcDDocRepDebtorBankBRCountry      = tDDocumentReportAll.tcDDocRepDebtorBankBRCountry       
           tqDDocumentReportDraft.tcDDocRepDebtorVatNumber          = tDDocumentReportAll.tcDDocRepDebtorVatNumber.          

    assign tqDDocumentReportDraft.tcDDocRepDInvoiceDebtorCode     = tDDocumentReportAll.tcDDocRepDInvoiceDebtorCode
           tqDDocumentReportDraft.tiDDocRepDInvoiceYear           = tDDocumentReportAll.tiDDocRepDInvoiceYear            
           tqDDocumentReportDraft.tiDDocRepDInvoicePeriod         = tDDocumentReportAll.tiDDocRepDInvoicePeriod          
           tqDDocumentReportDraft.tcDDocRepDInvoiceJournalCode    = tDDocumentReportAll.tcDDocRepDInvoiceJournalCode     
           tqDDocumentReportDraft.tiDDocRepDInvoiceVoucher        = tDDocumentReportAll.tiDDocRepDInvoiceVoucher         
           tqDDocumentReportDraft.ttDDocRepDInvoiceDate           = tDDocumentReportAll.ttDDocRepDInvoiceDate            
           tqDDocumentReportDraft.tcDDocRepDInvoiceReference      = tDDocumentReportAll.tcDDocRepDInvoiceReference       
           tqDDocumentReportDraft.tdDDocRepDInvoiceBalanceTC      = tDDocumentReportAll.tdDDocRepDInvoiceBalanceTC       
           tqDDocumentReportDraft.ttDDocRepDInvoiceDueDate        = tDDocumentReportAll.ttDDocRepDInvoiceDueDate         
           tqDDocumentReportDraft.tcDDocRepDInvoiceCurrencyCode   = tDDocumentReportAll.tcDDocRepDInvoiceCurrencyCode    
           tqDDocumentReportDraft.tiDDocRepDInvoiceCurrNumbOfDec  = tDDocumentReportAll.tiDDocRepDInvoiceCurrNumbOfDec  
           tqDDocumentReportDraft.ttDDocRepDInvoiceDiscountDueDat = tDDocumentReportAll.ttDDocRepDInvoiceDiscountDueDat  
           tqDDocumentReportDraft.tdDDocRepDInvoiceXRefAmountTC   = tDDocumentReportAll.tdDDocRepDInvoiceXRefAmountTC    
           tqDDocumentReportDraft.tdDDocRepDInvoiceXRefDiscAmTC   = tDDocumentReportAll.tdDDocRepDInvoiceXRefDiscAmTC    
           .
            
    assign tqDDocumentReportDraft.tdDDocRepDInvoiceTotalBalanceTC = tDDocumentReportAll.tdDDocRepDInvoiceTotalBalanceTC 
           tqDDocumentReportDraft.tdDDocRepDInvoiceTotalAllocTC   = tDDocumentReportAll.tdDDocRepDInvoiceTotalAllocTC   
           tqDDocumentReportDraft.tdDDocRepDInvoiceTotalDiscTC    = tDDocumentReportAll.tdDDocRepDInvoiceTotalDiscTC.
           */
end.


for each tqDDocumentReportDraft:
    <Q-4 run GetBankPayCodeByInvID (all) (Read) (NoCache)
       (input tqDDocumentReportDraft.tiInvoice_ID, (InvoiceId)
        output dataset tqGetBankPayCodeByInvID) in BDDocumentReport >
    find first tqGetBankPayCodeByInvID no-error.
    if not available tqGetBankPayCodeByInvID
    then next.
    else if tqGetBankPayCodeByInvID.tcPayFormatTypeCode <> 'FR-LCR-AR':U
    then next.
    else do:
        assign tqDDocumentReportDraft.tcPayFormatCode = tqGetBankPayCodeByInvID.tcPayFormatCode
               tqDDocumentReportDraft.tcPayFormatCodeDescription = tqGetBankPayCodeByInvID.tcPayFormatCodeDescription.           
    end.
end. /* for each tqDDocumentReportDraft */