diff --git a/src/js/components/tooltip/tooltip.js b/src/js/components/tooltip/tooltip.js index aeb6fc1..25cc457 100644 --- a/src/js/components/tooltip/tooltip.js +++ b/src/js/components/tooltip/tooltip.js @@ -61,6 +61,15 @@ function showFinalPersonnelCost(event){ editTooltipText(message); } +function showFICA(event){ + const row = event.target.parentElement; + const fica = parseFloat(Cell.getText(row, 'fica')); + const ficaPercentage = (fica * 100).toFixed(2); + const message = `This total is overtime wages plus overtime salary plus FICA, + which is ${ficaPercentage}% for this cost center.` + editTooltipText(message); +} + export const Tooltip = { hide : hideTooltip, @@ -114,10 +123,22 @@ export const Tooltip = { }) }, - linkAll : function() { + linkTotalNPCol : function() { + // get all relevant cells + document.querySelectorAll('.total').forEach( (cell) => { + this.link(cell, showFICA); + }) + }, + + linkAllPersonnel : function() { this.linkAccountStringCol(); this.linkSalaryCol(); this.linkTotalPersonnelCostCol(); + }, + + linkAllOvertime : function() { + // this.linkAccountStringCol(); + this.linkTotalNPCol(); } } diff --git a/src/js/views/04_personnel/helpers.js b/src/js/views/04_personnel/helpers.js index 7a33faf..5dc5a59 100644 --- a/src/js/views/04_personnel/helpers.js +++ b/src/js/views/04_personnel/helpers.js @@ -70,11 +70,11 @@ export async function initializePersonnelTable(){ // activate edit buttons Table.Buttons.Edit.init(personnelRowOnEdit, updateDisplayandTotals); initializeRowAddition(); + // Link up tooltips to display more info on hover + Tooltip.linkAllPersonnel(); } else { Prompt.Text.update('No personnel expenditures for this fund.') } - // Link up tooltips to display more info on hover - Tooltip.linkAll(); } function initializeRowAddition(){ diff --git a/src/js/views/05_overtime/helpers.js b/src/js/views/05_overtime/helpers.js index 37869da..70b8082 100644 --- a/src/js/views/05_overtime/helpers.js +++ b/src/js/views/05_overtime/helpers.js @@ -6,6 +6,7 @@ import Subtitle from '../../components/header/header.js'; import Sidebar from '../../components/sidebar/sidebar.js'; import Table from '../../components/table/table.js'; import { Services } from '../../utils/data_utils/budget_data_handlers.js'; +import Tooltip from '../../components/tooltip/tooltip.js'; export function preparePageView(){ // prepare page view @@ -28,8 +29,9 @@ export function preparePageView(){ function assignClasses() { // record columns and their classes const OT_cols = [ - { title: 'Account String', className: 'string' }, - { title: `Cost Center Name`, className: 'cc' }, + // { title: 'Account String', className: 'account-string' }, + { title: `Cost Center Name`, className: 'cc-name' }, + { title: 'Appropriation Name', className: 'approp-name'}, { title: 'Service', className: 'service' }, { title: 'Recurring or One-Time', className: 'recurring'}, { title: 'Hourly Employee Overtime (Wages)', className: 'OT-wages', isCost: true }, @@ -37,7 +39,7 @@ function assignClasses() { { title: 'Total Cost (including benefits)', className : 'total', isCost: true}, { title: 'Edit', className: 'edit'}, // calc columns - { title: 'FICA Rate', className: 'fica', hide: true} + { title: 'FICA Rate', className: 'fica', hide: true}, ]; // assign cost classes @@ -61,6 +63,8 @@ export async function initializeOTTable(){ updateDisplayandTotals(); // activate edit buttons Table.Buttons.Edit.init(OTRowOnEdit, updateDisplayandTotals); + // wire up tooltips to show info on click + Tooltip.linkAllOvertime(); } else { Prompt.Text.update('No overtime expenditures for this fund.') } diff --git a/src/js/views/06_nonpersonnel/helpers.js b/src/js/views/06_nonpersonnel/helpers.js index bd5c26c..cf2da78 100644 --- a/src/js/views/06_nonpersonnel/helpers.js +++ b/src/js/views/06_nonpersonnel/helpers.js @@ -7,14 +7,19 @@ import Subtitle from "../../components/header/header.js"; const nonPersonnelColumns = [ { title: 'FY26 Request', className: 'request', isCost: true }, - { title: 'Amount Remaining on Contract', className: 'remaining', isCost: true }, { title: 'Service', className : 'service' }, { title: 'Edit', className : 'edit' }, { title : 'Account String', className : 'account-string'}, - { title : 'CPA #', className : 'cpa'}, - { title : 'Contract End Date', className : 'contract-end'}, { title: 'Recurring or One-Time', className: 'recurring'}, - { title: 'Object Category', className: 'object'} + + { title : 'CPA #', className : 'cpa'}, + { title : 'Contract End Date', className : 'contract-end', hide:true}, + { title: 'Amount Remaining on Contract', className: 'remaining', isCost: true , hide: true}, + + // hidden columns used for calcs and info boxes + { title: 'Object Name', className: 'object-name', hide: true}, + { title: 'Vendor Name', className: 'vendor', hide: true}, + { title: 'Object Category', className: 'object-category', hide: true} ]; export function preparePageView(){