Link to: header | tables
directory
Copyright Turtle Creek Software 1996-2006. All Rights Reserved.
Comments
CCategoryBreakdownTable
This class manages category breakdown tables for the Goldenseal accounting software,
small business management software, construction
project management software and
construction
accounting software.
It and subclasses are tables for displaying category breakdowns. We use these in estimates,
sales,
material purchases and other transactions when the user wants to type in items
without linking to cost items or assemblies.
SUPERCLASS = CCostBreakdownTable
Source Code
/*********************************************************************************
GetColType
return the column type for the given column
*********************************************************************************/
SInt32 CCategoryBreakdownTable::GetColType(const TableIndexT row, const TableIndexT col) const
{
switch (GetColTag(col))
{
case tag_costitem:
if (RowUsesObjectID(row))
return coltype_mixcv;
else
return coltype_mixedit;
break;
case tag_unitsize: // bugfix TCS 11/8/01
return coltype_edit;
break;
case tag_unitcost:
if (mOwnerClass == id_LaborHours || mOwnerClass == id_EquipmentHours)
return coltype_caption; // TCS 9/13/99 rev 1/17/00
else if (RowUsesObjectID(row))
return coltype_caption;
else if (RowUsesPercent(row)) // TCS 11/5/02
return coltype_caption;
else
return coltype_edit;
break;
default:
return THE_SUPERCLASS::GetColType(row, col);
break;
}
}
/*********************************************************************************
GetMenuCVClassID
return the class ID for cv field in the given column
*********************************************************************************/
DBid CCategoryBreakdownTable::GetMenuCVClassID(const TableCellT &inCell) const
{
if (COL(inCell) == GetMemberCol(tag_costarea))
{
switch (GetOwnerClass())
{
case id_Estimate:
return MENU_EstimateCatCostTypes;
break;
case id_Allowance:
case id_ChangeOrder:
return MENU_EstimateCatCostTypes; // rev TCS 7/27/01
break;
case id_Sale:
case id_MaterialPurchase:
case id_Bid:
default:
return MENU_CatBreakdownCostTypes;
break;
}
}
else // the superclass can handle other columns
return THE_SUPERCLASS::GetMenuCVClassID(inCell);
}
/*********************************************************************************
RowUsesObjectID TCS 3/15/99 rev 3/18/99 rev 4/29/02
return whether the given row displays a clairvoyant cost item
*********************************************************************************/
Boolean CCategoryBreakdownTable::RowUsesObjectID(const TableIndexT row) const
{
UInt8 costArea = GetCostArea(row);
if (costArea)
{
return CCostBreakdownEntry::RowUsesObjectID(costArea, true);
}
else
return false; // rev TCS 1/6/00
}
/*********************************************************************************
FillNewRowCells
fill a row with starter values
*********************************************************************************/
void CCategoryBreakdownTable::FillNewRowCells(TableIndexT row)
{
THE_SUPERCLASS::FillNewRowCells(row);
// starter cost type depends on the transaction TCS 3/20/99
switch (GetOwnerClass())
{
case id_EquipmentHours:
SetMemberCV(row, tag_costarea, costtype_equipment);
break;
case id_SubcontractorLog:
case id_Bid:
SetMemberCV(row, tag_costarea, costtype_subcontractor);
break;
case id_LaborHours:
case id_ChangeOrder:
SetMemberCV(row, tag_costarea, costtype_labor);
break;
case id_Allowance:
case id_Estimate:
case id_PurchaseWorkOrder:
case id_MaterialPurchase:
case id_Sale:
default:
SetMemberCV(row, tag_costarea, costtype_material);
break;
}
}
|