Accounting Software
Small Business Software Estimating Software
Construction Estimating SoftwareBookkeeping SoftwareInventory SoftwareInventory Control SoftwareInventory Tracking SoftwareInventory Management SoftwareBusiness Management Software

Rounding Methods Viewer (Source Code)

Link to: header | record viewer directory

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

Comments

CRoundingMethodViewer

This class manages price rounding methods for the Goldenseal accounting software,
small business management software, construction project management software and
construction estimating software.

viewer for rounding methods. These do regular rounding like to the nearest
10 cents or dollar. They also 'trim' to retail prices like $9.95.
Setup for sales in Goldenseal accounting software.

SUPERCLASS = DB_RecordViewer

Source Code

/*********************************************************************************

FinishUpdatingFields split TCS 4/17/00

Finish prep work after updating fields from an object, but before displaying them

*********************************************************************************/
void CRoundingMethodViewer::FinishUpdatingFields(const UInt8 creationMethod,
DB_PersistentObject *viewerObject)
{
// the superclass handles basic field updating
THE_SUPERCLASS::FinishUpdatingFields(creationMethod, viewerObject);

// find the rounding table
CToFromTable *table =
TCS_SAFE_CAST(FindPaneByID(tag_roundingtable), CToFromTable);
TCS_FailNILMsg(table, TCS_GetErrString(errID_BadObject));
table->SetToColumn(CRoundingMethod::col_to); // TCS 3/6/00
table->SetFromColumn(CRoundingMethod::col_from);
table->FillToFromValues();
}
/******************************************************************************

ListenToMessage

Responds to a message v1.28, 01-30-96, 12-30-96

*******************************************************************************/
void CRoundingMethodViewer::ListenToMessage(MessageT inMessage, void *ioParam)
{
switch (inMessage)
{
case msg_TableEditCellChanged:
case msg_TableCVCellChanged:
{ // find the rounding table
CToFromTable *table =
TCS_SAFE_CAST(FindPaneByID(tag_roundingtable), CToFromTable);
TCS_FailNILMsg(table, TCS_GetErrString(errID_BadObject));
// was a to value changed?
table->ValidateToFromValues();
}
break;

case msg_TableNewRow :
{ // find the rounding table
CToFromTable *table =
TCS_SAFE_CAST(FindPaneByID(tag_roundingtable), CToFromTable);
TCS_FailNILMsg(table, TCS_GetErrString(errID_BadObject));
// fill in some values
table->FillToFromValues();
}
break;
}
// Always call inherited method
THE_SUPERCLASS::ListenToMessage(inMessage, ioParam);
}