@@ -73,42 +73,42 @@ const EmployeePayRoll = (props: { employeeData: EmployeeDetails }) => {
7373 } , [ ] ) ;
7474
7575 const itemTemplate = ( ) => {
76- return (
77- < div >
78- < table className = "CardTable" >
79- < colgroup >
80- < col />
81- </ colgroup >
82- < tbody >
83- < tr >
84- < td className = "cardcell" > Regular Hours Worked </ td >
85- </ tr >
86- < tr >
87- < td className = "cardcell" > OverTime Hours Worked </ td >
88- </ tr >
89- < tr >
90- < td className = "cardcell" > Bonus </ td >
91- </ tr >
92- < tr >
93- < td className = "cardcell separateline" > Commission </ td >
94- </ tr >
95- < tr >
96- < td className = "cardcell" > Federal Income Tax </ td >
97- </ tr >
98- < tr >
99- < td className = "cardcell" > State Income Tax </ td >
100- </ tr >
101- < tr >
102- < td className = "cardcell" > Social Security Tax </ td >
103- </ tr >
104- < tr >
105- < td className = "cardcell" > MedicareTax </ td >
106- </ tr >
107- </ tbody >
108- </ table >
109- </ div >
110- ) ;
111- } ;
76+ return (
77+ < div >
78+ < table className = "CardTable" >
79+ < colgroup >
80+ < col />
81+ </ colgroup >
82+ < tbody >
83+ < tr >
84+ < td className = "cardcell" style = { { fontWeight : 400 } } > Regular Hours Worked </ td >
85+ </ tr >
86+ < tr >
87+ < td className = "cardcell" style = { { fontWeight : 400 } } > OverTime Hours Worked </ td >
88+ </ tr >
89+ < tr >
90+ < td className = "cardcell" style = { { fontWeight : 400 } } > Bonus </ td >
91+ </ tr >
92+ < tr >
93+ < td className = "cardcell separateline" style = { { fontWeight : 400 } } > Commission </ td >
94+ </ tr >
95+ < tr >
96+ < td className = "cardcell" style = { { fontWeight : 400 } } > Federal Income Tax </ td >
97+ </ tr >
98+ < tr >
99+ < td className = "cardcell" style = { { fontWeight : 400 } } > State Income Tax </ td >
100+ </ tr >
101+ < tr >
102+ < td className = "cardcell" style = { { fontWeight : 400 } } > Social Security Tax </ td >
103+ </ tr >
104+ < tr >
105+ < td className = "cardcell" style = { { fontWeight : 400 } } > MedicareTax </ td >
106+ </ tr >
107+ </ tbody >
108+ </ table >
109+ </ div >
110+ ) ;
111+ } ;
112112
113113 const totalTemplate = ( ) => {
114114 return (
@@ -208,21 +208,26 @@ const EmployeePayRoll = (props: { employeeData: EmployeeDetails }) => {
208208 ] ;
209209
210210 const queryCellInfo = ( args : QueryCellInfoEventArgs ) : void => {
211- if ( args . column ?. field === 'Total' ) {
212- for ( let i : number = 0 ; i < elemClass . length ; i ++ ) {
213- const elem : HTMLElement = args . cell ?. querySelector ( '.' + elemClass [ i ] ) as HTMLElement ;
214- let value : number = 0 ;
215- for ( let j : number = 0 ; j < months . length ; j ++ ) {
216- if ( ( args . data as any ) [ months [ j ] . field ] ) {
217- value += ( args . data as any ) [ months [ j ] . field ] [ elemClass [ i ] ] * ( isPreviousYearRef . current ? 0.9 : 1 ) ;
218- }
219- }
220- if ( elem ) {
221- elem . innerText = '$ ' + value . toFixed ( 2 ) ;
211+ if ( args . column ?. field === 'Total' ) {
212+ // Compute totals into the Total column
213+ for ( let i = 0 ; i < elemClass . length ; i ++ ) {
214+ const elem = args . cell ?. querySelector ( '.' + elemClass [ i ] ) as HTMLElement ;
215+ let value = 0 ;
216+ for ( let j = 0 ; j < months . length ; j ++ ) {
217+ if ( ( args . data as any ) [ months [ j ] . field ] ) {
218+ value += ( args . data as any ) [ months [ j ] . field ] [ elemClass [ i ] ] * ( isPreviousYearRef . current ? 0.9 : 1 ) ;
222219 }
223220 }
221+ if ( elem ) {
222+ elem . innerText = '$ ' + value . toFixed ( 2 ) ;
223+ }
224224 }
225- } ;
225+
226+ // Make all Total column values medium (500)
227+ const totalCells = args . cell ?. querySelectorAll ( '.cardcell' ) ?? [ ] ;
228+ totalCells . forEach ( ( c ) => ( ( c as HTMLElement ) . style . fontWeight = '500' ) ) ;
229+ }
230+ } ;
226231
227232 const calculteGrossAggregate = ( data : any , aggColumn : AggregateColumnModel ) : string => {
228233 const payStubData : MonthPayStub =
@@ -412,7 +417,7 @@ const EmployeePayRoll = (props: { employeeData: EmployeeDetails }) => {
412417 type = "Custom"
413418 customAggregate = { calculteGrossInYear }
414419 footerTemplate = { ( props : any ) => {
415- return < span > $ { props . Custom } </ span > ;
420+ return < span style = { { fontWeight : 500 } } > $ { props . Custom } </ span > ;
416421 } }
417422 />
418423 { months . map ( ( x , index ) => {
@@ -445,7 +450,7 @@ const EmployeePayRoll = (props: { employeeData: EmployeeDetails }) => {
445450 type = "Custom"
446451 customAggregate = { calculteDeductionInYear }
447452 footerTemplate = { ( props : any ) => {
448- return < span > $ { props . Custom } </ span > ;
453+ return < span style = { { fontWeight : 500 } } > $ { props . Custom } </ span > ;
449454 } }
450455 />
451456 { months . map ( ( x , index ) => {
@@ -470,30 +475,30 @@ const EmployeePayRoll = (props: { employeeData: EmployeeDetails }) => {
470475 field = "Item"
471476 type = "Custom"
472477 footerTemplate = { ( ) => {
473- return < strong > Net Pay</ strong > ;
478+ return < span style = { { fontWeight : 600 } } > Net Pay</ span > ;
474479 } }
475480 />
476481 < AggregateColumnDirective
477482 field = "Total"
478483 type = "Custom"
479484 customAggregate = { calculteNetPayInYear }
480485 footerTemplate = { ( props : any ) => {
481- return < strong > $ { props . Custom } </ strong > ;
486+ return < span style = { { fontWeight : 600 } } > $ { props . Custom } </ span > ;
482487 } }
483488 />
484489 { months . map ( ( x , index ) => {
485- return (
486- < AggregateColumnDirective
487- key = { index + 3 }
488- field = { x . field }
489- type = "Custom"
490- customAggregate = { calculteNetPayAggregate }
491- footerTemplate = { ( props : any ) => {
492- return < span > $ { props . Custom } </ span > ;
493- } }
494- />
495- ) ;
496- } ) }
490+ return (
491+ < AggregateColumnDirective
492+ key = { index + 3 }
493+ field = { x . field }
494+ type = "Custom"
495+ customAggregate = { calculteNetPayAggregate }
496+ footerTemplate = { ( props : any ) => {
497+ return < span style = { { fontWeight : 600 } } > $ { props . Custom } </ span > ;
498+ } }
499+ />
500+ ) ;
501+ } ) }
497502 </ AggregateColumnsDirective >
498503 </ AggregateDirective >
499504 </ AggregatesDirective >
0 commit comments