Timesheet Job summaries

PaulT

Member
I have an Employee Timesheet form and a form plugin on it that totals all the amounts charged for each job for the week. That looks like this.

$fields = array('geh_time_sheet_18_repeat___job_amount_raw','geh_time_sheet_11_repeat___job_amount_raw','geh_time_sheet_12_repeat___job_amount_raw','geh_time_sheet_13_repeat___job_amount_raw','geh_time_sheet_14_repeat___job_amount_raw','geh_time_sheet_15_repeat___job_amount_raw','geh_time_sheet_16_repeat___job_amount_raw');
$total = 0;
foreach ($fields as $field)
{
$value = JArrayHelper::getValue($data, $field, array());
$thisSum = array_sum($value);
$total += $thisSum;
}

$formModel->updateFormData('geh_time_sheet___total_amount_week',$total);

I want to be able to list at the bottom of the form how much was charged for each job that week. Each job has a job code and the job may have an entry once or many times through that week on Monday group or Tuesday group etc. I am assuming I could make a Form PHP code plugin that can determine which jobs were mentioned in the Job Code field and list them and total the amount for each Job Code and retun that total next to that Job Code number.

Any tips on how I may achive this would be appreciated.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top