28:
29:
30: PRIVATE PROCEDURES
31: WrtHrTrc
32: Wrapper procedure for py_za_tx_utl_01032013.WriteHrTrace
33: NetTxbIncCalc
34: Procedure to calculate a Net Taxable Income figure used
35: to properly calculate the Skills Development Levy
36: LteCalc
140: END get_def_bal_id;
141:
142: -------------------------------------------------------------------------------
143: -- WrtHrTrc
144: -- Wrapper for py_za_tx_utl_01032013.WriteHrTrace
145: -------------------------------------------------------------------------------
146: PROCEDURE WrtHrTrc(
147: p_Buf IN VARCHAR2
148: )
149: AS
150:
151: BEGIN
152:
153: py_za_tx_utl_01032013.WriteHrTrace(p_Buf);
154: END WrtHrTrc;
155:
156:
157: -------------------------------------------------------------------------------
1149: trc_SitFactor := 1;
1150: trc_LateSitePaye := 0;
1151:
1152: -- Rebates
1153: py_za_tx_utl_01032013.SetRebates;
1154: hr_utility.set_location('py_za_tx_01032013.LteCalc',2);
1155:
1156: -- Total Periodic Income (i.e Normal Income + Fringe Benefits + Travel Allowance + Public Office Allowance)
1157: bal_TOT_TXB_NI_PTD := bal_TOT_TXB_NI_PTD +
1172: hr_utility.set_location('py_za_tx_01032013.LteCalc',3);
1173: -- Normal Earnings
1174: trc_NorErn := trc_NorIncYtd;
1175: -- Tax Liability
1176: trc_TotLibNI := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_NorErn);
1177: trc_LibFyNI := trc_TotLibNI - 0;
1178: trc_TotLibNI := greatest(trc_TotLibNI,0);
1179: trc_LibFpNI := trc_LibFyNI - bal_TX_ON_NI_YTD;
1180: ELSE
1193: hr_utility.set_location('py_za_tx_01032013.LteCalc',9);
1194: -- Annual Bonus Earnings
1195: trc_AnnBonErn := trc_AnnBonYtd + trc_NorErn;
1196: -- Tax Liability
1197: trc_TotLibAB := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_AnnBonErn);
1198: trc_LibFyAB := trc_TotLibAB - least(trc_TotLibAB,trc_TotLibNI);
1199: trc_TotLibAB := greatest(trc_TotLibAB,trc_TotLibNI);
1200: -- Check Bonus Provision
1201: trc_LibFpAB := trc_LibFyAB - bal_TX_ON_AB_YTD;
1214: hr_utility.set_location('py_za_tx_01032013.LteCalc',11);
1215: -- Annual Payments Earnings
1216: trc_AnnPymErn := trc_AnnPymYtd + trc_AnnBonErn;
1217: -- Tax Liability
1218: trc_TotLibAP := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_AnnPymErn);
1219: trc_LibFyAP := trc_TotLibAP - least(trc_TotLibAP,trc_TotLibAB);
1220: trc_TotLibAP := greatest(trc_TotLibAP,trc_TotLibAB);
1221: trc_LibFpAP := trc_LibFyAP - bal_TX_ON_AP_YTD;
1222: ElSE
1237: hr_utility.set_location('py_za_tx_01032013.LteCalc',52);
1238: l_Sl := FALSE;
1239: END IF;
1240:
1241: py_za_tx_utl_01032013.ValidateTaxOns(p_Rf => l_Sl);
1242: hr_utility.set_location('py_za_tx_01032013.LteCalc',53);
1243:
1244: -- Set IT3A Indicator
1245: IF trc_AnnPymErn >= trc_Threshold THEN
1335: -- Threshold Check
1336: IF trc_TxbBseInc >= trc_Threshold THEN
1337: hr_utility.set_location('py_za_tx_01032013.SeaCalc',6);
1338: -- Tax Liability
1339: trc_TotLibBse := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbBseInc);
1340: ELSE
1341: hr_utility.set_location('py_za_tx_01032013.SeaCalc',7);
1342: trc_TotLibBse := 0;
1343: END IF;
1348: -- Threshold Check
1349: IF trc_TxbAnnPymInc >= trc_Threshold THEN
1350: hr_utility.set_location('py_za_tx_01032013.SeaCalc',8);
1351: -- Tax Liability
1352: trc_TotLibAP := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbAnnPymInc);
1353: trc_LibFpAP := trc_TotLibAP - least(trc_TotLibAP,trc_TotLibBse);
1354: ElSE
1355: hr_utility.set_location('py_za_tx_01032013.SeaCalc',9);
1356: trc_LibFpAP := 0;
1362: -- Site Factor
1363: trc_SitFactor := glb_ZA_WRK_DYS_PR_YR / dbi_SEA_WRK_DYS_WRK;
1364:
1365: -- Rebates
1366: py_za_tx_utl_01032013.SetRebates;
1367:
1368: -- Abatements
1369: py_za_tx_utl_01032013.Abatements;
1370: hr_utility.set_location('py_za_tx_01032013.SeaCalc',11);
1365: -- Rebates
1366: py_za_tx_utl_01032013.SetRebates;
1367:
1368: -- Abatements
1369: py_za_tx_utl_01032013.Abatements;
1370: hr_utility.set_location('py_za_tx_01032013.SeaCalc',11);
1371:
1372: -- Total Periodic Income (i.e Normal Income + Fringe Benefits )
1373: bal_TOT_TXB_NI_RUN := bal_TOT_TXB_NI_RUN +
1383: --TYS2010
1384: --Suffixed the variable with WoDon to denote that donation amount is not deducted.
1385: -- Taxable Normal Income
1386: trc_TxbNorIncWoDon := trc_NorErn - trc_PerTotAbm ;
1387: trc_TxbNorInc :=trc_TxbNorIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbNorIncWoDon,trc_PerDonAmt);
1388:
1389: -- Threshold Check
1390: IF trc_TxbNorInc >= trc_Threshold THEN
1391: hr_utility.set_location('py_za_tx_01032013.SeaCalc',13);
1389: -- Threshold Check
1390: IF trc_TxbNorInc >= trc_Threshold THEN
1391: hr_utility.set_location('py_za_tx_01032013.SeaCalc',13);
1392: -- Tax Liability
1393: trc_TotLibNI := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbNorInc);
1394: trc_LibFyNI := trc_TotLibNI - 0;
1395: trc_TotLibNI := greatest(trc_TotLibNI,0);
1396: trc_LibFpNI := trc_LibFyNI / trc_SitFactor;
1397: ELSE
1416: --TYS2010
1417: --Suffixed the variable with WoDon to denote that donation amount is not deducted.
1418: -- Taxable Annual Payments Income
1419: trc_TxbAnnPymIncWoDon := trc_AnnPymErn - trc_AnnTotAbm;
1420: trc_TxbAnnPymInc :=trc_TxbAnnPymIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbAnnPymIncWoDon,trc_AnnDonAmt);
1421:
1422: -- Threshold Check
1423: IF trc_TxbAnnPymInc >= trc_Threshold THEN
1424: hr_utility.set_location('py_za_tx_01032013.SeaCalc',21);
1422: -- Threshold Check
1423: IF trc_TxbAnnPymInc >= trc_Threshold THEN
1424: hr_utility.set_location('py_za_tx_01032013.SeaCalc',21);
1425: -- Tax Liability
1426: trc_TotLibAP := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbAnnPymInc);
1427: trc_LibFyAP := trc_TotLibAP - least(trc_TotLibAP,trc_TotLibNI);
1428: trc_TotLibAP := greatest(trc_TotLibAP,trc_TotLibNI);
1429: trc_LibFpAP := trc_LibFyAP;
1430: ELSE
1438: trc_TotLibAP := trc_TotLibNI;
1439: END IF;
1440:
1441: -- Net Pay Validation
1442: py_za_tx_utl_01032013.ValidateTaxOns;
1443: hr_utility.set_location('py_za_tx_01032013.SeaCalc',24);
1444:
1445: -- Set IT3A Indicator
1446: IF trc_TxbAnnPymInc + trc_PblOffErn >= trc_Threshold THEN
1498:
1499: bal_TOT_TXB_PO_YTD := bal_TOT_TXB_PO_YTD * glb_ZA_PBL_TX_PRC / 100;
1500:
1501: -- Site Factor
1502: trc_SitFactor := dbi_ZA_DYS_IN_YR / py_za_tx_utl_01032013.DaysWorked;
1503:
1504: -- Rebates
1505: py_za_tx_utl_01032013.SetRebates;
1506: hr_utility.set_location('py_za_tx_01032013.SitCalc',2);
1501: -- Site Factor
1502: trc_SitFactor := dbi_ZA_DYS_IN_YR / py_za_tx_utl_01032013.DaysWorked;
1503:
1504: -- Rebates
1505: py_za_tx_utl_01032013.SetRebates;
1506: hr_utility.set_location('py_za_tx_01032013.SitCalc',2);
1507:
1508: -- Abatements
1509: py_za_tx_utl_01032013.Abatements;
1505: py_za_tx_utl_01032013.SetRebates;
1506: hr_utility.set_location('py_za_tx_01032013.SitCalc',2);
1507:
1508: -- Abatements
1509: py_za_tx_utl_01032013.Abatements;
1510: hr_utility.set_location('py_za_tx_01032013.SitCalc',3);
1511:
1512: -- Total Periodic Income (i.e Normal Income + Fringe Benefits + Travel Allowance + Public Office Allowance)
1513: bal_TOT_TXB_NI_YTD := bal_TOT_TXB_NI_YTD +
1525: -- Threshold Check
1526: IF trc_TxbDmdRmn >= trc_Threshold THEN
1527: hr_utility.set_location('py_za_tx_01032013.SitCalc',7);
1528: -- Tax Liability
1529: trc_TotLibDR := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbDmdRmn);
1530: trc_LibFyDR := (trc_TotLibDR - 0) / trc_SitFactor;
1531: trc_TotLibDR := greatest(trc_TotLibDR,0);
1532: trc_LibFpDR := trc_LibFyDR - bal_TX_ON_DR_YTD;
1533: ELSE
1558: -- Taxable Normal Income
1559: --TYS2010
1560: --Suffixed the variable with WoDon to denote that donation amount is not deducted.
1561: trc_TxbNorIncWoDon := trc_NorErn - trc_PerTotAbm;
1562: trc_TxbNorInc :=trc_TxbNorIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbNorIncWoDon,trc_PerDonAmt);
1563:
1564: -- Threshold Check
1565: IF trc_TxbNorInc >= trc_Threshold THEN
1566: hr_utility.set_location('py_za_tx_01032013.SitCalc',12);
1564: -- Threshold Check
1565: IF trc_TxbNorInc >= trc_Threshold THEN
1566: hr_utility.set_location('py_za_tx_01032013.SitCalc',12);
1567: -- Tax Liability
1568: trc_TotLibNI := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbNorInc);
1569: trc_LibFyNI := (trc_TotLibNI - least(trc_TotLibNI,trc_TotLibDR)) / trc_SitFactor;
1570: trc_TotLibNI := greatest(trc_TotLibNI,trc_TotLibDR);
1571: trc_LibFpNI := trc_LibFyNI - bal_TX_ON_NI_YTD;
1572: ELSE
1597: -- Taxable Bonus Provision Income
1598: --TYS2010
1599: --Suffixed the variable with WoDon to denote that donation amount is not deducted.
1600: trc_TxbBonProIncWoDon := trc_BonProErn - trc_PerTotAbm;
1601: trc_TxbBonProInc :=trc_TxbBonProIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbBonProIncWoDon,trc_PerDonAmt);
1602:
1603: -- Threshold Check
1604: IF trc_TxbBonProInc >= trc_Threshold THEN
1605: hr_utility.set_location('py_za_tx_01032013.SitCalc',24);
1603: -- Threshold Check
1604: IF trc_TxbBonProInc >= trc_Threshold THEN
1605: hr_utility.set_location('py_za_tx_01032013.SitCalc',24);
1606: -- Tax Liability
1607: trc_TotLibBP := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbBonProInc);
1608: trc_LibFyBP := (trc_TotLibBP - least(trc_TotLibBP,trc_TotLibNI)) / trc_SitFactor;
1609: trc_TotLibBP := greatest(trc_TotLibBP,trc_TotLibNI);
1610: trc_LibFpBP := trc_LibFyBP - bal_TX_ON_BP_YTD;
1611: ELSE
1635: -- Taxable Annual Bonus Income
1636: --TYS2010
1637: --Suffixed the variable with WoDon to denote that donation amount is not deducted.
1638: trc_TxbAnnBonIncWoDon := trc_AnnBonErn - trc_AnnTotAbm;
1639: trc_TxbAnnBonInc :=trc_TxbAnnBonIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbAnnBonIncWoDon,trc_AnnDonAmt);
1640:
1641: -- Threshold Check
1642: IF trc_TxbAnnBonInc >= trc_Threshold THEN
1643: hr_utility.set_location('py_za_tx_01032013.SitCalc',28);
1641: -- Threshold Check
1642: IF trc_TxbAnnBonInc >= trc_Threshold THEN
1643: hr_utility.set_location('py_za_tx_01032013.SitCalc',28);
1644: -- Tax Liability
1645: trc_TotLibAB := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbAnnBonInc);
1646: trc_LibFyAB := trc_TotLibAB - least(trc_TotLibAB,trc_TotLibNI);
1647: trc_TotLibAB := greatest(trc_TotLibAB,trc_TotLibNI);
1648: hr_utility.set_location('py_za_tx_01032013.SitCalc',29);
1649: -- Check Bonus Provision
1649: -- Check Bonus Provision
1650: IF trc_BonProYtd <> 0 THEN
1651: hr_utility.set_location('py_za_tx_01032013.SitCalc',30);
1652: -- Check Bonus Provision Frequency
1653: IF dbi_BP_TX_RCV = 'B' OR py_za_tx_utl_01032013.SitePeriod THEN
1654: hr_utility.set_location('py_za_tx_01032013.SitCalc',31);
1655: trc_LibFpAB :=
1656: trc_LibFyAB - (bal_TX_ON_BP_YTD
1657: + trc_LibFpBP
1676: -- Set Cascade Figures and Refund
1677: trc_LibFpAB := -1 * bal_TX_ON_AB_YTD;
1678: trc_LibFpABOvr := TRUE;
1679:
1680: IF dbi_BP_TX_RCV = 'A' AND py_za_tx_utl_01032013.SitePeriod THEN
1681: hr_utility.set_location('py_za_tx_01032013.SitCalc',36);
1682: trc_LibFpBP := -1 * bal_TX_ON_BP_YTD;
1683: trc_LibFpBPOvr := TRUE;
1684: --Commented below line for bug 9438325
1705: --Suffixed the variable with WoDon to denote that donation amount is not deducted.
1706: -- Taxable Annual Payments Income
1707: trc_TxbAnnPymIncWoDon := trc_AnnPymErn - trc_AnnTotAbm;
1708:
1709: trc_TxbAnnPymInc :=trc_TxbAnnPymIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbAnnPymIncWoDon,trc_AnnDonAmt);
1710:
1711: -- Threshold Check
1712: IF trc_TxbAnnPymInc >= trc_Threshold THEN
1713: hr_utility.set_location('py_za_tx_01032013.SitCalc',39);
1711: -- Threshold Check
1712: IF trc_TxbAnnPymInc >= trc_Threshold THEN
1713: hr_utility.set_location('py_za_tx_01032013.SitCalc',39);
1714: -- Tax Liability
1715: trc_TotLibAP := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbAnnPymInc);
1716: trc_LibFyAP := trc_TotLibAP - least(trc_TotLibAP,trc_TotLibAB);
1717: trc_TotLibAP := greatest(trc_TotLibAP,trc_TotLibAB);
1718: trc_LibFpAP := trc_LibFyAP - bal_TX_ON_AP_YTD;
1719: ELSE
1743:
1744: --Suffixed the variable with WoDon to denote that donation amount is not deducted.
1745: -- Taxable Annual Payments Income
1746: trc_TxbAnnPymNtgIncWoDon := trc_AnnPymNtgErn - trc_AnnTotAbm;
1747: trc_TxbAnnPymNtgInc :=trc_TxbAnnPymNtgIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbAnnPymNtgIncWoDon,trc_AnnDonAmt);
1748:
1749: -- Threshold Check
1750: IF trc_TxbAnnPymNtgInc >= trc_Threshold THEN
1751: hr_utility.set_location('py_za_tx_01032013.SitCalc',47);
1749: -- Threshold Check
1750: IF trc_TxbAnnPymNtgInc >= trc_Threshold THEN
1751: hr_utility.set_location('py_za_tx_01032013.SitCalc',47);
1752: -- Tax Liability
1753: trc_TotLibNtgAP := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbAnnPymNtgInc);
1754: trc_LibFyNtgAP := trc_TotLibNtgAP - least(trc_TotLibNtgAP,trc_TotLibAP);
1755: trc_TotLibNtgAP := greatest(trc_TotLibNtgAP,trc_TotLibAP);
1756:
1757: trc_LibFpNtgAP := trc_LibFyNtgAP - bal_TX_ON_AP_NTG_YTD;
1781: trc_AnnEEDbtNtgErn := trc_AnnEEDbtNtgYtd + trc_AnnPymNtgErn;
1782:
1783: --Suffixed the variable with WoDon to denote that donation amount is not deducted.
1784: trc_TxbAnnEEDbtNtgIncWoDon := trc_AnnEEDbtNtgErn - trc_AnnTotNTGAbm;
1785: trc_TxbAnnEEDbtNtgInc :=trc_TxbAnnEEDbtNtgIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbAnnEEDbtNtgIncWoDon,trc_AnnDonAmt);
1786:
1787: -- Threshold Check
1788: IF trc_TxbAnnEEDbtNtgInc >= trc_Threshold THEN
1789: hr_utility.set_location('py_za_tx_01032013.SitCalc',51);
1787: -- Threshold Check
1788: IF trc_TxbAnnEEDbtNtgInc >= trc_Threshold THEN
1789: hr_utility.set_location('py_za_tx_01032013.SitCalc',51);
1790: -- Tax Liability
1791: trc_TotLibNtgEEDbt := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbAnnEEDbtNtgInc);
1792: trc_LibFyNtgEEDbt := trc_TotLibNtgEEDbt - least(trc_TotLibNtgEEDbt,trc_TotLibNtgAP);
1793: trc_TotLibNtgEEDbt := greatest(trc_TotLibNtgEEDbt,trc_TotLibNtgAP);
1794: trc_LibFpNtgEEDbt := trc_LibFyNtgEEDbt - bal_TX_ON_EE_DBT_NTG_YTD;
1795: ELSE
1820: hr_utility.set_location('py_za_tx_01032013.SitCalc',55);
1821: l_Sl := FALSE;
1822: END IF;
1823:
1824: py_za_tx_utl_01032013.ValidateTaxOns(p_Rf => l_Sl);
1825:
1826: hr_utility.set_location('py_za_tx_01032013.SitCalc',56);
1827:
1828: -- Set IT3A Indicator
1938: hr_utility.set_location('py_za_tx_01032013.DirCalc',3);
1939: -- Normal Earnings
1940: trc_NorErn := trc_NorIncYtd;
1941: -- Tax Liability
1942: trc_TotLibNI := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_NorErn);
1943: trc_LibFyNI := trc_TotLibNI - 0;
1944: trc_TotLibNI := greatest(trc_TotLibNI,0);
1945: trc_LibFpNI := trc_LibFyNI - bal_TX_ON_NI_YTD;
1946: ELSE
1959: hr_utility.set_location('py_za_tx_01032013.DirCalc',9);
1960: -- Bonus Provision Earnings
1961: trc_BonProErn := trc_BonProYtd + trc_NorErn;
1962: -- Tax Liability
1963: trc_TotLibBP := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_BonProErn);
1964: trc_LibFyBP := trc_TotLibBP - least(trc_TotLibBP,trc_TotLibNI);
1965: trc_TotLibBP := greatest(trc_TotLibBP,trc_TotLibNI);
1966: trc_LibFpBP := trc_LibFyBP - bal_TX_ON_BP_YTD;
1967: ELSE
1980: hr_utility.set_location('py_za_tx_01032013.DirCalc',11);
1981: -- Annual Bonus Earnings
1982: trc_AnnBonErn := trc_AnnBonYtd + trc_NorErn;
1983: -- Tax Liability
1984: trc_TotLibAB := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_AnnBonErn);
1985: trc_LibFyAB := trc_TotLibAB - least(trc_TotLibAB,trc_TotLibNI);
1986: trc_TotLibAB := greatest(trc_TotLibAB,trc_TotLibNI);
1987: -- Check Bonus Provision
1988: IF trc_BonProYtd <> 0 THEN
1987: -- Check Bonus Provision
1988: IF trc_BonProYtd <> 0 THEN
1989: hr_utility.set_location('py_za_tx_01032013.DirCalc',12);
1990: -- Check Bonus Provision Frequency
1991: IF dbi_BP_TX_RCV = 'B' OR py_za_tx_utl_01032013.SitePeriod THEN
1992: hr_utility.set_location('py_za_tx_01032013.DirCalc',13);
1993: trc_LibFpAB :=
1994: trc_LibFyAB - (bal_TX_ON_BP_YTD
1995: + trc_LibFpBP
2006: hr_utility.set_location('py_za_tx_01032013.DirCalc',16);
2007: -- Set Cascade Figures and Refund
2008: trc_LibFpAB := -1 * bal_TX_ON_AB_YTD;
2009: trc_LibFpABOvr := TRUE;
2010: IF dbi_BP_TX_RCV = 'A' AND py_za_tx_utl_01032013.SitePeriod THEN
2011: hr_utility.set_location('py_za_tx_01032013.DirCalc',17);
2012: trc_LibFpBP := -1 * bal_TX_ON_BP_YTD;
2013: trc_LibFpBPOvr := TRUE;
2014: trc_LibFpAPOvr := TRUE;
2028: hr_utility.set_location('py_za_tx_01032013.DirCalc',19);
2029: -- Annual Payments Earnings
2030: trc_AnnPymErn := trc_AnnPymYtd + trc_AnnBonErn;
2031: -- Tax Liability
2032: trc_TotLibAP := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_AnnPymErn);
2033: trc_LibFyAP := trc_TotLibAP - least(trc_TotLibAP,trc_TotLibAB);
2034: trc_TotLibAP := greatest(trc_TotLibAP,trc_TotLibAB);
2035: trc_LibFpAP := trc_LibFyAP - bal_TX_ON_AP_YTD;
2036: ElSE
2049: hr_utility.set_location('py_za_tx_01032013.DirCalc',23);
2050: -- Annual Payments Net to Gross Earnings
2051: trc_AnnPymNtgErn := trc_AnnPymNtgYtd + trc_AnnPymErn;
2052: -- Tax Liability
2053: trc_TotLibNtgAP := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_AnnPymNtgErn);
2054: trc_LibFyNtgAP := trc_TotLibNtgAP - least(trc_TotLibNtgAP,trc_TotLibAP);
2055: trc_TotLibNtgAP := greatest(trc_TotLibNtgAP,trc_TotLibAP);
2056: trc_LibFpNtgAP := trc_LibFyNtgAP - bal_TX_ON_AP_NTG_YTD;
2057: ELSE
2071: -- Annual EE Debt Net to Gross Earnings
2072: trc_AnnEEDbtNtgErn := trc_AnnEEDbtNtgYtd + trc_AnnPymNtgErn;
2073:
2074: -- Tax Liability
2075: trc_TotLibNtgEEDbt := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_AnnEEDbtNtgErn);
2076: trc_LibFyNtgEEDbt := trc_TotLibNtgEEDbt - least(trc_TotLibNtgEEDbt,trc_TotLibNtgAP);
2077: trc_TotLibNtgEEDbt := greatest(trc_TotLibNtgEEDbt,trc_TotLibNtgAP);
2078: trc_LibFpNtgEEDbt := trc_LibFyNtgEEDbt - bal_TX_ON_EE_DBT_NTG_YTD;
2079: ELSE
2093: ELSE
2094: l_Sl := FALSE;
2095: END IF;
2096:
2097: py_za_tx_utl_01032013.ValidateTaxOns(p_Rf => l_Sl);
2098:
2099: hr_utility.set_location('py_za_tx_01032013.DirCalc',27);
2100:
2101: -- Tax Percentage Indicator
2198: -- Identify the Calculation
2199: trc_CalTyp := 'BasCalc';
2200:
2201: -- Rebates
2202: py_za_tx_utl_01032013.SetRebates;
2203:
2204: -- Abatements
2205: py_za_tx_utl_01032013.Abatements;
2206:
2201: -- Rebates
2202: py_za_tx_utl_01032013.SetRebates;
2203:
2204: -- Abatements
2205: py_za_tx_utl_01032013.Abatements;
2206:
2207: -- Deemed Remuneration
2208: trc_DmdRmnRun := bal_DIR_DMD_RMN_ITD;
2209: -- Skip the calculation if there is No Income
2214: -- Threshold Check
2215: IF trc_TxbDmdRmn >= trc_Threshold THEN
2216: hr_utility.set_location('py_za_tx_01032013.BasCalc',3);
2217: -- Tax Liability
2218: trc_TotLibDR := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbDmdRmn);
2219: ELSE
2220: hr_utility.set_location('py_za_tx_01032013.BasCalc',4);
2221: trc_TotLibDR := 0;
2222: END IF;
2234: -- Threshold Check
2235: IF trc_TxbBseInc >= trc_Threshold THEN
2236: hr_utility.set_location('py_za_tx_01032013.BasCalc',7);
2237: -- Tax Liability
2238: trc_TotLibBse := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbBseInc);
2239: trc_TotLibBse := greatest(trc_TotLibBse,trc_TotLibDR);
2240: ELSE
2241: hr_utility.set_location('py_za_tx_01032013.BasCalc',8);
2242: trc_TotLibBse := trc_TotLibDR;
2254: -- Taxable Annual Bonus Income
2255: --TYS2010
2256: --Suffixed the variable with WoDon to denote that donation amount is not deducted.
2257: trc_TxbAnnBonIncWoDon := trc_AnnBonErn - trc_AnnTotAbm;
2258: trc_TxbAnnBonInc :=trc_TxbAnnBonIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbAnnBonIncWoDon,trc_AnnDonAmt);
2259:
2260: -- Threshold Check
2261: IF trc_TxbAnnBonInc >= trc_Threshold THEN
2262: hr_utility.set_location('py_za_tx_01032013.BasCalc',11);
2260: -- Threshold Check
2261: IF trc_TxbAnnBonInc >= trc_Threshold THEN
2262: hr_utility.set_location('py_za_tx_01032013.BasCalc',11);
2263: -- Tax Liability
2264: trc_TotLibAB := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbAnnBonInc);
2265: trc_LibFyAB := trc_TotLibAB - least(trc_TotLibAB,trc_TotLibBse);
2266: trc_TotLibAB := greatest(trc_TotLibAB,trc_TotLibBse);
2267: -- Check Bonus Provision
2268: IF bal_BP_YTD <> 0 THEN
2304: -- trc_TxbAnnPymInc := trc_AnnPymYtd + trc_TxbAnnBonInc;
2305: --Added for TYS2010
2306: trc_AnnPymErn := trc_AnnPymYtd + trc_AnnBonErn;
2307: trc_TxbAnnPymIncWoDon := trc_AnnPymErn - trc_AnnTotAbm;
2308: trc_TxbAnnPymInc :=trc_TxbAnnPymIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbAnnPymIncWoDon,trc_AnnDonAmt);
2309:
2310: -- Threshold Check
2311: IF trc_TxbAnnPymInc >= trc_Threshold THEN
2312: hr_utility.set_location('py_za_tx_01032013.BasCalc',20);
2310: -- Threshold Check
2311: IF trc_TxbAnnPymInc >= trc_Threshold THEN
2312: hr_utility.set_location('py_za_tx_01032013.BasCalc',20);
2313: -- Tax Liability
2314: trc_TotLibAP := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbAnnPymInc);
2315: trc_LibFyAP := trc_TotLibAP - least(trc_TotLibAP,trc_TotLibAB);
2316: trc_TotLibAP := greatest(trc_TotLibAP,trc_TotLibAB);
2317: trc_LibFpAP := trc_LibFyAP - bal_TX_ON_AP_YTD;
2318: ELSE
2340:
2341: --Suffixed the variable with WoDon to denote that donation amount is not deducted.
2342: -- Taxable Annual Payments Income
2343: trc_TxbAnnPymNtgIncWoDon := trc_AnnPymNtgErn - trc_AnnTotAbm;
2344: trc_TxbAnnPymNtgInc :=trc_TxbAnnPymNtgIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbAnnPymNtgIncWoDon,trc_AnnDonAmt);
2345:
2346: -- Threshold Check
2347: IF trc_TxbAnnPymNtgInc >= trc_Threshold THEN
2348: hr_utility.set_location('py_za_tx_01032013.BasCalc',24);
2346: -- Threshold Check
2347: IF trc_TxbAnnPymNtgInc >= trc_Threshold THEN
2348: hr_utility.set_location('py_za_tx_01032013.BasCalc',24);
2349: -- Tax Liability
2350: trc_TotLibNtgAP := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbAnnPymNtgInc);
2351: trc_LibFyNtgAP := trc_TotLibNtgAP - least(trc_TotLibNtgAP,trc_TotLibAP);
2352: trc_TotLibNtgAP := greatest(trc_TotLibNtgAP,trc_TotLibAP);
2353: trc_LibFpNtgAP := trc_LibFyNtgAP - bal_TX_ON_AP_NTG_YTD;
2354: ELSE
2371: trc_AnnEEDbtNtgErn := trc_AnnEEDbtNtgYtd + trc_AnnPymNtgErn;
2372:
2373: --Suffixed the variable with WoDon to denote that donation amount is not deducted.
2374: trc_TxbAnnEEDbtNtgIncWoDon := trc_AnnEEDbtNtgErn - trc_AnnTotNTGAbm;
2375: trc_TxbAnnEEDbtNtgInc :=trc_TxbAnnEEDbtNtgIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbAnnEEDbtNtgIncWoDon,trc_AnnDonAmt);
2376:
2377: -- Threshold Check
2378: IF trc_TxbAnnEEDbtNtgInc >= trc_Threshold THEN
2379: hr_utility.set_location('py_za_tx_01032013.BasCalc',28);
2377: -- Threshold Check
2378: IF trc_TxbAnnEEDbtNtgInc >= trc_Threshold THEN
2379: hr_utility.set_location('py_za_tx_01032013.BasCalc',28);
2380: -- Tax Liability
2381: trc_TotLibNtgEEDbt := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbAnnEEDbtNtgInc);
2382: trc_LibFyNtgEEDbt := trc_TotLibNtgEEDbt - least(trc_TotLibNtgEEDbt,trc_TotLibNtgAP);
2383: trc_TotLibNtgEEDbt := greatest(trc_TotLibNtgEEDbt,trc_TotLibNtgAP);
2384:
2385: hr_utility.set_location('py_za_tx_01032013.BasCalc',29);
2395: trc_TotLibNtgEEDbt := trc_TotLibNtgAP;
2396: END IF;
2397:
2398: -- Net Pay Validation
2399: py_za_tx_utl_01032013.ValidateTaxOns;
2400:
2401: -- Deemed Remuneration
2402: WrtHrTrc('trc_TxbDmdRmn: '||to_char(trc_TxbDmdRmn));
2403: WrtHrTrc('trc_TotLibDR: '||to_char(trc_TotLibDR));
2476: ELSE -- continue CalCalc
2477: hr_utility.set_location('py_za_tx_01032013.CalCalc',4);
2478:
2479: -- Site Factor
2480: trc_SitFactor := dbi_ZA_DYS_IN_YR / py_za_tx_utl_01032013.DaysWorked;
2481:
2482: -- Rebates
2483: py_za_tx_utl_01032013.SetRebates;
2484:
2479: -- Site Factor
2480: trc_SitFactor := dbi_ZA_DYS_IN_YR / py_za_tx_utl_01032013.DaysWorked;
2481:
2482: -- Rebates
2483: py_za_tx_utl_01032013.SetRebates;
2484:
2485: -- Abatements
2486: py_za_tx_utl_01032013.Abatements;
2487:
2482: -- Rebates
2483: py_za_tx_utl_01032013.SetRebates;
2484:
2485: -- Abatements
2486: py_za_tx_utl_01032013.Abatements;
2487:
2488: hr_utility.set_location('py_za_tx_01032013.CalCalc',5);
2489:
2490: -- Deemed Remuneration
2497: -- Threshold Check
2498: IF trc_TxbDmdRmn >= trc_Threshold THEN
2499: hr_utility.set_location('py_za_tx_01032013.CalCalc',7);
2500: -- Tax Liability
2501: trc_TotLibDR := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbDmdRmn);
2502: ELSE
2503: hr_utility.set_location('py_za_tx_01032013.CalCalc',8);
2504: trc_TotLibDR := 0;
2505: END IF;
2515: --TYS2010
2516: --Suffixed the variable with WoDon to denote that donation amount is not deducted.
2517: -- Taxable Base Income
2518: trc_TxbBseIncWoDon := trc_BseErn - trc_PerTotAbm;
2519: trc_TxbBseInc :=trc_TxbBseIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbBseIncWoDon,trc_PerDonAmt);
2520:
2521: -- Threshold Check
2522: IF trc_TxbBseInc >= trc_Threshold THEN
2523: hr_utility.set_location('py_za_tx_01032013.CalCalc',11);
2521: -- Threshold Check
2522: IF trc_TxbBseInc >= trc_Threshold THEN
2523: hr_utility.set_location('py_za_tx_01032013.CalCalc',11);
2524: -- Tax Liability
2525: trc_TotLibBse := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbBseInc);
2526: trc_TotLibBse := greatest(trc_TotLibBse,trc_TotLibDR);
2527: ELSE
2528: hr_utility.set_location('py_za_tx_01032013.CalCalc',12);
2529: trc_TotLibBse := trc_TotLibDR;
2541: -- Taxable Annual Bonus Income
2542: --TYS2010
2543: --Suffixed the variable with WoDon to denote that donation amount is not deducted.
2544: trc_TxbAnnBonIncWoDon := trc_AnnBonErn - trc_AnnTotAbm;
2545: trc_TxbAnnBonInc :=trc_TxbAnnBonIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbAnnBonIncWoDon,trc_AnnDonAmt);
2546:
2547: -- Threshold Check
2548: IF trc_TxbAnnBonInc >= trc_Threshold THEN
2549: hr_utility.set_location('py_za_tx_01032013.CalCalc',15);
2547: -- Threshold Check
2548: IF trc_TxbAnnBonInc >= trc_Threshold THEN
2549: hr_utility.set_location('py_za_tx_01032013.CalCalc',15);
2550: -- Tax Liability
2551: trc_TotLibAB := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbAnnBonInc);
2552: trc_LibFyAB := trc_TotLibAB - least(trc_TotLibAB,trc_TotLibBse);
2553: trc_TotLibAB := greatest(trc_TotLibAB,trc_TotLibBse);
2554: -- Check Bonus Provision
2555: IF bal_BP_YTD <> 0 THEN
2590: -- Taxable Annual Payments Income
2591: --TYS2010
2592: --Suffixed the variable with WoDon to denote that donation amount is not deducted.
2593: trc_TxbAnnPymIncWoDon := trc_AnnPymErn - trc_AnnTotAbm;
2594: trc_TxbAnnPymInc :=trc_TxbAnnPymIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbAnnPymIncWoDon,trc_AnnDonAmt);
2595:
2596: -- Threshold Check
2597: IF trc_TxbAnnPymInc >= trc_Threshold THEN
2598: hr_utility.set_location('py_za_tx_01032013.CalCalc',24);
2596: -- Threshold Check
2597: IF trc_TxbAnnPymInc >= trc_Threshold THEN
2598: hr_utility.set_location('py_za_tx_01032013.CalCalc',24);
2599: -- Tax Liability
2600: trc_TotLibAP := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbAnnPymInc);
2601: trc_LibFyAP := trc_TotLibAP - least(trc_TotLibAP,trc_TotLibAB);
2602: trc_TotLibAP := greatest(trc_TotLibAP,trc_TotLibAB);
2603: trc_LibFpAP := trc_LibFyAP - bal_TX_ON_AP_YTD;
2604: ELSE
2622:
2623: --Suffixed the variable with WoDon to denote that donation amount is not deducted.
2624: -- Taxable Annual Payments Income
2625: trc_TxbAnnPymNtgIncWoDon := trc_AnnPymNtgErn - trc_AnnTotAbm;
2626: trc_TxbAnnPymNtgInc :=trc_TxbAnnPymNtgIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbAnnPymNtgIncWoDon,trc_AnnDonAmt);
2627:
2628: -- Threshold Check
2629: IF trc_TxbAnnPymNtgInc >= trc_Threshold THEN
2630: hr_utility.set_location('py_za_tx_01032013.CalCalc',28);
2628: -- Threshold Check
2629: IF trc_TxbAnnPymNtgInc >= trc_Threshold THEN
2630: hr_utility.set_location('py_za_tx_01032013.CalCalc',28);
2631: -- Tax Liability
2632: trc_TotLibNtgAP := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbAnnPymNtgInc);
2633: trc_LibFyNtgAP := trc_TotLibNtgAP - least(trc_TotLibNtgAP,trc_TotLibAP);
2634: trc_TotLibNtgAP := greatest(trc_TotLibNtgAP,trc_TotLibAP);
2635:
2636: hr_utility.set_location('py_za_tx_01032013.CalCalc',29);
2655: trc_AnnEEDbtNtgErn := trc_AnnEEDbtNtgYtd + trc_AnnPymNtgErn;
2656:
2657: --Suffixed the variable with WoDon to denote that donation amount is not deducted.
2658: trc_TxbAnnEEDbtNtgIncWoDon := trc_AnnEEDbtNtgErn - trc_AnnTotNTGAbm;
2659: trc_TxbAnnEEDbtNtgInc :=trc_TxbAnnEEDbtNtgIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbAnnEEDbtNtgIncWoDon,trc_AnnDonAmt);
2660:
2661: -- Threshold Check
2662: IF trc_TxbAnnEEDbtNtgInc >= trc_Threshold THEN
2663: hr_utility.set_location('py_za_tx_01032013.CalCalc',33);
2661: -- Threshold Check
2662: IF trc_TxbAnnEEDbtNtgInc >= trc_Threshold THEN
2663: hr_utility.set_location('py_za_tx_01032013.CalCalc',33);
2664: -- Tax Liability
2665: trc_TotLibNtgEEDbt := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbAnnEEDbtNtgInc);
2666: trc_LibFyNtgEEDbt := trc_TotLibNtgEEDbt - least(trc_TotLibNtgEEDbt,trc_TotLibNtgAP);
2667: trc_TotLibNtgEEDbt := greatest(trc_TotLibNtgEEDbt,trc_TotLibNtgAP);
2668:
2669: hr_utility.set_location('py_za_tx_01032013.CalCalc',34);
2679: trc_TotLibNtgEEDbt := trc_TotLibNtgAP;
2680: END IF;
2681:
2682: -- Net pay Validation
2683: py_za_tx_utl_01032013.ValidateTaxOns;
2684:
2685: -- Deemed Remuneration
2686: WrtHrTrc('trc_TxbDmdRmn: '||to_char(trc_TxbDmdRmn));
2687: WrtHrTrc('trc_TotLibDR: '||to_char(trc_TotLibDR));
2772: ELSE --Continue YtdCalc
2773: hr_utility.set_location('py_za_tx_01032013.YtdCalc',4);
2774:
2775: -- Site Factor
2776: trc_SitFactor := dbi_ZA_DYS_IN_YR / py_za_tx_utl_01032013.DaysWorked;
2777:
2778: -- Rebates
2779: py_za_tx_utl_01032013.SetRebates;
2780:
2775: -- Site Factor
2776: trc_SitFactor := dbi_ZA_DYS_IN_YR / py_za_tx_utl_01032013.DaysWorked;
2777:
2778: -- Rebates
2779: py_za_tx_utl_01032013.SetRebates;
2780:
2781: -- Abatements
2782: py_za_tx_utl_01032013.Abatements;
2783:
2778: -- Rebates
2779: py_za_tx_utl_01032013.SetRebates;
2780:
2781: -- Abatements
2782: py_za_tx_utl_01032013.Abatements;
2783:
2784: hr_utility.set_location('py_za_tx_01032013.YtdCalc',5);
2785:
2786: --Bug 9369895
2798: -- Threshold Check
2799: IF trc_TxbDmdRmn >= trc_Threshold THEN
2800: hr_utility.set_location('py_za_tx_01032013.YtdCalc',7);
2801: -- Tax Liability
2802: trc_TotLibDR := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbDmdRmn);
2803: ELSE
2804: hr_utility.set_location('py_za_tx_01032013.YtdCalc',8);
2805: trc_TotLibDR := 0;
2806: END IF;
2816: -- Taxable Base Income
2817: --TYS2010
2818: --Suffixed the variable with WoDon to denote that donation amount is not deducted.
2819: trc_TxbBseIncWoDon := trc_BseErn - trc_PerTotAbm;
2820: trc_TxbBseInc :=trc_TxbBseIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbBseIncWoDon,trc_PerDonAmt);
2821:
2822: -- Threshold Check
2823: IF trc_TxbBseInc >= trc_Threshold THEN
2824: hr_utility.set_location('py_za_tx_01032013.YtdCalc',11);
2822: -- Threshold Check
2823: IF trc_TxbBseInc >= trc_Threshold THEN
2824: hr_utility.set_location('py_za_tx_01032013.YtdCalc',11);
2825: -- Tax Liability
2826: trc_TotLibBse := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbBseInc);
2827: trc_TotLibBse := greatest(trc_TotLibBse,trc_TotLibDR);
2828: ELSE
2829: hr_utility.set_location('py_za_tx_01032013.YtdCalc',12);
2830: trc_TotLibBse := trc_TotLibDR;
2842: -- Taxable Annual Bonus Income
2843: --TYS2010
2844: --Suffixed the variable with WoDon to denote that donation amount is not deducted.
2845: trc_TxbAnnBonIncWoDon := trc_AnnBonErn - trc_AnnTotAbm;
2846: trc_TxbAnnBonInc :=trc_TxbAnnBonIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbAnnBonIncWoDon,trc_AnnDonAmt);
2847:
2848: -- Threshold Check
2849: IF trc_TxbAnnBonInc >= trc_Threshold THEN
2850: hr_utility.set_location('py_za_tx_01032013.YtdCalc',15);
2848: -- Threshold Check
2849: IF trc_TxbAnnBonInc >= trc_Threshold THEN
2850: hr_utility.set_location('py_za_tx_01032013.YtdCalc',15);
2851: -- Tax Liability
2852: trc_TotLibAB := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbAnnBonInc);
2853: trc_LibFyAB := trc_TotLibAB - least(trc_TotLibAB,trc_TotLibBse);
2854: trc_TotLibAB := greatest(trc_TotLibAB,trc_TotLibBse);
2855: -- Check Bonus Provision
2856: IF bal_BP_YTD <> 0 THEN
2891: -- Taxable Annual Payments Income
2892: --TYS2010
2893: --Suffixed the variable with WoDon to denote that donation amount is not deducted.
2894: trc_TxbAnnPymIncWoDon := trc_AnnPymErn - trc_AnnTotAbm;
2895: trc_TxbAnnPymInc :=trc_TxbAnnPymIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbAnnPymIncWoDon,trc_AnnDonAmt);
2896:
2897: -- Threshold Check
2898: IF trc_TxbAnnPymInc >= trc_Threshold THEN
2899: hr_utility.set_location('py_za_tx_01032013.YtdCalc',24);
2897: -- Threshold Check
2898: IF trc_TxbAnnPymInc >= trc_Threshold THEN
2899: hr_utility.set_location('py_za_tx_01032013.YtdCalc',24);
2900: -- Tax Liability
2901: trc_TotLibAP := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbAnnPymInc);
2902: trc_LibFyAP := trc_TotLibAP - least(trc_TotLibAP,trc_TotLibAB);
2903: trc_TotLibAP := greatest(trc_TotLibAP,trc_TotLibAB);
2904: trc_LibFpAP := trc_LibFyAP - bal_TX_ON_AP_YTD;
2905: ELSE
2923:
2924: --Suffixed the variable with WoDon to denote that donation amount is not deducted.
2925: -- Taxable Annual Payments Income
2926: trc_TxbAnnPymNtgIncWoDon := trc_AnnPymNtgErn - trc_AnnTotAbm;
2927: trc_TxbAnnPymNtgInc :=trc_TxbAnnPymNtgIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbAnnPymNtgIncWoDon,trc_AnnDonAmt);
2928:
2929: -- Threshold Check
2930: IF trc_TxbAnnPymNtgInc >= trc_Threshold THEN
2931: hr_utility.set_location('py_za_tx_01032013.YtdCalc',28);
2929: -- Threshold Check
2930: IF trc_TxbAnnPymNtgInc >= trc_Threshold THEN
2931: hr_utility.set_location('py_za_tx_01032013.YtdCalc',28);
2932: -- Tax Liability
2933: trc_TotLibNtgAP := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbAnnPymNtgInc);
2934: trc_LibFyNtgAP := trc_TotLibNtgAP - least(trc_TotLibNtgAP,trc_TotLibAP);
2935: trc_TotLibNtgAP := greatest(trc_TotLibNtgAP,trc_TotLibAP);
2936:
2937: hr_utility.set_location('py_za_tx_01032013.YtdCalc',29);
2958: trc_AnnEEDbtNtgErn := trc_AnnEEDbtNtgYtd + trc_AnnPymNtgErn;
2959:
2960: --Suffixed the variable with WoDon to denote that donation amount is not deducted.
2961: trc_TxbAnnEEDbtNtgIncWoDon := trc_AnnEEDbtNtgErn - trc_AnnTotNTGAbm;
2962: trc_TxbAnnEEDbtNtgInc :=trc_TxbAnnEEDbtNtgIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbAnnEEDbtNtgIncWoDon,trc_AnnDonAmt);
2963:
2964: -- Threshold Check
2965: IF trc_TxbAnnEEDbtNtgInc >= trc_Threshold THEN
2966: hr_utility.set_location('py_za_tx_01032013.YtdCalc',33);
2964: -- Threshold Check
2965: IF trc_TxbAnnEEDbtNtgInc >= trc_Threshold THEN
2966: hr_utility.set_location('py_za_tx_01032013.YtdCalc',33);
2967: -- Tax Liability
2968: trc_TotLibNtgEEDbt := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbAnnEEDbtNtgInc);
2969: trc_LibFyNtgEEDbt := trc_TotLibNtgEEDbt - least(trc_TotLibNtgEEDbt,trc_TotLibNtgAP);
2970: trc_TotLibNtgEEDbt := greatest(trc_TotLibNtgEEDbt,trc_TotLibNtgAP);
2971:
2972: hr_utility.set_location('py_za_tx_01032013.YtdCalc',34);
2984: --trc_LibFpNtgEEDbt := -1 * bal_TX_ON_EE_DBT_NTG_YTD;
2985: END IF;
2986:
2987: -- Net Pay validation
2988: py_za_tx_utl_01032013.ValidateTaxOns;
2989:
2990: hr_utility.set_location('py_za_tx_01032013.YtdCalc',37);
2991:
2992: -- Deemed Remuneration
3074: bal_TOT_TXB_PO_PTD := bal_TOT_TXB_PO_PTD * glb_ZA_PBL_TX_PRC / 100;
3075: bal_TOT_TXB_PO_YTD := bal_TOT_TXB_PO_YTD * glb_ZA_PBL_TX_PRC / 100;
3076:
3077: -- Period Factor
3078: py_za_tx_utl_01032013.PeriodFactor;
3079: hr_utility.set_location('py_za_tx_01032013.NorCalc',5);
3080:
3081: -- Possible Periods Factor
3082: py_za_tx_utl_01032013.PossiblePeriodsFactor;
3078: py_za_tx_utl_01032013.PeriodFactor;
3079: hr_utility.set_location('py_za_tx_01032013.NorCalc',5);
3080:
3081: -- Possible Periods Factor
3082: py_za_tx_utl_01032013.PossiblePeriodsFactor;
3083: hr_utility.set_location('py_za_tx_01032013.NorCalc',10);
3084:
3085: -- Rebates
3086: py_za_tx_utl_01032013.SetRebates;
3082: py_za_tx_utl_01032013.PossiblePeriodsFactor;
3083: hr_utility.set_location('py_za_tx_01032013.NorCalc',10);
3084:
3085: -- Rebates
3086: py_za_tx_utl_01032013.SetRebates;
3087: hr_utility.set_location('py_za_tx_01032013.NorCalc',15);
3088:
3089: -- Abatements
3090: py_za_tx_utl_01032013.Abatements;
3086: py_za_tx_utl_01032013.SetRebates;
3087: hr_utility.set_location('py_za_tx_01032013.NorCalc',15);
3088:
3089: -- Abatements
3090: py_za_tx_utl_01032013.Abatements;
3091: hr_utility.set_location('py_za_tx_01032013.NorCalc',20);
3092:
3093: -- Total Periodic Income (i.e Normal Income + Fringe Benefits + Travel Allowance + Public Office Allowance)
3094: bal_TOT_TXB_NI_PTD := bal_TOT_TXB_NI_PTD +
3111: -- Threshold Check
3112: IF trc_TxbDmdRmn >= trc_Threshold THEN
3113: hr_utility.set_location('py_za_tx_01032013.NorCalc',30);
3114: -- Tax Liability
3115: trc_TotLibDR := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbDmdRmn);
3116: trc_LibFyDR := trc_TotLibDR - 0;
3117: trc_TotLibDR := greatest(trc_TotLibDR,0);
3118: -- DeAnnualise
3119: trc_LibFpDR := py_za_tx_utl_01032013.DeAnnualise
3115: trc_TotLibDR := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbDmdRmn);
3116: trc_LibFyDR := trc_TotLibDR - 0;
3117: trc_TotLibDR := greatest(trc_TotLibDR,0);
3118: -- DeAnnualise
3119: trc_LibFpDR := py_za_tx_utl_01032013.DeAnnualise
3120: ( p_Liab => trc_LibFyDR
3121: , p_TxOnYtd => bal_TX_ON_DR_YTD
3122: , p_TxOnPtd => bal_TX_ON_DR_PTD
3123: );
3146: IF (dbi_TX_MTD in ('C','A') AND trc_NorIncYtd <> 0) OR (dbi_TX_MTD = 'N' AND trc_NorIncPtd > 0) THEN
3147: hr_utility.set_location('py_za_tx_01032013.NorCalc',45);
3148:
3149: -- Annualise Normal Income
3150: trc_NorErn := py_za_tx_utl_01032013.Annualise
3151: (p_YtdInc => trc_NorIncYtd
3152: ,p_PtdInc => trc_NorIncPtd
3153: );
3154: --TYS2010
3154: --TYS2010
3155: -- Taxable Normal Income
3156: --Suffixed the variable with WoDon to denote that donation amount is not deducted.
3157: trc_TxbNorIncWoDon := trc_NorErn - trc_PerTotAbm;
3158: trc_TxbNorInc :=trc_TxbNorIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbNorIncWoDon,trc_PerDonAmt);
3159: -- Threshold Check
3160: IF trc_TxbNorInc >= trc_Threshold THEN
3161: hr_utility.set_location('py_za_tx_01032013.NorCalc',50);
3162: -- Tax Liability
3159: -- Threshold Check
3160: IF trc_TxbNorInc >= trc_Threshold THEN
3161: hr_utility.set_location('py_za_tx_01032013.NorCalc',50);
3162: -- Tax Liability
3163: trc_TotLibNI := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbNorInc);
3164: trc_LibFyNI := trc_TotLibNI - least(trc_TotLibNI,trc_TotLibDR);
3165: trc_TotLibNI := greatest(trc_TotLibNI,trc_TotLibDR);
3166: -- DeAnnualise
3167: trc_LibFpNI := py_za_tx_utl_01032013.DeAnnualise
3163: trc_TotLibNI := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbNorInc);
3164: trc_LibFyNI := trc_TotLibNI - least(trc_TotLibNI,trc_TotLibDR);
3165: trc_TotLibNI := greatest(trc_TotLibNI,trc_TotLibDR);
3166: -- DeAnnualise
3167: trc_LibFpNI := py_za_tx_utl_01032013.DeAnnualise
3168: ( p_Liab => trc_LibFyNI
3169: , p_TxOnYtd => bal_TX_ON_NI_YTD
3170: , p_TxOnPtd => bal_TX_ON_NI_PTD
3171: );
3202: -- If Tax Method is Non Cumulative check for PTD Income
3203: IF (dbi_TX_MTD in ('C','A') AND trc_BonProYtd <> 0) OR (dbi_TX_MTD = 'N' AND trc_BonProPtd > 0) THEN
3204: hr_utility.set_location('py_za_tx_01032013.NorCalc',65);
3205: -- Annualise Bonus Provision
3206: trc_BonProErn := py_za_tx_utl_01032013.Annualise
3207: ( p_YtdInc => trc_BonProYtd
3208: , p_PtdInc => trc_BonProPtd
3209: ) + trc_NorErn;
3210: --TYS2010
3210: --TYS2010
3211: --Suffixed the variable with WoDon to denote that donation amount is not deducted.
3212: -- Taxable Bonus Provision Income
3213: trc_TxbBonProIncWoDon := trc_BonProErn - trc_PerTotAbm;
3214: trc_TxbBonProInc :=trc_TxbBonProIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbBonProIncWoDon,trc_PerDonAmt);
3215:
3216: -- Threshold Check
3217: IF trc_TxbBonProInc >= trc_Threshold THEN
3218: hr_utility.set_location('py_za_tx_01032013.NorCalc',70);
3216: -- Threshold Check
3217: IF trc_TxbBonProInc >= trc_Threshold THEN
3218: hr_utility.set_location('py_za_tx_01032013.NorCalc',70);
3219: -- Tax Liability
3220: trc_TotLibBP := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbBonProInc);
3221: trc_LibFyBP := trc_TotLibBP - least(trc_TotLibBP,trc_TotLibNI);
3222: trc_TotLibBP := greatest(trc_TotLibBP,trc_TotLibNI);
3223: -- DeAnnualise
3224: trc_LibFpBP := py_za_tx_utl_01032013.DeAnnualise
3220: trc_TotLibBP := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbBonProInc);
3221: trc_LibFyBP := trc_TotLibBP - least(trc_TotLibBP,trc_TotLibNI);
3222: trc_TotLibBP := greatest(trc_TotLibBP,trc_TotLibNI);
3223: -- DeAnnualise
3224: trc_LibFpBP := py_za_tx_utl_01032013.DeAnnualise
3225: ( trc_LibFyBP
3226: , bal_TX_ON_BP_YTD
3227: , bal_TX_ON_BP_PTD
3228: );
3261: --TYS2010
3262: --Suffixed the variable with WoDon to denote that donation amount is not deducted.
3263: -- Taxable Annual Bonus Income
3264: trc_TxbAnnBonIncWoDon := trc_AnnBonErn - trc_AnnTotAbm;
3265: trc_TxbAnnBonInc :=trc_TxbAnnBonIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbAnnBonIncWoDon,trc_AnnDonAmt);
3266:
3267: -- Threshold Check
3268: IF trc_TxbAnnBonInc >= trc_Threshold THEN
3269: hr_utility.set_location('py_za_tx_01032013.NorCalc',90);
3267: -- Threshold Check
3268: IF trc_TxbAnnBonInc >= trc_Threshold THEN
3269: hr_utility.set_location('py_za_tx_01032013.NorCalc',90);
3270: -- Tax Liability
3271: trc_TotLibAB := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbAnnBonInc);
3272: trc_LibFyAB := trc_TotLibAB - least(trc_TotLibAB,trc_TotLibNI);
3273: trc_TotLibAB := greatest(trc_TotLibAB,trc_TotLibNI);
3274: -- Check Bonus Provision
3275: IF trc_BonProYtd <> 0 THEN
3323: --TYS2010
3324: --Suffixed the variable with WoDon to denote that donation amount is not deducted.
3325: -- Taxable Annual Payments Income
3326: trc_TxbAnnPymIncWoDon := trc_AnnPymErn - trc_AnnTotAbm;
3327: trc_TxbAnnPymInc :=trc_TxbAnnPymIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbAnnPymIncWoDon,trc_AnnDonAmt);
3328:
3329: -- Threshold Check
3330: IF trc_TxbAnnPymInc >= trc_Threshold THEN
3331: hr_utility.set_location('py_za_tx_01032013.NorCalc',130);
3329: -- Threshold Check
3330: IF trc_TxbAnnPymInc >= trc_Threshold THEN
3331: hr_utility.set_location('py_za_tx_01032013.NorCalc',130);
3332: -- Tax Liability
3333: trc_TotLibAP := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbAnnPymInc);
3334: trc_LibFyAP := trc_TotLibAP - least(trc_TotLibAP,trc_TotLibAB);
3335: trc_TotLibAP := greatest(trc_TotLibAP,trc_TotLibAB);
3336: hr_utility.set_location('py_za_tx_01032013.NorCalc',135);
3337: trc_LibFpAP := trc_LibFyAP - bal_TX_ON_AP_YTD ;
3370:
3371: --Suffixed the variable with WoDon to denote that donation amount is not deducted.
3372: -- Taxable Annual Payments Income
3373: trc_TxbAnnPymNtgIncWoDon := trc_AnnPymNtgErn - trc_AnnTotAbm;
3374: trc_TxbAnnPymNtgInc :=trc_TxbAnnPymNtgIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbAnnPymNtgIncWoDon,trc_AnnDonAmt);
3375:
3376: -- Threshold Check
3377: IF trc_TxbAnnPymNtgInc >= trc_Threshold THEN
3378: hr_utility.set_location('py_za_tx_01032013.NorCalc',155);
3376: -- Threshold Check
3377: IF trc_TxbAnnPymNtgInc >= trc_Threshold THEN
3378: hr_utility.set_location('py_za_tx_01032013.NorCalc',155);
3379: -- Tax Liability
3380: trc_TotLibNtgAP := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbAnnPymNtgInc);
3381: trc_LibFyNtgAP := trc_TotLibNtgAP - least(trc_TotLibNtgAP,trc_TotLibAP);
3382: trc_TotLibNtgAP := greatest(trc_TotLibNtgAP,trc_TotLibAP);
3383:
3384: hr_utility.set_location('py_za_tx_01032013.NorCalc',160);
3410: trc_AnnEEDbtNtgErn := trc_AnnEEDbtNtgYtd + trc_AnnPymNtgErn;
3411:
3412: --Suffixed the variable with WoDon to denote that donation amount is not deducted.
3413: trc_TxbAnnEEDbtNtgIncWoDon := trc_AnnEEDbtNtgErn - trc_AnnTotNTGAbm;
3414: trc_TxbAnnEEDbtNtgInc :=trc_TxbAnnEEDbtNtgIncWoDon - py_za_tx_utl_01032013.AllowableDeduction(trc_TxbAnnEEDbtNtgIncWoDon,trc_AnnDonAmt);
3415:
3416: -- Threshold Check
3417: IF trc_TxbAnnEEDbtNtgInc >= trc_Threshold THEN
3418: hr_utility.set_location('py_za_tx_01032013.NorCalc',180);
3416: -- Threshold Check
3417: IF trc_TxbAnnEEDbtNtgInc >= trc_Threshold THEN
3418: hr_utility.set_location('py_za_tx_01032013.NorCalc',180);
3419: -- Tax Liability
3420: trc_TotLibNtgEEDbt := py_za_tx_utl_01032013.TaxLiability(p_Amt => trc_TxbAnnEEDbtNtgInc);
3421: trc_LibFyNtgEEDbt := trc_TotLibNtgEEDbt - least(trc_TotLibNtgEEDbt,trc_TotLibNtgAP);
3422: trc_TotLibNtgEEDbt := greatest(trc_TotLibNtgEEDbt,trc_TotLibNtgAP);
3423:
3424: hr_utility.set_location('py_za_tx_01032013.NorCalc',185);
3440: trc_LibFpNtgEEDbtOvr := TRUE;
3441: END IF;
3442: hr_utility.set_location('py_za_tx_01032013.NorCalc',200);
3443: -- Net Pay Validation
3444: py_za_tx_utl_01032013.ValidateTaxOns;
3445: hr_utility.set_location('py_za_tx_01032013.NorCalc',205);
3446:
3447: -- Deemed Remuneration
3448: WrtHrTrc('trc_TxbDmdRmn: '||to_char(trc_TxbDmdRmn));
4361:
4362:
4363: -- Set hr_utility globals if debugging
4364: --
4365: --py_za_tx_utl_01032013.g_HrTraceEnabled := TRUE;
4366: --py_za_tx_utl_01032013.g_HrTracePipeName := 'ZATAX';
4367:
4368: -- Call hr_utility start procedure
4369: py_za_tx_utl_01032013.StartHrTrace;
4362:
4363: -- Set hr_utility globals if debugging
4364: --
4365: --py_za_tx_utl_01032013.g_HrTraceEnabled := TRUE;
4366: --py_za_tx_utl_01032013.g_HrTracePipeName := 'ZATAX';
4367:
4368: -- Call hr_utility start procedure
4369: py_za_tx_utl_01032013.StartHrTrace;
4370:
4365: --py_za_tx_utl_01032013.g_HrTraceEnabled := TRUE;
4366: --py_za_tx_utl_01032013.g_HrTracePipeName := 'ZATAX';
4367:
4368: -- Call hr_utility start procedure
4369: py_za_tx_utl_01032013.StartHrTrace;
4370:
4371: l_65Year := add_months(py_za_tx_01032013.dbi_PER_DTE_OF_BRTH,780);
4372:
4373: -- Assignment Number
4759: trc_CalTyp := 'NoCalc';
4760: -- Liability = entered value
4761: trc_LibFpNI := dbi_TX_DIR_VAL;
4762: -- Standard NetPay Validation
4763: py_za_tx_utl_01032013.ValidateTaxOns;
4764: END IF;
4765: -- D = Directive Percentage
4766: -- P = Private Director wth Directive Percentage
4767: --
4780: ELSE
4781: IF trc_OvrTxCalc AND trc_OvrTyp = 'P' THEN
4782: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',16);
4783: trc_OvrWrn := 'WARNING: Tax Override - '||to_char(trc_OvrPrc)||' Percent';
4784: -- Percentage taken into account in py_za_tx_utl_01032013.TaxLiability
4785: END IF;
4786: -- Check Directive Number First
4787: IF dbi_TX_DIR_NUM = 'NULL' THEN
4788: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',17);
4825: ELSE
4826: IF trc_OvrTxCalc AND trc_OvrTyp = 'P' THEN
4827: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',25);
4828: trc_OvrWrn := 'WARNING: Tax Override - '||to_char(trc_OvrPrc)||' Percent';
4829: -- Percentage taken into account in py_za_tx_utl_01032013.TaxLiability
4830: END IF;
4831: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',26);
4832: -- Simply Execute the Directive Calculation
4833: DirCalc;
4855: IF trc_OvrTxCalc AND trc_OvrTyp = 'V' THEN
4856: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',32);
4857: trc_CalTyp := 'OvrCalc';
4858: trc_OvrWrn := 'WARNING: Tax Override - Total Tax Value: '||to_char(trc_LibFpNI + trc_LibFpAP);
4859: py_za_tx_utl_01032013.SetRebates;
4860: ELSE
4861: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',33);
4862: SeaCalc;
4863: END IF;
4876: IF trc_OvrTxCalc AND trc_OvrTyp = 'V' THEN
4877: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',35);
4878: trc_CalTyp := 'OvrCalc';
4879: trc_OvrWrn := 'WARNING: Tax Override - Total Tax Value: '||to_char(trc_LibFpNI + trc_LibFpAP);
4880: py_za_tx_utl_01032013.SetRebates;
4881: trc_SitFactor := dbi_ZA_DYS_IN_YR / py_za_tx_utl_01032013.DaysWorked;
4882: ELSIF trc_OvrTxCalc AND trc_OvrTyp = 'S' THEN
4883: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',36);
4884: trc_CalTyp := 'OvrCalc';
4877: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',35);
4878: trc_CalTyp := 'OvrCalc';
4879: trc_OvrWrn := 'WARNING: Tax Override - Total Tax Value: '||to_char(trc_LibFpNI + trc_LibFpAP);
4880: py_za_tx_utl_01032013.SetRebates;
4881: trc_SitFactor := dbi_ZA_DYS_IN_YR / py_za_tx_utl_01032013.DaysWorked;
4882: ELSIF trc_OvrTxCalc AND trc_OvrTyp = 'S' THEN
4883: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',36);
4884: trc_CalTyp := 'OvrCalc';
4885: trc_OvrWrn := 'WARNING: Tax Override - Forced Site Calculation';
4889: ELSE
4890: IF trc_OvrTxCalc AND trc_OvrTyp = 'P' THEN
4891: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',38);
4892: trc_OvrWrn := 'WARNING: Tax Override - '||to_char(trc_OvrPrc)||' Percent';
4893: -- Percentage taken into account in py_za_tx_utl_01032013.TaxLiability
4894: END IF;
4895:
4896: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',39);
4897: IF py_za_tx_utl_01032013.LatePayPeriod THEN
4893: -- Percentage taken into account in py_za_tx_utl_01032013.TaxLiability
4894: END IF;
4895:
4896: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',39);
4897: IF py_za_tx_utl_01032013.LatePayPeriod THEN
4898: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',40);
4899: LteCalc;
4900: -- Is this a SITE Period?
4901: ELSIF py_za_tx_utl_01032013.EmpTermPrePeriod THEN
4897: IF py_za_tx_utl_01032013.LatePayPeriod THEN
4898: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',40);
4899: LteCalc;
4900: -- Is this a SITE Period?
4901: ELSIF py_za_tx_utl_01032013.EmpTermPrePeriod THEN
4902: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',41);
4903: SitCalc;
4904: ELSIF py_za_tx_utl_01032013.LstPeriod OR py_za_tx_utl_01032013.EmpTermInPeriod THEN
4905: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',42);
4900: -- Is this a SITE Period?
4901: ELSIF py_za_tx_utl_01032013.EmpTermPrePeriod THEN
4902: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',41);
4903: SitCalc;
4904: ELSIF py_za_tx_utl_01032013.LstPeriod OR py_za_tx_utl_01032013.EmpTermInPeriod THEN
4905: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',42);
4906: IF py_za_tx_utl_01032013.PreErnPeriod THEN
4907: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',43);
4908: --When a YtdCalc or CalCalc would be performed,
4902: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',41);
4903: SitCalc;
4904: ELSIF py_za_tx_utl_01032013.LstPeriod OR py_za_tx_utl_01032013.EmpTermInPeriod THEN
4905: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',42);
4906: IF py_za_tx_utl_01032013.PreErnPeriod THEN
4907: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',43);
4908: --When a YtdCalc or CalCalc would be performed,
4909: --the system must do a Bascalc if the method is non-cumulative
4910: IF (dbi_TX_MTD = 'N') then
4918: END IF;
4919: ElSE
4920: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',45);
4921: -- The employee has NOT been terminated!
4922: IF py_za_tx_utl_01032013.PreErnPeriod THEN
4923: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',46);
4924: --When a YtdCalc or CalCalc would be performed,
4925: --the system must do a Bascalc if the method is non-cumulative
4926: IF (dbi_TX_MTD = 'N') then
4933: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',47);
4934: IF dbi_ZA_ASG_TAX_RTR_RSLTS = 'Y' THEN
4935: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',48);
4936: SitCalc;
4937: ELSIF py_za_tx_utl_01032013.NegPtd THEN
4938: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',49);
4939: SitCalc;
4940: ELSE
4941: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',50);
4940: ELSE
4941: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',50);
4942: NorCalc;
4943: END IF; */
4944: ELSIF py_za_tx_utl_01032013.NegPtd THEN
4945: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',51);
4946: SitCalc;
4947: ELSE
4948: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',52);
5018: hr_utility.set_location('-----------------------------------------',65);
5019: trc_MedCrUsed := 0;
5020: trc_curMedTxCrEle := greatest(0,least(bal_MED_AID_TAX_CR_YTD + bal_ANN_MED_AID_TAX_CR_YTD,bal_MED_AID_TAX_CR_USED_YTD+bal_TAX_YTD+p_PayValSD))- bal_MED_AID_TAX_CR_USED_YTD;
5021: hr_utility.set_location('trc_curMedTxCrEle:'||trc_curMedTxCrEle,65);
5022: IF py_za_tx_utl_01032013.AllowRefund(p_65Year => l_65Year) THEN
5023: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',65);
5024: trc_MedCrUsed := -1 * LEAST(bal_MED_AID_TAX_CR_USED_YTD,p_PayValSD,bal_NET_PAY_RUN);
5025: p_PayValSD := p_PayValSD - trc_MedCrUsed;
5026: trc_curMedTxCrEle := trc_curMedTxCrEle - trc_MedCrUsed;
5042: -- End Medical Tax Credit Changes
5043:
5044: -- Post Calculation Steps
5045: --
5046: py_za_tx_utl_01032013.SitPaySplit;
5047:
5048: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',58);
5049:
5050: -- Execute the Arrear Processing
5048: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',58);
5049:
5050: -- Execute the Arrear Processing
5051: --
5052: IF py_za_tx_utl_01032013.SitePeriod THEN
5053: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',59);
5054: py_za_tx_utl_01032013.ArrearExcess;
5055: END IF;
5056:
5050: -- Execute the Arrear Processing
5051: --
5052: IF py_za_tx_utl_01032013.SitePeriod THEN
5053: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',59);
5054: py_za_tx_utl_01032013.ArrearExcess;
5055: END IF;
5056:
5057: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',60);
5058:
5230:
5231: FOR LSDir in csr_all_LSDir(ASSIGNMENT_ACTION_ID)
5232: LOOP
5233: l_LSDirRec := null;
5234: py_za_tx_utl_01032013.StopHrTrace;
5235: pay_balance_pkg.set_context('SOURCE_TEXT',LSDir.dirnum);
5236: l_LSDirRec.TxOnLSDirRUN := pay_balance_pkg.get_value(get_def_bal_id('Tax on Lump Sums',
5237: '_ASG_LMPSM_RUN')
5238: ,ASSIGNMENT_ACTION_ID);
5250: ,ASSIGNMENT_ACTION_ID);
5251: l_LSDirRec.MedTxCrUsedOnLSDirYTD := pay_balance_pkg.get_value(get_def_bal_id('Medical Tax Credit Used on Lump Sums',
5252: '_ASG_LMPSM_TAX_YTD')
5253: ,ASSIGNMENT_ACTION_ID);
5254: py_za_tx_utl_01032013.StartHrTrace;
5255: hr_utility.set_location('trc_curMedTxCrEle:'||trc_curMedTxCrEle,67);
5256: hr_utility.set_location('LSDir.dirnum:'||LSDir.dirnum,67);
5257: hr_utility.set_location('l_LSDirRec.TxOnLSDirRUN:'||l_LSDirRec.TxOnLSDirRUN,67);
5258: hr_utility.set_location('l_LSDirRec.TxOnLSDirPTD:'||l_LSDirRec.TxOnLSDirPTD,67);
5321: -- End Medical Tax Credit Lump Sum Changes
5322:
5323: -- Execute The Tax Trace
5324: --
5325: py_za_tx_utl_01032013.Trace;
5326:
5327: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',65);
5328:
5329: -- Clear Globals
5327: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',65);
5328:
5329: -- Clear Globals
5330: --
5331: py_za_tx_utl_01032013.ClearGlobals;
5332:
5333: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',66);
5334:
5335: -- End off Trace File
5338: WrtHrTrc('------------------------------------------------------------');
5339: WrtHrTrc(' -- ');
5340:
5341: -- Call hr_utility stop procedure
5342: py_za_tx_utl_01032013.StopHrTrace;
5343:
5344: --dbms_debug.debug_off;
5345:
5346: RETURN l_Dum;
5348: EXCEPTION
5349: WHEN xpt_FxdPrc THEN
5350: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',67);
5351: WrtHrTrc('Sql error msg: Fixed Percentage was not entered');
5352: py_za_tx_utl_01032013.StopHrTrace;
5353: hr_utility.set_message(801, 'Fixed Percentage not entered');
5354: py_za_tx_utl_01032013.ClearGlobals;
5355: hr_utility.raise_error;
5356: WHEN xpt_E THEN
5350: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',67);
5351: WrtHrTrc('Sql error msg: Fixed Percentage was not entered');
5352: py_za_tx_utl_01032013.StopHrTrace;
5353: hr_utility.set_message(801, 'Fixed Percentage not entered');
5354: py_za_tx_utl_01032013.ClearGlobals;
5355: hr_utility.raise_error;
5356: WHEN xpt_E THEN
5357: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',68);
5358: WrtHrTrc('xpt_Msg: '||xpt_Msg);
5355: hr_utility.raise_error;
5356: WHEN xpt_E THEN
5357: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',68);
5358: WrtHrTrc('xpt_Msg: '||xpt_Msg);
5359: py_za_tx_utl_01032013.StopHrTrace;
5360: hr_utility.set_message(801, xpt_Msg);
5361: py_za_tx_utl_01032013.ClearGlobals;
5362: hr_utility.raise_error;
5363: WHEN OTHERS THEN
5357: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',68);
5358: WrtHrTrc('xpt_Msg: '||xpt_Msg);
5359: py_za_tx_utl_01032013.StopHrTrace;
5360: hr_utility.set_message(801, xpt_Msg);
5361: py_za_tx_utl_01032013.ClearGlobals;
5362: hr_utility.raise_error;
5363: WHEN OTHERS THEN
5364: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',69);
5365: WrtHrTrc('Sql error code: '||TO_CHAR(SQLCODE));
5363: WHEN OTHERS THEN
5364: hr_utility.set_location('py_za_tx_01032013.ZaTx_01032013',69);
5365: WrtHrTrc('Sql error code: '||TO_CHAR(SQLCODE));
5366: WrtHrTrc('Sql error msg: '||SUBSTR(SQLERRM(SQLCODE), 1, 100));
5367: py_za_tx_utl_01032013.StopHrTrace;
5368: hr_utility.set_message(801, 'ZaTx_01032013: '||TO_CHAR(SQLCODE));
5369: py_za_tx_utl_01032013.ClearGlobals;
5370: hr_utility.raise_error;
5371: END ZaTx_01032013;
5365: WrtHrTrc('Sql error code: '||TO_CHAR(SQLCODE));
5366: WrtHrTrc('Sql error msg: '||SUBSTR(SQLERRM(SQLCODE), 1, 100));
5367: py_za_tx_utl_01032013.StopHrTrace;
5368: hr_utility.set_message(801, 'ZaTx_01032013: '||TO_CHAR(SQLCODE));
5369: py_za_tx_utl_01032013.ClearGlobals;
5370: hr_utility.raise_error;
5371: END ZaTx_01032013;
5372:
5373: