project QadFinancials > class BClosingPostingsReport > method SetDataItemsBasedOnFilterTTDet

Description

Detail method for SetDataItemsBasedOnFilterTT


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BClosingPostingsReport.AccUnmarkedTransactionsDet
method BClosingPostingsReport.AllocationCheckDet
method BClosingPostingsReport.JournalEntryBalanceDet
method BClosingPostingsReport.RecurringEntriesDet
method BClosingPostingsReport.SetDataItemsBasedOnFilterTT
method BClosingPostingsReport.VoucherCompletenessDet


program code (program1/bclosingpostingsreport.p)

/* Find all filter-parameters and assign them to the correct data-item */
assign vcCPCompanyCodeFilter        = ?
       viPeriodYearFilter           = ?
       viPeriodPeriodFilter         = ?
       viFromPeriodFilter           = 0
       viTillPeriodFilter           = 99
       vcCPCandoJournalCodeFilter   = ?
       vlCPErrorsOnlyFilter         = ?
       vlNotLinkedFilter            = ?
       vlCheckHistoryUpdateFilter   = ?
       vcSortFilter                 = ?
       vcSortFilter1                = ?
       vcSortFilter2                = ?
       vcCPCompanyCodeFilter        = ?.
             
/* ======================================================== */
/* Translate the FilterValues to the correct data items     */
/* The FilterValues can be found in GetBusinessField method */
/* ======================================================== */
for each tFilter:

    case tFilter.tcBusinessFieldName:

        /* Company */
        when "Company_CANDO":U
        then do:
            if vcCPCompanyCodeFilter = ? then assign vcCPCompanyCodeFilter = "":U.
            do viCount = 1 to num-entries(tFilter.tcParameterValue,",":U):            
                if index(vcCPCompanyCodeFilter, entry(viCount, tFilter.tcParameterValue,",":U)) = 0
                then do:
                    if vcCPCompanyCodeFilter = "":U then assign vcCPCompanyCodeFilter = entry(viCount, tFilter.tcParameterValue,",":U).
                    else assign vcCPCompanyCodeFilter = vcCPCompanyCodeFilter + ",":U +  entry(viCount, tFilter.tcParameterValue,",":U).
                end.
            end. /* do viCount = 1 to num-entries(tFilter.tcParameterValue,",":U) */
        end. /* when "Company_CANDO":U */
        /* PeriodYear */
        when "PeriodYear":U
        then assign viPeriodYearFilter = int(tFilter.tcParameterValue) no-error.

        /* PeriodPeriod */
        when "PeriodPeriod":U
        then assign viPeriodPeriodFilter = int(tFilter.tcParameterValue) no-error.

        /* PeriodPeriod_RANGE */
        when "PeriodPeriod_RANGE":U
        then do:
            if tFilter.tcOperator = ">=":U
            then assign viFromPeriodFilter = int(tFilter.tcParameterValue) no-error.
            else 
            if tFilter.tcOperator = "<=":U
            then assign viTillPeriodFilter = int(tFilter.tcParameterValue) no-error.
        end.

        /* Journal */           
        when "JournalCode_CANDO":U
        then assign vcCPCandoJournalCodeFilter = tFilter.tcParameterValue no-error.

        /* ErrosOnly */
        when "ErrorsOnly":U
        then assign vlCPErrorsOnlyFilter = trim(tFilter.tcParameterValue) = "yes":U or
                                           trim(tFilter.tcParameterValue) = "true":U.

        /* Not Linked */
        when "NotLinked":U
        then assign vlNotLinkedFilter = trim(tFilter.tcParameterValue) = "yes":U or
                                        trim(tFilter.tcParameterValue) = "true":U. 

        /* CheckHistory */
        when "CheckHistory":U
        then assign vlCheckHistoryUpdateFilter = if tFilter.tcParameterValue = "true":U 
                                                 then true 
                                                 else if tFilter.tcParameterValue = "false":U 
                                                      then false 
                                                      else vlCheckHistoryUpdateFilter no-error.
    
        /* SortBy */
        when "SortBy":U
        then assign vcSortFilter =  tFilter.tcParameterValue.
        
        /* SortBy1 */
        when "SortBy1":U
        then assign vcSortFilter1 =  tFilter.tcParameterValue.

        /* SortBy2 */
        when "SortBy2":U
        then assign vcSortFilter2 = tFilter.tcParameterValue.
                                    
    end case.
end.

/* Change to One period if possible */
if viFromPeriodFilter = viTillPeriodFilter and viFromPeriodFilter <> ?
then assign viPeriodPeriodFilter = viFromPeriodFilter
            viFromPeriodFilter   = ?
            viTillPeriodFilter   = ?.
            
/* Get Info about Company (number of entries) */
<M-74 run CompanyEntries
   (input  vcCPCompanyCodeFilter (icCPCompanyCodeFilter), 
    output viCompanyEntries (oiCompanyEntries), 
    output viFcReturnSuper (oiReturnStatus)) in BClosingPostingsReport>
if viFcReturnSuper < 0
then do:
    assign oiReturnStatus = viFcReturnSuper.
end.