Accounting Software
Small Business Software Estimating Software
Time Tracking SoftwareTime Management SoftwareTime Billing SoftwareProject Management SoftwareBookkeeping SoftwareContact Management SoftwareBusiness Management Software

Sales Branches (Header)

Link to: source code | lists directory

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

This class manages sales branches for the Goldenseal accounting software,
retail sales software, project management software and business management software.

class CSalesBranch : public DB_DescribedPersistent
{
public:

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

CSalesBranch();
virtual ~CSalesBranch() {}

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

static Boolean FillDepositsFromArray(const TObjectIDArray &array, SDepositInfo &depositInfo);
static void InitializeDepositInfo(SDepositInfo &depositInfo);
static void InitializeDepositItemInfo(SDepositItem &itemInfo, const UInt8 transClass);

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 void PostNewRecord(const UInt8 creationType);
virtual void PostDeletion(const Boolean postAudit);
virtual void PostRecordChanging(const Boolean accountChanging,
const Boolean jobChanging);
virtual void PostRecordChanged(const CMoney &oldAmount,
const Boolean accountChanged,
const Boolean jobChanged);

virtual Boolean FillDepositInfo(SDepositInfo &depositInfo);

virtual Boolean AddToUndepositedSaleArray(const DBid inID, const Boolean removeIt = false)
{ return AddToObjectIDArray(mUndepositedSaleArray, inID, removeIt); }

virtual DBid GetCategorySystem() const { return mCatSystem; }
virtual DBid GetTaxID() const { return mTaxRate; }
virtual DBid GetTaxClass() const { return id_JobSalesTax; } // TCS 2/11/01
virtual DBid GetInventoryAccount() const { return mInventoryAccount; }
virtual UInt8 GetUtilityAccountType(const TagType /*tag*/) const { return virtual_undepositedfunds; }

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

virtual void SetEndSafetyTag() { mEndSafetyTag = tag_endsafetytag; }

protected:
// outside members
TObjectIDArray mUndepositedSaleArray;

DBid mCatSystem,
mCashAccount,
mTaxRate,
mInventoryAccount,
mOverheadAccount,
mCommission,
mUndepositedFundsAccount; // currently unused

// calculated members
DBid mExpansionID; // TCS 9/16/02
CMoney mExpansionMoney;

TagType mEndSafetyTag; // TCS 9/8/02

enum
{
cCopyFileLength = 7*sizeof(DBid),
cFileLength = cCopyFileLength +
sizeof(DBid) +
sizeof(CMoney) +
sizeof(TagType)
};
};