From 41808c52c3e910a91d53087a5bb5aebff5d5d2cc Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 12 May 2011 19:30:01 +0000 Subject: [PATCH] Add total field to merge --- timesheet/inc/class.timesheet_merge.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/timesheet/inc/class.timesheet_merge.inc.php b/timesheet/inc/class.timesheet_merge.inc.php index 94a3dc93fb..cf3d53bf56 100644 --- a/timesheet/inc/class.timesheet_merge.inc.php +++ b/timesheet/inc/class.timesheet_merge.inc.php @@ -113,7 +113,8 @@ class timesheet_merge extends bo_merge importexport_export_csv::convert($record, $types, 'timesheet', $selects); $array = $record->get_record_array(); - foreach(array('ts_duration','ts_quantity','ts_unitprice') as $key) + $array['ts_total'] = $array['ts_quantity'] * $array['ts_unitprice']; + foreach(array('ts_duration','ts_quantity','ts_unitprice','ts_total') as $key) { $array[$key] = self::number_format($array[$key],2,$this->mimetype); } @@ -146,7 +147,7 @@ class timesheet_merge extends bo_merge echo '

'.lang('Timesheet fields:')."

"; $n = 0; - $fields = array('ts_id' => lang('Timesheet ID')) + $this->bo->field2label; + $fields = array('ts_id' => lang('Timesheet ID')) + $this->bo->field2label + array('ts_total' => lang('total')); foreach($fields as $name => $label) { if (in_array($name,array('pl_id','customfields'))) continue; // dont show them