Link to: header | tables
directory
Copyright Turtle Creek Software 1996-2006. All Rights Reserved.
Comments
CTaxPaymentBreakdownTable
This class manages payroll tax payment tables for the Goldenseal accounting software,
payroll software and small business
management software.
It's a table that shows payroll tax or sales tax payments in an Other Costs transaction.
Each line is an individual item of tax due (the deduction for one pay period for one
employee for payroll taxes, or one sale for sales taxes due).
SUPERCLASS = CTransactionBreakdownTable Source Code
/*********************************************************************************
RecalcBreakdownRow TCS 2/12/01
recalculate the given row
*********************************************************************************/
CMoney CTaxPaymentBreakdownTable::RecalcBreakdownRow(const TableIndexT row, const TagType /*changedCol*/)
{
CMoney payAmount(0,0);
// calculate the total due amount
TableIndexT col = GetMemberCol(tag_pay);
if (col)
{
if (IsChecked(row, col))
{
payAmount = GetMemberColMoney(row, tag_calcdeduction);
payAmount += GetMemberColMoney(row, tag_adjustment);
}
SetMemberColMoney(row, tag_amount, payAmount);
}
return payAmount;
}
/*********************************************************************************
GetColType TCS 2/12/01
return the column type for the given column
*********************************************************************************/
SInt32 CTaxPaymentBreakdownTable::GetColType(const SMemberInfo &memberInfo) const
{
switch (memberInfo.tag)
{
case tag_pay:
return coltype_checkmark;
break;
case tag_transactid: // just the tax item number
case tag_menuname: // tax item name
case tag_employee: // employee or customer name
return coltype_caption;
break;
case tag_secondaccountclass:
case tag_taxtype: // TCS 4/5/01
return coltype_menulookup;
break;
case tag_secondaccount:
return coltype_lookup;
break;
case tag_adjustment:
return coltype_edit;
break;
case tag_baseamount:
case tag_calcdeduction:
case tag_taxratepercent:
case tag_amount:
case tag_date:
return coltype_caption;
break;
default:
return THE_SUPERCLASS::GetColType(memberInfo);
break;
}
}
/*********************************************************************************
GetDetailTransactionClass TCS 8/8/01 rev 10/22/01
get the transaction object class for a row.
*********************************************************************************/
UInt8 CTaxPaymentBreakdownTable::GetDetailTransactionClass(const TableIndexT row) const
{
const DBClass sourceClass = GetMemberColValue(row, tag_taxtype);
switch (sourceClass)
{
case id_BillingRecord: // TCS 10/22/01
case id_Sale:
case id_RentalTransaction:
case id_MaterialPurchase: // TCS 10/7/02
case id_SubcontractorLog:
case id_OtherCost:
return sourceClass;
break;
default:
return id_PayrollRecord;
break;
}
}
/*********************************************************************************
GetDetailTransactionID TCS 8/8/01
get the transaction object id for a row. For some classes we need to
fetch it indirectly
*********************************************************************************/
DBid CTaxPaymentBreakdownTable::GetDetailTransactionID(const TableIndexT row) const
{
const DBid sourceID = GetMemberColValue(row, tag_transactid);
const DBClass sourceClass = GetMemberColValue(row, tag_taxtype);
switch (sourceClass)
{
case id_BillingRecord: // TCS 10/22/01
case id_Sale:
case id_RentalTransaction:
case id_MaterialPurchase: // TCS 10/7/02
case id_SubcontractorLog:
case id_OtherCost:
return sourceID;
case id_EmpTaxBreakdownEntry:
case id_CatTaxBreakdownEntry:
case id_DeductBreakdownEntry:
case id_BennyBreakdownEntry:
case id_VacBreakdownEntry:
{
DB_PersistentObject *source = gDBFile->GetOneObject(sourceClass, sourceID);
if (source)
{
DB_ObjectWatcher watcher(source);
return source->GetOwnerID();
}
else
return 0;
}
break;
default: // if we get this far, there is no transaction
return 0;
break;
}
}
|