Accounting Software
Small Business Software Estimating Software
Contact SoftwareInventory SoftwareInventory Tracking SoftwareInventory Management SoftwareInventory Control SoftwareCustomer Management SoftwareBusiness Management Software

Templates (Header)

Link to: source code | prefs directory

Copyright Turtle Creek Software 1996-2006. All Rights Reserved.

This class manages record templates for the Goldenseal accounting software,
small business management software, construction project management software and
construction accounting software.

class CTemplateTransaction : public DB_DescribedPersistent
{
public:

static CLASS_DESC *sDescriptor;
static DB_PersistentObject *MakeNew() { return TCS_NEW CTemplateTransaction; }
static DB_PersistentObject *CreateObjectFromTemplate(const DBid templateID,
const SInt32 flags = 0);

CTemplateTransaction();
virtual ~CTemplateTransaction() {}

virtual NeoID GetDBClassID(void) const { return id_TemplateTransaction; }

virtual NeoSize GetFileLength(const CNeoFormat *aFormat) const
{
return DB_DescribedPersistent::GetFileLength (aFormat) +
cFileLength;
}

virtual void CopyFrom(DB_PersistentObject *source, const UInt8 copyFlags);

virtual Boolean GetMemberValue(const TagType aTag, const TagType aType,
void *aValue) const;
virtual Boolean SetMemberValue(const TagType aTag, const TagType aType,
const void *aValue);

virtual void ReadObject(CNeoStream *aStream, const TagType aTag);
virtual void WriteObject(CNeoStream *aStream, const TagType aTag);

virtual void PostDeletion(const Boolean postAudit);

virtual Boolean GetAutoEnterAmounts() const { return mAutoEnterAmounts; }
virtual Boolean GetAutoEnterBreakdowns() const { return mAutoEnterBreakdowns; }
virtual Boolean GetAutoEnterJobCosts() const { return mAutoEnterJobCosts; }

virtual DBid GetTemplateID() const { return mTemplateID; }
virtual void SetTemplateID(const DBid inValue) { mTemplateID = inValue; }
virtual DBClass GetTemplateClass() const { return mTemplateClass; }
virtual void SetTemplateClass(const DBClass inValue) { mTemplateClass = inValue; }

// the template may not be an account, but we use these so it's
// possible to fetch values from a DB_PersistentObject cast TCS 1/20/04
virtual DBClass GetMainAccountClass() const { return mTemplateClass; }
virtual DBid GetMainAccountID() const { return mTemplateID; }
virtual void FillDataReport(CTCS_Table *table, CNeoStream *stream) const;

virtual void SetEndSafetyTag() { mEndSafetyTag = tag_endsafetytag; }

protected:
// copied members
DBid mTemplateID; // the ID of the transaction being copied

UInt8 mTemplateClass; // the class of transaction being copied

// *** NEVER insert members before this bitfield!!!
UInt8 mAutoEnterAmounts:1,
mAutoEnterBreakdowns:1,
mAutoEnterJobCosts:1,
filler:5;

// calculated members
TagType mEndSafetyTag; // TCS 9/8/02
enum
{
cCopyFileLength = sizeof(DBid) +
2*sizeof (UInt8),

cFileLength = cCopyFileLength +
sizeof(TagType)
};
};