Link to: source code | unit
cost directory
Copyright Turtle Creek Software 1996-2006. All Rights Reserved.
This class manages payroll tax calculations in the Goldenseal accounting software,
payroll software and project management software.
class CCalcPayrollTax : public DB_ArrayOwner<SObjectInfo>
{
public:
enum
{
col_class = 1,
col_id = 2
};
class CCalcPayrollTaxTable_Desc : public CLASS_DESC
{
public:
CCalcPayrollTaxTable_Desc()
: CLASS_DESC(id_CalcPayrollTax, id_DescribedPersistent, CCalcPayrollTax::MakeNew) {}
virtual ~CCalcPayrollTaxTable_Desc() {}
virtual Boolean GetTableColInfo(const TagType tag, const TableIndexT col,
STableColInfo *colInfo);
virtual SInt32 GetNumTableCols(const TagType /*tableTag*/) { return 2; }
};
static CLASS_DESC *sDescriptor;
static DB_PersistentObject *MakeNew() { return TCS_NEW CCalcPayrollTax; }
CCalcPayrollTax();
virtual ~CCalcPayrollTax() {}
virtual DBid GetDBClassID(void) const { return id_CalcPayrollTax; }
virtual void CopyFrom(DB_PersistentObject *source, const UInt8 copyFlags = 0);
virtual NeoSize GetFileLength(const CNeoFormat *aFormat) const;
virtual Boolean GetMemberValue(const NeoTag aTag, const NeoTag aType,
void *aValue) const;
virtual Boolean SetMemberValue(const NeoTag aTag, const NeoTag aType,
const void *aValue);
virtual void ReadObject(CNeoStream *aStream, const NeoTag aTag);
virtual void WriteObject(CNeoStream *aStream, const NeoTag aTag);
virtual Boolean GetEntryFromRow(const CTCS_Table &aTable,
const TableIndexT row,
SObjectInfo *outInfo);
virtual Boolean FillRowFromEntry(CTCS_Table *aTable, const TableIndexT row,
const SObjectInfo &inInfo);
virtual CTextString ExportColumnCString(const TableIndexT col,
const SObjectInfo &outInfo);
virtual Boolean ImportColumnCString(const TableIndexT col,
const CTextString &inString, SObjectInfo *inInfo);
virtual void AddTaxItem(const UInt8 inClassID, const DBid inID);
virtual void RemoveTaxItem(const UInt8 inClassID, const DBid inID);
virtual TObjectInfoArray GetTaxArray() const { return mEntries; }
virtual CDate GetStartDate() const;
virtual CDate GetEndDate() const;
virtual UInt8 GetCalcMethod() const { return mCalcMethod; }
virtual Boolean FillMemberTable(CTCS_Table *aTable);
virtual void FillDataReport(CTCS_Table *table, CNeoStream *stream) const;
virtual void SetEndSafetyTag() { mEndSafetyTag = tag_endsafetytag; }
protected:
// mEntries handles a list of tax items which are included in this field
UInt8 mCalcMethod, // TCS 1/5/01
mTimePeriod;
CDate mStartDate,
mEndDate;
DBid mExpansion;
// calculated members
TagType mEndSafetyTag; // TCS 9/8/02
enum
{
cCopyFileLength = 2*sizeof(UInt8) +
2*sizeof(CDate) +
sizeof(DBid),
cFileLength = cCopyFileLength +
sizeof(TagType)
};
}; |