project QadFinancials > class BCInvoice > method GetMFJournal


Parameters


iiCompanyIdinputinteger
icReasonAllocationStatusinputcharacter
ocMFJournalCodeoutputcharacter
ocLayerTypeCodeoutputcharacterLayer Type Code
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BCInvoice.ApiStdMaintainTTWithIntPost
method BCInvoice.DefaultValuesReason
method BCInvoice.DefaultValuesSupplier


program code (program3/bcinvoice.p)

<Q-1 run LookupSharedSetForCompany (all) (Read) (NoCache)
          (input iiCompanyId, (CompanyId)
           input {&SHAREDSETTYPECODE-JOURNAL}, (SharedSetType)
           output dataset tqSharedSetForCompany) in BCompany >

find first tqSharedSetForCompany where
           tqSharedSetForCompany.tiCompany_ID        = iiCompanyId and
           tqSharedSetForCompany.tcSharedSetTypeCode = {&SHAREDSETTYPECODE-JOURNAL}
           no-error.

assign viJournalSharedSetId = if available tqSharedSetForCompany
                              then tqSharedSetForCompany.tiSharedSet_ID
                              else 0.

<Q-2 run JournalForProfileLinkDef (all) (Read) (NoCache)
   (input iiCompanyId, (CompanyId)
    input viJournalSharedSetId, (SharedSetId)
    input {&JOURNALTYPE-CIREC}, (JournalTypeCode)
    input true, (JournalIsActive)
    input ?, (JournalTypeIsCorrection)
    input {&JOURNALCONTROL-FINANCIAL}, (JournalControl)
    output dataset tqJournalForProfileLinkDef) in BJournal >

if icReasonAllocationStatus = {&ALLOCSTATUS-TRANSALLOC}
then find first tqJournalForProfileLinkDef where
                tqJournalForProfileLinkDef.tcJournalTypeCode = {&JOURNALTYPE-CIREC}        and
                tqJournalForProfileLinkDef.tlJournalIsActive = true                        and
                tqJournalForProfileLinkDef.tcJournalControl  = {&JOURNALCONTROL-FINANCIAL} and
                tqJournalForProfileLinkDef.tcLayerTypeCode   = {&LAYERTYPECODE-TRANSIENT}
                no-error.
else
if icReasonAllocationStatus = {&ALLOCSTATUS-ALLOC}
then find first tqJournalForProfileLinkDef where
                tqJournalForProfileLinkDef.tcJournalTypeCode = {&JOURNALTYPE-CIREC}        and
                tqJournalForProfileLinkDef.tlJournalIsActive = true                        and
                tqJournalForProfileLinkDef.tcJournalControl  = {&JOURNALCONTROL-FINANCIAL} and
                tqJournalForProfileLinkDef.tcLayerTypeCode   = {&LAYERTYPECODE-OFFICIAL}
                no-error.
else find first tqJournalForProfileLinkDef where
                tqJournalForProfileLinkDef.tcJournalTypeCode = {&JOURNALTYPE-CIREC} and
                tqJournalForProfileLinkDef.tlJournalIsActive = true                 and
                tqJournalForProfileLinkDef.tcJournalControl  = {&JOURNALCONTROL-FINANCIAL}
                no-error.

assign ocMFJournalCode = if available tqJournalForProfileLinkDef
                         then tqJournalForProfileLinkDef.tcJournalCode
                         else "":U 
       ocLayerTypeCode = if available tqJournalForProfileLinkDef
                         then tqJournalForProfileLinkDef.tcLayerTypeCode
                         else "":U.