project QadFinancials > class BClosingPostingsReport > method ProcessAccUnMarkedTransctions

Description

This method is to process Unmarked transactionsl report


Parameters


iiPeriodYearinputinteger
iiPeriodPeriodinputinteger
ocConCheckLineDetResultoutputcharacter
oiConcheckLineDetDurationoutputinteger
icFileinputcharacter
otConCheckLineDetStartDateoutputdate
oiConCheckLineDetStartTimeoutputinteger
oiErrorNumbersoutputinteger
iiCompanyIDinputinteger
ocConCheckLineDetVersionoutputcharacter
icAppVersioninputcharacter
icSumFileinputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program7/bclosingpostingsreport.p)

/* =================================================================== */
/* This method is called by ConCheckProcessor to call Unmarked         */
/* Transctions report and log the result.                              */
/* =================================================================== */
assign vdStartEtime2 = etime(no).
assign otConCheckLineDetStartDate = now
       oiConCheckLineDetStartTime = time
       oiErrorNumbers             = 0
       ocConCheckLineDetVersion   = icAppVersion + '.1'.

empty temp-table tqAccUnmarkedTransactions.

create tFilter.
assign tFilter.tcBusinessFieldName = 'PeriodYear':U
       tFilter.tcOperator          = '='
       tFilter.tcParameterValue    = string(iiPeriodYear).

create tFilter.
assign tFilter.tcBusinessFieldName = 'PeriodPeriod':U
       tFilter.tcOperator          = '='
       tFilter.tcParameterValue    = string(iiPeriodPeriod).

<Q-45 run CompanyPrim (all) (Read) (NoCache)
   (input iiCompanyID, (LookupCompanyId)
    input ?, (CompanyCode)
    output dataset tqCompanyPrim) in BCompany >
find first tqCompanyPrim no-error.
if available tqCompanyPrim
then do:
    create tFilter.
    assign tFilter.tcBusinessFieldName = 'Company_CANDO':U
           tFilter.tcOperator          = '='
           tFilter.tcParameterValue    = tqCompanyPrim.tcCompanyCode.
end.

<M-53 run AccUnmarkedTransactionsDet
   (output dcrAccUnmarkedTransactions (dcrAccUnmarkedTransactions), 
    output oiReturnStatus (oiReturnStatus)) in BClosingPostingsReport>

if can-find(first tqAccUnmarkedTransactions where tqAccUnmarkedTransactions.tiExceptionNbr = -1)
then assign ocConCheckLineDetResult = {&CONCHECKRESULT-PASSED}.
else assign ocConCheckLineDetResult = {&CONCHECKRESULT-FAILED}.

assign oiConcheckLineDetDuration = etime - vdStartEtime2.

output stream sCloseOut to value(icFile) append.

/* to format the total duration time */
assign viMilliSecs2 = oiConCheckLineDetDuration.
assign viSecs2 = TRUNCATE (oiConCheckLineDetDuration / 1000, 0).
assign viMilliSecs2 = viMilliSecs2 mod 1000.
assign vcTotalTime2 = string(viSecs2, 'HH:MM:SS')  +  '.'  +  string(viMilliSecs2).

put stream sCloseOut unformatted ' 'skip.
put stream sCloseOut unformatted '##### Unmarked transactions #####' skip.
PUT STREAM sCloseOut unformatted 'Version: ' ocConCheckLineDetVersion skip.
put stream sCloseOut unformatted 'Validation Start At: ' string(now, '99/99/9999 HH:MM:SS') skip.
put stream sCloseOut unformatted 'Execution Duration: ' oiConCheckLineDetDuration ' ms' skip.
put stream sCloseOut unformatted 'Execution Duration: ' vcTotalTime2 skip.
put stream sCloseOut unformatted 'Execution Result: ' ocConCheckLineDetResult skip.

if ocCOnCheckLineDetResult = {&CONCHECKRESULT-FAILED}
then do:
    put stream sCloseOut 'Daybook Code':U at 1
                         'Voucher':U      to 30
                         'Posting Date':U to 50
                         'Description':U  to 80 skip.

    for each tqAccUnmarkedTransactions
       where tqAccUnmarkedTransactions.tiExceptionNbr <> - 1
       break by tqAccUnmarkedTransactions.tcJournalCode:
        assign oiErrorNumbers = oiErrorNumbers + 1.
        put stream sCloseOut unformatted tqAccUnmarkedTransactions.tcJournalCode                         at 1
                                         string(tqAccUnmarkedTransactions.tiPostingVoucher, "999999999") to 30
                                         tqAccUnmarkedTransactions.ttAccountingDate                      to 50
                                         tqAccUnmarkedTransactions.tcPostingParentText                   to 80 skip.
    end.
end.

put stream sCloseOut unformatted '<Error Count:> ' oiErrorNumbers skip.
put stream sCloseOut unformatted '**********************************************************************' skip.
output stream sCloseOut close.