diff --git a/modules/storm/storminvoice/storminvoice.theme.inc b/modules/storm/storminvoice/storminvoice.theme.inc index 896ee03..40349e6 100644 --- a/modules/storm/storminvoice/storminvoice.theme.inc +++ b/modules/storm/storminvoice/storminvoice.theme.inc @@ -859,22 +859,23 @@ function theme_storminvoice_report_html($node, $language) { 'style' => 'text-align: right;', ), ); + $rows_keys = array_keys($rows); if ($node->tax1) { - $rows[end(array_keys($rows))][] = array( + $rows[end($rows_keys)][] = array( 'data' => sprintf('%.2f', $i->tax1), 'style' => 'text-align: right;', ); } if ($node->tax2) { - $rows[end(array_keys($rows))][] = array( + $rows[end($rows_keys)][] = array( 'data' => sprintf('%.2f', $i->tax2), 'style' => 'text-align: right;', ); } - $rows[end(array_keys($rows))][] = array( - 'data' => sprintf('%.2f', $i->total), - 'style' => 'text-align: right;', - ); + $rows[end($rows_keys)][] = array( + 'data' => sprintf('%.2f', $i->total), + 'style' => 'text-align: right;', + ); } $total = t('Total', array(), $language); @@ -890,23 +891,23 @@ function theme_storminvoice_report_html($node, $language) { 'style' => 'text-align: right;', ), ); - + $rows_keys = array_keys($rows); if ($node->tax1) { - $rows[end(array_keys($rows))][] = array( + $rows[end($rows_keys)][] = array( 'data' => sprintf('%.2f', $node->tax1), 'style' => 'text-align: right;', ); } if ($node->tax2) { - $rows[end(array_keys($rows))][] = array( + $rows[end($rows_keys)][] = array( 'data' => sprintf('%.2f', $node->tax2), 'style' => 'text-align: right;', ); } - $rows[end(array_keys($rows))][] = array( - 'data' => sprintf('%.2f', $node->total), - 'style' => 'text-align: right;', - ); + $rows[end($rows_keys)][] = array( + 'data' => sprintf('%.2f', $node->total), + 'style' => 'text-align: right;', + ); $o .= '
'. theme('table', $header, $rows) .'
';