On the Subject of TAS Returns

Self-explanatory

# No indicators => X = 0
# Lit > Unlit => X = 0.05
# Lit < Unlit => X = 0.1
# Lit = Unlit => X = 0.15
X = ;
GT = ;
GE = ;
portTypeCount = ;
flowChartNumber = ;

PC = floor(GT * X);

TFI = flowChartNumber * portTypeCount;

GP = GT - GE - PC - TFI;
TFA = (GP > 100000) ? (11850 - floor((GP - 100000) / 2)) : 11850;

TI = GP - TFA;
BR = (TI < 34500) ? floor(TI * 0.2) : 6900;
HR = (TI < 34500) ? 0 : floor((TI - 34500) * 0.4);
AR = (TI < 138500) ? 0 : floor((TI - 138000) * 0.45);
IT = BR + HR + AR;

TNIC = GT - GE;
SR = (TNIC < 46350) ? floor((TNIC - 8423) * 0.09) : 3413;
ER = (TNIC < 46350) ? 0 : floor((TNIC - 46350) * 0.02);
NIC = SR + ER;

TTB = IT + NIC

flowChartNumber is determined using this flowchart.

Is the first letter of the surname between A-M? Is the last letter of the NInumber A or C? Is the last letter of the NInumber A or C? Yes Yes No No Yes No Is the lastdigit of thepayrollnumber odd? Yes 932 No 478 Is the lastdigit of thepayrollnumber odd? Yes 81 No 599 Is the lastdigit of thepayrollnumber odd? Yes 736 No 1241 Is the lastdigit of thepayrollnumber odd? Yes 1647 No 0