project QadFinancials > class BFRWReportMaster > method CalcAllSelectFRWReportMaster

query calculated fields procedure

Description

Assign a value to query calculated fields


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
query SelectFRWReportMaster


program code (program1/bfrwreportmaster.p)

assign vcFRWRepMstrCodeDescOptions = {&FRWREPMSTRS}
       vcFRWRepMstrThousandMillions = {&FRWREPMSTRAMOUNTROUNDINGS}
       vcFRWRepMstrZeroSuppressTypes = {&FRWREPMSTRZEROSUPPRESSES}
       vcFRWRepMstrPrintTransactionses = {&FRWREPMSTRPRINTTRANSACTIONSES}.


create query vhQuery in widget-pool "non-persistent".
vhQuery:forward-only = yes.
vhQuery:set-buffers(ih_Buffer).
vhQuery:query-prepare("for each ":U + ih_Buffer:table).
vhQuery:query-open().
vhQuery:get-first().
do while not vhQuery:query-off-end:
    assign {&tcFRWRepMstrThousandMillionTr} = "?":U
           {&tcFRWRepMstrCodeDescOptionTr}  = "?":U
           {&tcFRWRepMstrZeroSuppressTypeTr} = "?":U
           {&tcFRWRepMstrPrintTransactionsTr} = "?":U.

    do viCounter = num-entries(vcFRWRepMstrCodeDescOptions, chr(2)) to 2 by -2:
        if entry(viCounter, vcFRWRepMstrCodeDescOptions, chr(2)) = {&tcFRWRepMstrCodeDescOption}
        then do:
            assign {&tcFRWRepMstrCodeDescOptionTr} = entry(viCounter - 1, vcFRWRepMstrCodeDescOptions, chr(2)).
            leave.
        end.
    end.

    do viCounter = num-entries(vcFRWRepMstrThousandMillions, chr(2)) to 2 by -2:
        if entry(viCounter, vcFRWRepMstrThousandMillions, chr(2)) = {&tcFRWRepMstrThousandMillion}
        then do:
            assign {&tcFRWRepMstrThousandMillionTr} = entry(viCounter - 1, vcFRWRepMstrThousandMillions, chr(2)).
            leave.
        end.
    end.

    if {&tcFRWRepMstrThousandMillionTr} = "":U or {&tcFRWRepMstrThousandMillionTr} = ? then 
        assign {&tcFRWRepMstrThousandMillionTr} = {&FRWREPMSTRAMOUNTROUNDING-DECIMAL-TR}.

    do viCounter = num-entries(vcFRWRepMstrZeroSuppressTypes, chr(2)) to 2 by -2:
        if entry(viCounter, vcFRWRepMstrZeroSuppressTypes, chr(2)) = {&tcFRWRepMstrZeroSuppressType}
        then do:
            assign {&tcFRWRepMstrZeroSuppressTypeTr} = entry(viCounter - 1, vcFRWRepMstrZeroSuppressTypes, chr(2)).
            leave.
        end.
    end.

    if {&tcFRWRepMstrZeroSuppressTypeTr} = "":U or {&tcFRWRepMstrZeroSuppressTypeTr} = ? then 
        assign {&tcFRWRepMstrZeroSuppressTypeTr} = {&FRWREPMSTRZEROSUPPRESS-NONE-TR}.

    do viCounter = num-entries(vcFRWRepMstrPrintTransactionses, chr(2)) to 2 by -2:
        if entry(viCounter, vcFRWRepMstrPrintTransactionses, chr(2)) = {&tcFRWRepMstrPrintTransactions}
        then do:
            assign {&tcFRWRepMstrPrintTransactionsTr} = entry(viCounter - 1, vcFRWRepMstrPrintTransactionses, chr(2)).
            leave.
        end.
    end.
    vhQuery:get-next().
end.
vhQuery:query-close().
delete object vhQuery.