project QadFinancials > include ProcesstFilter.i

Description

This include processes tFilter to the CB implementation.


include parameters


&VCDIFFData item containing the value which will be passed to the query as a '<>'
&VCFROMData item containing the value which will be passed to the query as a '>='
&VCMATCHESData item containing the value which will be passed to the query as a 'matches'
&VCTOData item containing the value which will be passed to the query as a '<='


Internal usage


QadFinancials
method BCOAMask.ApiCOAMaskSelect
method BCOAMask.ApiCOAMaskSelectAll
method BGL.ApiGLBCBalanceCalculation
method BGL.ApiGLTCBalanceCalculation


include code

/* ******************************************************************** */
/* This include willtreat the tFilter and convert it to some data items */
/* which can be used by queries in CBF                                  */
/* This includes expects the tFilter to be available                    */
/* Input The BusinessFieldName                                          */
/* Output : there are 4 data-items returned                             */
/*           {&vcMatches}                                               */
/*           {&vcDIFF}                                                  */
/*           {&vcFrom}                                                  */
/*           {&vcTo}                                                    */
/* ******************************************************************** */

/* is null and is not null */
if tFilter.tcParameterValue = ''
then do:
    if tFilter.tcOperator = '='
    then assign {&vcMatches} = '-999999'.
    else if tFilter.tcOperator = '<>'
    then assign {&vcDIFF} = '-999999'.
end.
else
/* equals */
if tFilter.tcOperator = '=' 
then assign {&vcMatches} = tFilter.tcParameterValue.
else
/* contains */
if tFilter.tcOperator = 'matches'
then assign {&vcMatches} = tFilter.tcParameterValue.
else
/* begins */
if tFilter.tcOperator = 'begins' 
then assign {&vcMatches} = tFilter.tcParameterValue + '*':U.
else 
/* not equals */
if tFilter.tcOperator = '<>'
then assign {&vcDIFF} = tFilter.tcParameterValue.
else 
/* range and start at */
if tFilter.tcOperator = '>='
then assign {&vcFrom} = tFilter.tcParameterValue.
else 
/* greater than and less than */
if tFilter.tcOperator = '<='
then assign {&vcTo} = tFilter.tcParameterValue.
else 
/* greater than */
if tFilter.tcOperator = '>'
then assign {&vcFrom} = tFilter.tcParameterValue
            {&vcDIFF} = tFilter.tcParameterValue.
else 
/* less than */
if tFilter.tcOperator = '<'
then assign {&vcTo}   = tFilter.tcParameterValue
            {&vcDIFF} = tFilter.tcParameterValue.

if {&vcFrom} = {&vcTo} and {&vcFrom} <> '' and {&vcFrom} <> ?
then assign {&vcMatches} = {&vcFrom}
            {&vcFrom}    = ''
            {&vcTo}      = ''.