Link to: header | lists
directory |
property management info
Copyright Turtle Creek Software 1996-2006. All Rights Reserved.
Comments
CPropertyTerms
payment terms, for those who manage properties for another. This class
applies mainly to property managers who do property management for
properties that they don't own.
This class manages property rental payment terms for the Goldenseal accounting software,
property management software and rental
property management software.
SUPERCLASS = DB_DescribedPersistent
Constructor
/*********************************************************************************
default constructor
********************************************************************************/
CPropertyTerms::CPropertyTerms()
{
mDollarFee = mPercentFee = 0;
mEndSafetyTag = tag_endsafetytag;
}
Source Code
/*********************************************************************************
CopyFrom TCS 12/10/03
copy the data members from the passed object. This is used to implement
duplicate. source should be an object of the same class as this object
*********************************************************************************/
void CPropertyTerms::CopyFrom(DB_PersistentObject *source, const UInt8 copyFlags)
{
DB_DescribedPersistent::CopyFrom(source, copyFlags);
CPropertyTerms *src = TCS_SAFE_CAST(source, CPropertyTerms);
TCS_FailNILMsg(src, TCS_GetErrString(errID_BadRecord));
TCS_BlockMove(&src->mDollarFee, &mDollarFee, cCopyFileLength);
}
/*********************************************************************************
GetFileLength TCS 12/10/03
return the file length used by this object
*********************************************************************************/
NeoSize CPropertyTerms::GetFileLength(const CNeoFormat *aFormat) const
{
return THE_SUPERCLASS::GetFileLength(aFormat) +
cFileLength;
}
/*********************************************************************************
GetMemberValue TCS 12/10/03
return the value of the member with the given tag
*********************************************************************************/
Boolean CPropertyTerms::GetMemberValue(const NeoTag aTag, const NeoTag aType,
void *aValue) const
{
switch (aTag)
{
case tag_dollarfee:
return ConvertMember(&mDollarFee, type_money, aValue, aType);
break;
case tag_percentfee:
return ConvertMember(&mPercentFee, type_money, aValue, aType);
break;
case tag_dollarfeetype:
return ConvertEnumMember(mDollarFeeType, MENU_DollarFeeType, aValue, aType);
break;
case tag_percentfeetype:
return ConvertEnumMember(mPercentFeeType, MENU_PercentFeeType, aValue, aType);
break;
default:
return THE_SUPERCLASS::GetMemberValue(aTag, aType, aValue);
break;
}
}
/*********************************************************************************
SetMemberValue TCS 12/10/03
set the value of the member with the given tag
*********************************************************************************/
Boolean CPropertyTerms::SetMemberValue(const NeoTag aTag, const NeoTag aType,
const void *aValue)
{
switch (aTag)
{
case tag_dollarfee:
return ConvertMember(aValue, aType, &mDollarFee, type_money);
break;
case tag_percentfee:
return ConvertMember(aValue, aType, &mPercentFee, type_money);
break;
case tag_dollarfeetype:
return ConvertMember(aValue, aType, &mDollarFeeType, type_enum);
break;
case tag_percentfeetype:
return ConvertMember(aValue, aType, &mPercentFeeType, type_enum);
break;
default:
return THE_SUPERCLASS::SetMemberValue(aTag, aType, aValue);
break;
}
}
/*********************************************************************************
ReadObject TCS 12/10/03
read the persistent object's data in from a stream
*********************************************************************************/
void CPropertyTerms::ReadObject(CNeoStream *aStream, const TagType aTag)
{
TCS_FailNILMsg(aStream, TCS_GetErrString(errID_BadStream));
CNeoDebugImport checker(aStream, this, cCheckTooSmall);
THE_SUPERCLASS::ReadObject(aStream, aTag);
if (!IsIOValid())
return;
mDollarFee.ReadFromStream(aStream);
mPercentFee.ReadFromStream(aStream);
mDollarFeeType = aStream->ReadChar();
mPercentFeeType = aStream->ReadChar();
mEndSafetyTag = aStream->ReadEndSafetyTag(this);
if (!IsValidEndTag(mEndSafetyTag))
ReportDamagedObject(GetDBClassID(), GetDBID());
}
/*********************************************************************************
WriteObject TCS 12/10/03
write the persistent object's data to a stream
*********************************************************************************/
void CPropertyTerms::WriteObject(CNeoStream *aStream, const TagType aTag)
{
TCS_FailNILMsg(aStream, TCS_GetErrString(errID_BadStream));
// make sure we have valid data to write
if (!IsValidEndTag(mEndSafetyTag))
{
ReportDamagedObject(GetDBClassID(), GetDBID());
mEndSafetyTag = tag_endsafetytag;
}
CNeoDebugExport checker(aStream, this, cCheckTooSmall);
THE_SUPERCLASS::WriteObject(aStream, aTag);
mDollarFee.WriteToStream(aStream);
mPercentFee.WriteToStream(aStream);
aStream->WriteChar(mDollarFeeType);
aStream->WriteChar(mPercentFeeType);
aStream->WriteEndSafetyTag(mEndSafetyTag, this);
}
#if CAN_USE_MARK
#pragma mark -
#endif
/*********************************************************************************
GetTableColInfo
return information about table columns
*********************************************************************************/
Boolean CPropertyTerms::CPropertyPaymentTerm_Desc::GetTableColInfo(const TagType tag,
const TableIndexT col,
STableColInfo *colInfo)
{
if (tag == tag_loandatetable)
{
switch (col)
{
case col_date:
colInfo->colType = coltype_caption;
colInfo->fieldType = fieldtype_date;
colInfo->colData = 0;
TCS_BufferFromText(colInfo->colName, CDate::ThisYearString() +
TCS_GetStockString(stockID_BillingDates), cTableColNameLength);
return true;
break;
default:
return false;
break;
}
}
else
return false;
}
#if CAN_USE_MARK
#pragma mark -
#endif
/*********************************************************************************
FillDataReport TCS 12/10/03
fill in a diagnostic table that shows data field values.
*********************************************************************************/
void CPropertyTerms::FillDataReport(CTCS_Table *table, CNeoStream *stream) const
{
TCS_FailNILMsg(table, TCS_GetErrString(errID_BadTable));
TCS_FailNILMsg(stream, TCS_GetErrString(errID_BadStream));
THE_SUPERCLASS::FillDataReport(table, stream);
FillFieldTagRow(table, stream, tag_dollarfee, cMoneySize, mDollarFee.GetCurrencyString());
FillFieldTagRow(table, stream, tag_percentfee, cMoneySize, mPercentFee.GetPercentString());
FillEndSafetyTag(table, stream, mEndSafetyTag);
}
|