project QadFinancials > class BCashReport > method InitialValues

Description

Add code here to initialize the calculated fields of a 'new' record (= a record that must be created in the application database) in a class temp-table.


Parameters


icTableNameinputcharacterName of the database table of which a record is created in the class temp-table.
oiReturnStatusoutputinteger


Internal usage


unused


program code (program/bcashreport.p)

<ANCESTOR-CODE>

if icTableName = "CashReport":U
then do:
    assign tCashReport.Company_ID                = viCompanyId
           tCashReport.Usr_ID                    = viUsrId
           tCashReport.tcUsrLogin                = vcUserLogin
           tCashReport.CashReportDaysInterval    = 7
           tCashReport.CashReportNumberOfPeriods = 12
           tCashReport.CashReportCurrencyView    = {&CURRENCYTYPE-LC}
           tCashReport.Currency_ID               = viCompanyLCId
           tCashReport.tcCurrencyCode            = vcCompanyLC.

    <Q-2 run PeriodByStartEndDate (all) (Read) (NoCache)
       (input viCompanyId, (CompanyId)
        input today, (Date)
        output dataset tqPeriodByStartEndDate) in BPeriod >

    find first tqPeriodByStartEndDate
               no-error.

    if available tqPeriodByStartEndDate
    then assign tCashReport.TillPeriod_ID  = tqPeriodByStartEndDate.tiPeriod_ID
                tCashReport.tiPeriodYear   = tqPeriodByStartEndDate.tiPeriodYear
                tCashReport.tiPeriodPeriod = tqPeriodByStartEndDate.tiPeriodPeriod.
end.

if icTableName = "CashReportGL":U
then assign tCashReportGL.CashReportGLIsAccount     = true
            tCashReportGL.CashReportGLIsCumul       = true
            tCashReportGL.tcAccount                 = {&CASHREPORTACCOUNT-ACC}
            tCashReportGL.tcCumul                   = {&CASHREPORTCUMUL-CUMUL}
            tCashReportGL.tcCashReportGLCompanyCode = vcCompanyLC
            tCashReportGL.CashReportGLCurrencyView  = tCashReport.CashReportCurrencyView
            tCashReportGL.Currency_ID               = tCashReport.Currency_ID.