project QadFinancials > class BPosting > method ValidateComponentPostPeriodJournalClosed
Description
Validates whether a posting can be made, the posting should be blocked if the daybook belongs to a daybook mask applied to the period.
Parameters
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program4/bposting.p)
def var doPeriodCMaskJournal as com.qad.eefin.bcmask.PeriodCMaskJournal no-undo.
def var doPeriodCMaskJournalGroup as com.qad.eefin.bcmask.PeriodCMaskJournalGroup no-undo.
assign vlIsJournalLocked = false.
/* Check if the posting can be made */
do on error undo, throw:
assign doPeriodCMaskJournal = new com.qad.eefin.bcmask.PeriodCMaskJournal(t_sPosting.Company_ID, /* Company ID */
t_sPosting.Period_ID, /* Period ID */
?, /* Period Year */
?, /* Period Period */
?, /* CMask ID */
"", /* CMask Code */
true, /* CMask Is Active */
t_sPosting.Journal_ID, /* Journal ID */
""). /* Journal Code */
if doPeriodCMaskJournal:available
then assign vlIsJournalLocked = true.
else do:
assign doPeriodCMaskJournalGroup = new com.qad.eefin.bcmask.PeriodCMaskJournalGroup(t_sPosting.Company_ID, /* Company ID */
t_sPosting.Period_ID, /* Period ID */
?, /* Period Year */
?, /* Period Period */
?, /* CMask ID */
"", /* CMask Code */
true, /* CMask Is Active */
t_sPosting.Journal_ID, /* Journal ID */
""). /* Journal Code */
if doPeriodCMaskJournalGroup:available
then assign vlIsJournalLocked = true.
end. /* if doPeriodCMaskJournal:available */
if vlIsJournalLocked
then do:
assign vcMsgExplanation = <M-70 GetErrorExplanation
(input t_sPosting.tc_Rowid (icPostingRowId),
input ? (icPostingLineRowId),
output viFcReturnSuper (oiReturnStatus)) in BPosting>.
assign oiReturnStatus = -1
vcMessage = #T-77'The daybook (&1) is locked for this posting date (&2).':100(825454490)T-77#
vcMessage = substitute(vcMessage, t_sPosting.tcJournalCode, t_sPosting.PostingDate).
<M-90 run SetMessage
(input vcMessage (icMessage),
input '':U (icArguments),
input '':U (icFieldName),
input '':U (icFieldValue),
input 'E':U (icType),
input 3 (iiSeverity),
input '':U (icRowid),
input 'qadfin-751158':U (icFcMsgNumber),
input vcMsgExplanation (icFcExplanation),
input '':U (icFcIdentification),
input '':U (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BPosting>
return.
end. /* if vlIsJournalLocked */
finally:
delete object doPeriodCMaskJournal no-error.
delete object doPeriodCMaskJournalGroup no-error.
end. /* finally */
end. /* do on error undo, leave: */