Fixed display errors in reports of expenses
This commit is contained in:
parent
527efa9b29
commit
7d5864b347
8 changed files with 51 additions and 40 deletions
|
@ -7,11 +7,15 @@
|
|||
function theme_stormexpense_list($header, $expenses, $totals) {
|
||||
$rows = array();
|
||||
foreach ($expenses as $expense) {
|
||||
$expensedate = format_date($expense->expensedate, 'small');
|
||||
$expensedate = substr($expensedate, 0, strpos($expensedate, ' '));
|
||||
$rows[] = array(
|
||||
l($expense->organization_title, 'node/'. $expense->organization_nid),
|
||||
l($expense->project_title, 'node/'. $expense->project_nid),
|
||||
l($expense->title, 'node/'. $expense->nid),
|
||||
format_date($expense->expensedate, 'custom', 'Y-m-d'),
|
||||
'<span class="expense-title">' . l($expense->title, 'node/'. $expense->nid) . theme('mark', node_mark($expense->nid, $expense->changed)) . '</span><br />' .
|
||||
l($expense->organization_title, 'node/'. $expense->organization_nid) .
|
||||
(!empty($expense->project_title) ? ' » ' . l($expense->project_title, 'node/'. $expense->project_nid) : '' ) .
|
||||
(!empty($expense->task_title) ? '<br />' . l($expense->task_title, 'node/'. $expense->task_nid) . ' (' . t('task') . ')' : '' ) .
|
||||
(!empty($expense->ticket_title) ? '<br />' . l($expense->ticket_title, 'node/'. $expense->ticket_nid) . ' (' . t('ticket') . ')' : '' ),
|
||||
$expensedate,
|
||||
array('data' => sprintf('%.2f', $expense->total), 'align' => 'right'),
|
||||
array(
|
||||
'data' => storm_icon_edit_node($expense, $_GET) .' '. storm_icon_delete_node($expense, $_GET),
|
||||
|
@ -19,7 +23,7 @@ function theme_stormexpense_list($header, $expenses, $totals) {
|
|||
),
|
||||
);
|
||||
}
|
||||
$o = theme('table', $header, $rows);
|
||||
$o = theme('table', $header, $rows, array('id' => 'stormexpenses'));
|
||||
|
||||
$header = array(
|
||||
array(
|
||||
|
@ -253,11 +257,13 @@ function theme_stormexpense_list_report($report, $language, $expenses) {
|
|||
$expenses_total = 0;
|
||||
$rows = array();
|
||||
foreach ($expenses as $expense) {
|
||||
$expensedate = format_date($expense->expensedate, 'small');
|
||||
$expensedate = substr($expensedate, 0, strpos($expensedate, ' '));
|
||||
$rows[] = array(
|
||||
check_plain($expense->organization_title),
|
||||
check_plain($expense->project_title),
|
||||
check_plain($expense->title),
|
||||
format_date($expense->expensedate, 'custom', 'Y-m-d'),
|
||||
$expensedate,
|
||||
array('data' => sprintf('%.2f', $expense->total), 'align' => 'right'),
|
||||
);
|
||||
$expenses_total += $expense->total;
|
||||
|
@ -273,10 +279,12 @@ function theme_stormexpense_list_report($report, $language, $expenses) {
|
|||
t('Total', array(), $language));
|
||||
$expenses_total = 0;
|
||||
foreach ($expenses as $expense) {
|
||||
$expensedate = format_date($expense->expensedate, 'small');
|
||||
$expensedate = substr($expensedate, 0, strpos($expensedate, ' '));
|
||||
$rows[] = array(
|
||||
check_plain($expense->project_title),
|
||||
check_plain($expense->title),
|
||||
format_date($expense->expensedate, 'custom', 'Y-m-d'),
|
||||
$expensedate,
|
||||
array('data' => sprintf('%.2f', $expense->total), 'align' => 'right'),
|
||||
);
|
||||
$expenses_total += $expense->total;
|
||||
|
@ -287,18 +295,20 @@ function theme_stormexpense_list_report($report, $language, $expenses) {
|
|||
case 'for_organization_w_task':
|
||||
$organization = node_load($_SESSION['stormexpense_list_filter']['organization_nid']);
|
||||
$header = array(
|
||||
t('Project', 'expense', array(), $language),
|
||||
t('Task', 'expense', array(), $language),
|
||||
t('Title', 'expense', array(), $language),
|
||||
t('Date', 'expense', array(), $language),
|
||||
t('Total', 'expense', array(), $language));
|
||||
t('Project', array(), $language),
|
||||
t('Task', array(), $language),
|
||||
t('Title', array(), $language),
|
||||
t('Date', array(), $language),
|
||||
t('Total', array(), $language));
|
||||
$total_duration = 0;
|
||||
foreach ($expenses as $expense) {
|
||||
$expensedate = format_date($expense->expensedate, 'small');
|
||||
$expensedate = substr($expensedate, 0, strpos($expensedate, ' '));
|
||||
$rows[] = array(
|
||||
check_plain($expense->project_title),
|
||||
check_plain($expense->task_title),
|
||||
check_plain($expense->title),
|
||||
format_date($expense->expensedate, 'custom', 'Y-m-d'),
|
||||
$expensedate,
|
||||
array('data' => sprintf('%.2f', $expense->total), 'align' => 'right'),
|
||||
);
|
||||
$expenses_total += $expense->total;
|
||||
|
@ -311,16 +321,18 @@ function theme_stormexpense_list_report($report, $language, $expenses) {
|
|||
$project = node_load($_SESSION['stormexpense_list_filter']['project_nid']);
|
||||
|
||||
$header = array(
|
||||
t('Task', 'expense', array(), $language),
|
||||
t('Title', 'expense', array(), $language),
|
||||
t('Date', 'expense', array(), $language),
|
||||
t('Total', 'expense', array(), $language));
|
||||
t('Task', array(), $language),
|
||||
t('Title', array(), $language),
|
||||
t('Date', array(), $language),
|
||||
t('Total', array(), $language));
|
||||
$total_duration = 0;
|
||||
foreach ($expenses as $expense) {
|
||||
$expensedate = format_date($expense->expensedate, 'small');
|
||||
$expensedate = substr($expensedate, 0, strpos($expensedate, ' '));
|
||||
$rows[] = array(
|
||||
check_plain($expense->task_title),
|
||||
check_plain($expense->title),
|
||||
format_date($expense->expensedate, 'custom', 'Y-m-d'),
|
||||
$expensedate,
|
||||
array('data' => sprintf('%.2f', $expense->total), 'align' => 'right'),
|
||||
);
|
||||
$expenses_total += $expense->total;
|
||||
|
|
Reference in a new issue