project QadFinancials > class BJournalEntry > method DefaultValuesPostingForUI


Parameters


oiYearoutputinteger
oiPeriodoutputinteger
otDateoutputdate
ocJournalCodeoutputcharacter
ocLayerTypeCodeoutputcharacter
icJournalTypeCodeinputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program4/bjournalentry.p)

<I-1 {bFcStartAndOpenInstance
            &CLASS              = "BPeriod"}>
  
<M-2 run GetDefaultPeriodDate
   (input  ? (iiYearIn), 
    input  ? (iiPeriodIn), 
    input  today (itDateIn), 
    input  ? (ilOpenForPurchase), 
    input  ? (ilOpenForSales), 
    input  ? (ilOpenForInventory), 
    output oiYear (oiYear), 
    output oiPeriod (oiPeriod), 
    output otDate (otPostingDate), 
    output viFcReturnSuper (oiReturnStatus)) in BPeriod>
    
<Q-4 run LookupSharedSetForCompany (all) (Read) (NoCache)
   (input viCompanyId, (CompanyId)
    input {&SHAREDSETTYPECODE-JOURNAL}, (SharedSetType)
    output dataset tqSharedSetForCompany) in BCompany >
find first tqSharedSetForCompany no-error.
if available tqSharedSetForCompany
then do:
    <Q-5 assign vlFcQueryRecordsAvailable = JournalForProfileLinkDef (NoCache)
       (input ?, (CompanyId)
        input if available tqSharedSetForCompany then tqSharedSetForCompany.tiSharedset_Id else 0, (SharedSetId)
        input icJournalTypeCode, (JournalTypeCode)
        input yes, (JournalIsActive)
        input ?, (JournalTypeIsCorrection)
        input {&JOURNALCONTROL-FINANCIAL}, (JournalControl)) in BJournal >
    if vlFcQueryRecordsAvailable = true
    then do:
        <Q-6 run JournalForProfileLinkDef (all) (Read) (NoCache)
           (input ?, (CompanyId)
            input if available tqSharedSetForCompany then tqSharedSetForCompany.tiSharedset_Id else 0, (SharedSetId)
            input icJournalTypeCode, (JournalTypeCode)
            input yes, (JournalIsActive)
            input ?, (JournalTypeIsCorrection)
            input {&JOURNALCONTROL-FINANCIAL}, (JournalControl)
            output dataset tqJournalForProfileLinkDef) in BJournal >
        find first tqJournalForProfileLinkDef no-error.
        if available tqJournalForProfileLinkDef
        then do:
            assign ocJournalCode   = tqJournalForProfileLinkDef.tcJournalCode
                   ocLayerTypeCode = tqJournalForProfileLinkDef.tcLayerTypeCode.
        end.
              
    end.
end.
<I-3 {bFcCloseAndStopInstance
            &CLASS           = "BPeriod"}>