Link to: header | other data directory
Copyright Turtle Creek Software 1996-2006. All Rights Reserved.
Comments
CReportInfoOwner
a mix-in class for calculators and tables that need to store calculation
parameters for use in reports. This allows us to update two otherwise
very different types of objects.
This class stores report info for the Goldenseal job cost accounting software,
project management software and construction project
estimating software.
Constructor
/*********************************************************************************
constructor from structs
*********************************************************************************/
CReportInfoOwner::CReportInfoOwner()
{
mItemRange = 0;
mMatchClassID = 0;
mGroup = 0;
mAccountClassID = 0;
mDateFieldType = 0;
mDateRange = date_all; // TCS 11/18/02
mCondensed = false;
mStartsCondensed = false;
mOneItemReport = false;
mHideOverhead = false;
mStartDate = mEndDate = CDate::Today();
mMatchValue = 0;
mReportClassID = 0;
mMatchTag = 0;
mBreakdownTag = 0;
}
Source Code
/*********************************************************************************
GetReportData TCS 8/27/99
fetch a bunch of data
*********************************************************************************/
void CReportInfoOwner::GetReportData(UInt8 &inRangeType, UInt8 &inMatchClassID,
CDate &inStartDate, CDate &inEndDate,
DBid &inMatchValue, DBid &inReportClassID,
TagType &inMatchTag, TagType &inBreakdownTag,
UInt8 &inDateFieldType, UInt8 &inGroup,
UInt8 &inAccountClassID, UInt8 &inDateRange) const
{
inRangeType = mItemRange;
inMatchClassID = mMatchClassID;
inStartDate = mStartDate;
inEndDate = mEndDate;
inMatchValue = mMatchValue;
inReportClassID = mReportClassID;
inMatchTag = mMatchTag;
inBreakdownTag = mBreakdownTag;
inDateFieldType = mDateFieldType;
inGroup = mGroup;
inAccountClassID = mAccountClassID;
inDateRange = mDateRange; // TCS 1/4/02
}
/*********************************************************************************
SetReportData TCS 8/27/99
fill in a bunch of data
*********************************************************************************/
void CReportInfoOwner::SetReportData(const UInt8 &inRangeType, const UInt8 &inMatchClassID,
const CDate &inStartDate, const CDate &inEndDate,
const DBid &inMatchValue, const DBid &inReportClassID,
const TagType &inMatchTag, const TagType &inBreakdownTag,
const UInt8 &inDateFieldType, const UInt8 &inGroup,
const UInt8 &inAccountClassID, const UInt8 &inDateRange)
{
mItemRange = inRangeType;
mMatchClassID = inMatchClassID;
mStartDate = inStartDate;
mEndDate = inEndDate;
mMatchValue = inMatchValue;
mReportClassID = inReportClassID;
mMatchTag = inMatchTag;
mBreakdownTag = inBreakdownTag;
mDateFieldType = inDateFieldType;
mGroup = inGroup;
mAccountClassID = inAccountClassID;
mDateRange = inDateRange; // TCS 1/4/02
}
/*********************************************************************************
GetReportInfo TCS 3/28/00 rev 4/18/02
fill in a SReportInfo struct from this info owner
*********************************************************************************/
SReportInfo CReportInfoOwner::GetReportInfo() const
{
SReportInfo info;
info.itemRange = mItemRange;
info.matchClassID = mMatchClassID;
info.group = mGroup;
info.accountClassID = mAccountClassID;
info.startDate = mStartDate;
info.endDate = mEndDate;
info.matchValue = mMatchValue;
info.reportClassID = mReportClassID;
info.matchTag = mMatchTag;
info.breakdownTag = mBreakdownTag;
info.dateFieldType = mDateFieldType;
info.fieldType = 0;
info.tableType = 0;
info.dateRange = mDateRange; // TCS 1/4/02
info.oneItemReport = IsOneItemReport(); // TCS 4/24/02
info.startsCondensed = mStartsCondensed;
info.hideOverhead = mHideOverhead; // TCS 2/19/03
info.dateRange = mDateRange; // TCS 4/24/02
// we calculate the field type TCS bugfix 8/14/02
info.fieldType = DB_ClassDescriptor::GetFieldTypeForTag(info.reportClassID, info.matchTag);
return info;
}
/*********************************************************************************
SetReportInfo TCS 3/28/00 rev 4/18/02
store values here from an info struct
*********************************************************************************/
void CReportInfoOwner::SetReportInfo(const SReportInfo &info)
{
mItemRange = info.itemRange;
mMatchClassID = info.matchClassID;
mStartDate = info.startDate;
mEndDate = info.endDate;
mMatchValue = info.matchValue;
mReportClassID = info.reportClassID;
mMatchTag = info.matchTag;
mBreakdownTag = info.breakdownTag;
mDateFieldType = info.dateFieldType;
mGroup = info.group;
mAccountClassID = info.accountClassID;
mDateRange = info.dateRange; // TCS 1/4/02
mStartsCondensed = info.startsCondensed;
mHideOverhead = info.hideOverhead; // TCS 2/19/03
}
|