/******************************************************************************** ///Payscript: WTax2009-Y.payscript ///Scribe: sweldista.com ///Title: How to Compute Withholding Tax ///Summary: Computes WTax based on Annual 2009 Withholding Tax Table. ///Environment: Philippines.200901 ///WorkingPeriods: Semi-monthly, Weekly, Monthly ********************************************************************************/ // numeric input var RegularIncome = 0.0; numeric input var SupplementaryIncome = 0.0; // TaxTable follows the period type of the paysheet text output var TaxTable = 'Yearly';//PayPeriod.PrdType; // TaxExemption depends on the TaxCode of the Employee vector var WTaxExemptionBracket = GetWTAXTableExemptionBracket( TaxTable, TaxCode ); numeric output var TaxExemption = WTaxExemptionBracket.AmtExempt; // Compute TaxableRegIncome by deducting TaxExemption from the RegularIncome numeric output var TaxableRegIncome = RegularIncome - TaxExemption { if( TaxableRegIncome < 0 ) TaxableRegIncome = 0; } // TaxOnBracket and WTaxBracket are based on TaxableRegIncome only (without SupplementaryIncome) vector var WTaxBracket = GetWTAXTableTaxBracket( TaxTable, TaxCode, TaxableRegIncome ); numeric output var TaxOnBracket = WTaxBracket.WTAX; // TaxOnExcess is based on TaxableRegIncome and SupplementaryIncome minus the WTaxBracket of the TaxCode numeric output var TaxOnExcess = ( TaxableRegIncome - WTaxBracket[ TaxCode ] + SupplementaryIncome ) * WTaxBracket.PCTOVER; // WTax is the sum of TaxOnBracket and TaxOnExcess numeric output var WTax = Round2( TaxOnBracket + TaxOnExcess );