diff --git a/Employee_Managment_App/src/components/EmployeePayRoll.tsx b/Employee_Managment_App/src/components/EmployeePayRoll.tsx index cd18b58..d5ed484 100644 --- a/Employee_Managment_App/src/components/EmployeePayRoll.tsx +++ b/Employee_Managment_App/src/components/EmployeePayRoll.tsx @@ -73,42 +73,42 @@ const EmployeePayRoll = (props: { employeeData: EmployeeDetails }) => { }, []); const itemTemplate = () => { - return ( -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Regular Hours Worked
OverTime Hours Worked
Bonus
Commission
Federal Income Tax
State Income Tax
Social Security Tax
MedicareTax
-
- ); - }; + return ( +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Regular Hours Worked
OverTime Hours Worked
Bonus
Commission
Federal Income Tax
State Income Tax
Social Security Tax
MedicareTax
+
+ ); +}; const totalTemplate = () => { return ( @@ -208,21 +208,26 @@ const EmployeePayRoll = (props: { employeeData: EmployeeDetails }) => { ]; const queryCellInfo = (args: QueryCellInfoEventArgs): void => { - if (args.column?.field === 'Total') { - for (let i: number = 0; i < elemClass.length; i++) { - const elem: HTMLElement = args.cell?.querySelector('.' + elemClass[i]) as HTMLElement; - let value: number = 0; - for (let j: number = 0; j < months.length; j++) { - if ((args.data as any)[months[j].field]) { - value += (args.data as any)[months[j].field][elemClass[i]] * (isPreviousYearRef.current ? 0.9 : 1); - } - } - if (elem) { - elem.innerText = '$ ' + value.toFixed(2); + if (args.column?.field === 'Total') { + // Compute totals into the Total column + for (let i = 0; i < elemClass.length; i++) { + const elem = args.cell?.querySelector('.' + elemClass[i]) as HTMLElement; + let value = 0; + for (let j = 0; j < months.length; j++) { + if ((args.data as any)[months[j].field]) { + value += (args.data as any)[months[j].field][elemClass[i]] * (isPreviousYearRef.current ? 0.9 : 1); } } + if (elem) { + elem.innerText = '$ ' + value.toFixed(2); + } } - }; + + // Make all Total column values medium (500) + const totalCells = args.cell?.querySelectorAll('.cardcell') ?? []; + totalCells.forEach((c) => ((c as HTMLElement).style.fontWeight = '500')); + } +}; const calculteGrossAggregate = (data: any, aggColumn: AggregateColumnModel): string => { const payStubData: MonthPayStub = @@ -412,7 +417,7 @@ const EmployeePayRoll = (props: { employeeData: EmployeeDetails }) => { type="Custom" customAggregate={calculteGrossInYear} footerTemplate={(props: any) => { - return $ {props.Custom}; + return $ {props.Custom}; }} /> {months.map((x, index) => { @@ -445,7 +450,7 @@ const EmployeePayRoll = (props: { employeeData: EmployeeDetails }) => { type="Custom" customAggregate={calculteDeductionInYear} footerTemplate={(props: any) => { - return $ {props.Custom}; + return $ {props.Custom}; }} /> {months.map((x, index) => { @@ -470,7 +475,7 @@ const EmployeePayRoll = (props: { employeeData: EmployeeDetails }) => { field="Item" type="Custom" footerTemplate={() => { - return Net Pay; + return Net Pay; }} /> { type="Custom" customAggregate={calculteNetPayInYear} footerTemplate={(props: any) => { - return $ {props.Custom}; + return $ {props.Custom}; }} /> {months.map((x, index) => { - return ( - { - return $ {props.Custom}; - }} - /> - ); - })} + return ( + { + return $ {props.Custom}; + }} + /> + ); + })} diff --git a/Employee_Managment_App/src/components/TopNav.css b/Employee_Managment_App/src/components/TopNav.css index 63459c2..20c9756 100644 --- a/Employee_Managment_App/src/components/TopNav.css +++ b/Employee_Managment_App/src/components/TopNav.css @@ -111,7 +111,6 @@ /* Input group container */ .search-field.input-group { - pointer-events: none; position: relative; display: flex; align-items: center;