Accounting Software
Small Business Software Estimating Software
Inventory SoftwareInventory Tracking SoftwareInventory Control SoftwareInventory Management SoftwareConstruction Management SoftwareProject Management SoftwareBusiness Management Software

Project Allowances (Header)

Link to: source code | transactions directory

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

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

class CAllowance : public CChangeOrder
{
public:

static CLASS_DESC *sDescriptor;
static DB_PersistentObject *MakeNew() { return TCS_NEW CAllowance; }

CAllowance();
virtual ~CAllowance() {}

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

virtual NeoSize GetFileLength(const CNeoFormat *aFormat) const;

virtual DBid GetDBClassID(void) const { return id_Allowance; }

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 Boolean IsValidBreakdown(const UInt8 breakdownType);

virtual void PostRecordActivated(const UInt8 creationType);
virtual void PostRecordCancelled(const UInt8 cancelType);
virtual void PostRecordChanging(const Boolean accountChanging,
const Boolean jobChanging);
virtual void PostRecordChanged(const CMoney &oldAmount,
const Boolean accountChanged,
const Boolean jobChanged);

virtual void PostAllowance(const Boolean removeItem = false);

virtual Boolean NeedsMainAccountValue() const { return false; }

virtual DBid SetAwardedStatus(const UInt8 jobClass, const DBid jobID,
const Boolean removeItem = false, const DBid estimateID = 0);
virtual void SetCompletedStatus(const Boolean removeItem);

virtual void HandleEstimateUse(const DBid estimateID, const CMoney quantity, const Boolean removeIt = false);
virtual void HandleExpenseTrans(const CMoney &amount, const CMoney &taxAmount,
const UInt8 classID, const DBid costID,
const Boolean removeIt = false);

virtual Boolean UsesJobCosts() const { return true; }
virtual Boolean IsCostPerUnit() { return mCostPerUnit; }

virtual Boolean CanBeTandMBilled() const;

virtual CMoney CalculateAmountDue(const CMoney materialAmount, const CMoney otherCostAmount);

virtual Boolean IsAllowance() const { return true; }

virtual CMoney GetQuantity() const { return mQuantity; }
virtual void SetQuantity(const CMoney inValue) { mQuantity = inValue; }

virtual void UpdateEstimate(const Boolean removeItem = false);

virtual CMoney FetchComponentCosts(SAssemblyUpdateInfo &info, const CMoney &inQuantity);

virtual void WriteContractSpecs(CTextOutputStream &stream, const DBid subcontractType,
const Boolean includeAllowances, const Boolean includeBids,
const Boolean includeCatBreakdowns, const Boolean includeUnlisted) const;

virtual void FillDataReport(CTCS_Table *table, CNeoStream *stream) const;

virtual void SetEndSafetyTag() { mEndSafetyTag = tag_endsafetytag; }

protected:
// removed most members TCS 9/10/00 (and changed inheritance)

CMoney mQuantity; // actually calculated, but here for easy blockmove

// never insert members before this bitfield!!!
UInt8 mCostPerUnit:1,
allowanceFiller:7;
UInt8 mAllowancePadding;

// CALCULATED DATA
DBid mEstimate;

// if we ever add members here, also update Change Orders to have a picture field

TagType mEndSafetyTag; // TCS 9/8/02


enum
{
cCopyFileLength = sizeof(CMoney) +
2*sizeof(UInt8),

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

};