report procedure
Description
Detail method for RecurringEntries
Parameters
dcrRecurringEntries | output | dataset | Dataset of RecurringEntries. |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program7/bclosingpostingsreport.p)
empty temp-table tqRecurringEntries.
<M-97 run SetDataItemsBasedOnFilterTTDet (output oiReturnStatus (oiReturnStatus)) in BClosingPostingsReport>
if viPeriodPeriodFilter = ? or viPeriodYearFilter = ?
then do:
<M-14 run SetMessage
(input #T-92'The GL Period filter requires a value.':50(2285)T-92# (icMessage),
input '':U (icArguments),
input '':U (icFieldName),
input '':U (icFieldValue),
input 'E':U (icType),
input 3 (iiSeverity),
input '':U (icRowid),
input 'qadfin-843121':U (icFcMsgNumber),
input '':U (icFcExplanation),
input '':U (icFcIdentification),
input '':U (icFcContext),
output oiReturnStatus (oiReturnStatus)) in BClosingPostingsReport>
assign oiReturnStatus = -1.
end.
if oiReturnStatus <> 0
then return.
/* Company iteration */
do viCPCompanyIterator = 1 to viCompanyEntries:
/* Assign company ID based on code */
if vcCPCompanyCodeFilter = ?
then do:
assign viCPCurrentCompany_ID = viCompanyId.
<Q-50 run CompanyPrim (first) (Read) (NoCache)
(input viCompanyId, (LookupCompanyId)
input ?, (CompanyCode)
output dataset tqCompanyPrim) in BCompany>
find first tqCompanyPrim no-error.
if available tqCompanyPrim
then assign vcCPCurrentCompany = tqCompanyPrim.tcCompanyCode.
end.
else do:
assign vcCPCurrentCompany = entry(viCPCompanyIterator ,vcCPCompanyCodeFilter,",":U).
<Q-29 run CompanyPrim (first) (Read) (NoCache)
(input ?, (LookupCompanyId)
input vcCPCurrentCompany, (CompanyCode)
output dataset tqCompanyPrim) in BCompany>
find first tqCompanyPrim no-error.
if available tqCompanyPrim
then assign viCPCurrentCompany_ID = tqCompanyPrim.tiCompany_ID.
end.
<Q-7 run PeriodByYearPeriod (all) (Read) (NoCache)
(input viCPCurrentCompany_ID, (CompanyId)
input viPeriodYearFilter, (PeriodYear)
input viPeriodPeriodFilter, (PeriodPeriod)
input ?, (PeriodId)
output dataset tqPeriodByYearPeriod) in BPeriod>
find first tqPeriodByYearPeriod no-error.
if not available tqPeriodByYearPeriod
then return.
<Q-84 run BaseRecurringEntries (all) (Read) (NoCache)
(input viCPCurrentCompany_ID, (CompanyId)
input tqPeriodByYearPeriod.ttPeriodStartDate, (FromDate)
input tqPeriodByYearPeriod.ttPeriodEndDate, (ToDate)
input {&RECENTRYLINESTATUS-WAITING}, (Status)
input true, (Active)
output dataset tqBaseRecurringEntries) in BClosingPostingsReport>
for each tqBaseRecurringEntries:
create tqRecurringEntries.
buffer-copy tqBaseRecurringEntries to tqRecurringEntries.
case tqRecurringEntries.tcRecEntryFreq:
when {&RECENTRYFREQ-MANUALLY}
then assign tqRecurringEntries.tcRecEntryFreq = {&RECENTRYFREQ-MANUALLY-TR}.
when {&RECENTRYFREQ-MONTHLY}
then assign tqRecurringEntries.tcRecEntryFreq = {&RECENTRYFREQ-MONTHLY-TR}.
when {&RECENTRYFREQ-PERIOD}
then assign tqRecurringEntries.tcRecEntryFreq = {&RECENTRYFREQ-PERIOD-TR}.
when {&RECENTRYFREQ-QUARTERLY}
then assign tqRecurringEntries.tcRecEntryFreq = {&RECENTRYFREQ-QUARTERLY-TR}.
when {&RECENTRYFREQ-WEEKLY}
then assign tqRecurringEntries.tcRecEntryFreq = {&RECENTRYFREQ-WEEKLY-TR}.
end.
case tqRecurringEntries.tcRecEntryLineStatus:
when {&RECENTRYLINESTATUS-DELETED}
then assign tqRecurringEntries.tcRecEntryLineStatus = {&RECENTRYLINESTATUS-DELETED-TR}.
when {&RECENTRYLINESTATUS-POSTED}
then assign tqRecurringEntries.tcRecEntryLineStatus = {&RECENTRYLINESTATUS-POSTED-TR}.
when {&RECENTRYLINESTATUS-WAITING}
then assign tqRecurringEntries.tcRecEntryLineStatus = {&RECENTRYLINESTATUS-WAITING-TR}.
end.
end.
end.
if not available tqRecurringEntries
then do:
create tqRecurringEntries.
assign tqRecurringEntries.tiExceptionNbr = -1
tqRecurringEntries.tcExceptionMsg = #T-57'No pending recurring entries were found for the selected GL period.':255(57355)T-57#.
end.