Okay, so according to the log file this is what is happening:
Code: Select all
DEBUG [583]: <b>UserDeductionFactory::getDeductionAmount()</b>: Percent: 30.4 Wage Base: 250000 Exempt Amount: 9750<br>
DEBUG [1001]: <b>PayStubFactory::getSumByEntriesArrayAndTypeIDAndPayStubAccountID()</b>: PS Entries: current Type ID: PS Account ID: Array<br>
DEBUG [1468]: <b>CompanyDeductionFactory::getPayStubEntryAmountSum()</b>: Type Amount: 0 Regular Amount: 2000.0000000000 Total: 2000.0000000000<br>
DEBUG [1001]: <b>PayStubFactory::getSumByEntriesArrayAndTypeIDAndPayStubAccountID()</b>: PS Entries: current Type ID: PS Account ID: Array<br>
DEBUG [1468]: <b>CompanyDeductionFactory::getPayStubEntryAmountSum()</b>: Type Amount: 0 Regular Amount: 1055.1800000000 Total: 1055.1800000000<br>
DEBUG [1548]: <b>CompanyDeductionFactory::getCalculationPayStubAmount()</b>: Include Amount: 2000.0000000000 Exclude Amount: 1055.1800000000<br>
DEBUG [1556]: <b>CompanyDeductionFactory::getCalculationPayStubAmount()</b>: Amount: 944.8200000000<br>
DEBUG [1001]: <b>PayStubFactory::getSumByEntriesArrayAndTypeIDAndPayStubAccountID()</b>: PS Entries: current Type ID: PS Account ID: Array<br>
DEBUG [1468]: <b>CompanyDeductionFactory::getPayStubEntryAmountSum()</b>: Type Amount: 0 Regular Amount: 2000.0000000000 Total: 2000.0000000000<br>
DEBUG [1001]: <b>PayStubFactory::getSumByEntriesArrayAndTypeIDAndPayStubAccountID()</b>: PS Entries: current Type ID: PS Account ID: Array<br>
DEBUG [1468]: <b>CompanyDeductionFactory::getPayStubEntryAmountSum()</b>: Type Amount: 0 Regular Amount: 1055.1800000000 Total: 1055.1800000000<br>
DEBUG [1548]: <b>CompanyDeductionFactory::getCalculationPayStubAmount()</b>: Include Amount: 2000.0000000000 Exclude Amount: 1055.1800000000<br>
DEBUG [1556]: <b>CompanyDeductionFactory::getCalculationPayStubAmount()</b>: Amount: 944.8200000000<br>
DEBUG [609]: <b>UserDeductionFactory::getDeductionAmount()</b>: Amount: 132.3200000000<br>
DEBUG [987]: <b>UserDeductionFactory::getDeductionAmount()</b>: Deduction Amount: 40.2252800000<br>
What all that means is this:
- Wage bracket: Percent: 30.4 Wage Base: 250000 Exempt Amount: 9750
- Included Pay Stub Account Total: 2000
- Excluded Pay Stub Account Total: 1055.18
- Gross Taxable Wage for one pay period: (2000-1055.18) = 944.82
<-- Same as your example
- Exempt Amount based on tax bracket (9750/12 pay periods) = 812.50/pay period
- Pay Period Net Taxable Wage: (944.82/PP Gross Taxable Wage - Exempt 812.50/pp) = 132.32
- Resulting Tax for just this bracket: (132.32 * 30.4%) = 40.23
So TimeTrex is doing exactly what you've told it to do, however the error I see is in your own calculations you neglected to account for the 9750 exempt amount for this bracket.