TejashreeDesai
21st February 2019, 16:07
Dear All,

Please assist me on how to get previous month from starting date of given fiscal period and year?

Thanks & Regards,
Tejashree
:)

Ajesh
21st February 2019, 17:11
tfgld.dll5005.get.last.date.of.previous.period

function extern boolean tfgld.dll5005.get.last.date.of.previous.period(
domain tcncmp i.fin.company,
domain tfgld.ptyp i.period.type,
domain tcdate i.date.utc,
ref domain tcdate o.last.date.prev.peri)
{
DLLUsage
Expl : This function gets the last date of the previous period based
on the given input date. This is independent of the period
status.
Pre : N.a.
Post : N.a.
Input : i.fin.company - Financial Company
i.period.type - Period Type
i.date.utc - Date (UTC)
Output : o.last.date.prev.peri - Last Date of the Previous Period (UTC)
Return : true -
false -
Moved from tfgld.dll6012.get.last.date.of.previous.period(
EndDLLUsage



Once you get the last date of previous period, you can easily get the month number from utc.to.date function.

TejashreeDesai
22nd February 2019, 06:06
Thanks Ajesh for helping me.

Is there any same function for getting previous starting date of previous period?

Ajesh
22nd February 2019, 09:18
You mean start date of previous period?

Once you get last date of previous period, you can get the previous period and year from (But bfore that you need to convert last.date.utc to last.date.normal)



function extern long tfgld.dll5005.determine.year.period.from.date(
domain tcncmp i.financial.company,
domain tfgld.ptyp i.period.type,
domain tfgld.date i.date,
ref domain tfgld.year o.year,
ref domain tfgld.prod o.period)
{
DllUsage
Expl: This function determines the year and period based on the input
date.
Pre: -
Post: In case Reporting Periods are not used in group company
parameters and i.period.type = tfgld.ptyp.reporting, the I/O
arguments are set to 0 and no(!) DALHOOKERROR is returned.
Input: i.financial.company - Financial Company
i.period.type - Period Type
i.date - Date
Output: o.year - Year
o.period - Period
Return: 0/DALHOOKERROR - DAL buffer filled in case of error.
EndDllUsage




Then once you get last period and year number.you can get start date of that period from



function extern boolean tfgld.dll5005.read.start.date.period(
domain tfgld.ptyp i.period.type,
domain tfgld.year i.year,
domain tfgld.prod i.period.number,
ref domain tfgld.date o.date)
{
DLLUSAGE

This dll will read the start date for a given period type, year and
period number.

Returns true if period type, year and period number is found, else
returns false

i.period.type period type
i.year year
i.period.number period number
o.date start date of period

Moved from tfgld.dll1032.read.start.date.period
ENDDLLUSAGE

TejashreeDesai
25th February 2019, 14:20
Thank You once again for helping.:)