Skip to content

Commit bfb87c5

Browse files
committed
Fix #8826 - Fix totals in Report PDF
Restyle total to work with pdf
1 parent dfd76fc commit bfb87c5

File tree

7 files changed

+24
-27
lines changed

7 files changed

+24
-27
lines changed

modules/AOR_Reports/AOR_Report.php

+2-25
Original file line numberDiff line numberDiff line change
@@ -955,43 +955,21 @@ public function getTotalHTML($fields, $totals)
955955
$currency->retrieve($GLOBALS['current_user']->getPreference('currency'));
956956

957957
$showTotal = false;
958-
$html = "<thead class='fc-head'>";
959-
$html .= "<tr>";
960958
foreach ($fields as $label => $field) {
961959
if (!$field['display']) {
962960
continue;
963961
}
964962

965-
$fieldTotal = null;
966-
if (!isset($field['total'])) {
967-
LoggerManager::getLogger()->warn('AOR_Report problem: field[total] is not set for getTotalHTML()');
968-
} else {
969-
$fieldTotal = $field['total'];
970-
}
971-
972-
$appListStringsAorTotalOptionsFieldTotal = null;
973-
if (!isset($app_list_strings['aor_total_options'][$fieldTotal])) {
974-
LoggerManager::getLogger()->warn('AOR_Report problem: app_list_strings[aor_total_options][fieldTotal] is not set for getTotalHTML()');
975-
} else {
976-
$appListStringsAorTotalOptionsFieldTotal = $app_list_strings['aor_total_options'][$fieldTotal];
977-
}
978-
979-
980-
if ($fieldTotal) {
963+
if (!empty($field['total'])) {
981964
$showTotal = true;
982-
$totalLabel = $field['label'] . ' ' . $appListStringsAorTotalOptionsFieldTotal;
983-
$html .= "<th>{$totalLabel}</th>";
984-
} else {
985-
$html .= '<th></th>';
986965
}
987966
}
988-
$html .= '</tr></thead>';
989967

990968
if (!$showTotal) {
991969
return '';
992970
}
993971

994-
$html .= "<tbody><tr class='oddListRowS1'>";
972+
$html = "<tr class='totalReportRow oddListRowS1'>";
995973
foreach ($fields as $label => $field) {
996974
if (!$field['display']) {
997975
continue;
@@ -1023,7 +1001,6 @@ public function getTotalHTML($fields, $totals)
10231001
}
10241002
}
10251003
$html .= '</tr>';
1026-
$html .= '</tbody>';
10271004

10281005
return $html;
10291006
}

modules/AOR_Reports/controller.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,12 @@ protected function action_downloadPDF()
256256
try {
257257
$pdf = new mPDF('en', 'A4', '', 'DejaVuSansCondensed');
258258
$pdf->SetAutoFont();
259+
$pdf->setFooter('{PAGENO}');
259260
$pdf->WriteHTML($stylesheet, 1);
260261
$pdf->SetDefaultBodyCSS('background-color', '#FFFFFF');
261262
unset($pdf->cssmgr->CSS['INPUT']['FONT-SIZE']);
262263
$pdf->WriteHTML($head, 2);
263264
$pdf->WriteHTML($printable, 3);
264-
$pdf->setFooter('{PAGENO}');
265265
$pdf->Output($this->bean->name . '.pdf', "D");
266266
} catch (mPDF_exception $e) {
267267
echo $e;

themes/SuiteP/css/Dawn/variables.scss

+1
Original file line numberDiff line numberDiff line change
@@ -1249,6 +1249,7 @@ $scheduler-busy-color: $color-70;
12491249

12501250
// AOR
12511251
$aor-droparea: $color-75;
1252+
$aor-total: $main-bg;
12521253

12531254
// Line Items
12541255
$line-item-group-width: 100%;

themes/SuiteP/css/Day/variables.scss

+1
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,7 @@ $scheduler-busy-color: $color-70;
12481248

12491249
// AOR
12501250
$aor-droparea: $color-75;
1251+
$aor-total: $main-bg;
12511252

12521253
// Line Items
12531254
$line-item-group-width: 100%;

themes/SuiteP/css/Dusk/variables.scss

+1
Original file line numberDiff line numberDiff line change
@@ -1253,6 +1253,7 @@ $scheduler-busy-color: $color-70;
12531253

12541254
// AOR
12551255
$aor-droparea: $color-75;
1256+
$aor-total: $main-bg;
12561257

12571258
// Line Items
12581259
$line-item-group-width: 100%;

themes/SuiteP/css/Night/variables.scss

+1
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,7 @@ $scheduler-busy-color: $color-70;
12481248

12491249
// AOR
12501250
$aor-droparea: $color-75;
1251+
$aor-total: $color-54;
12511252

12521253
// Line Items
12531254
$line-item-group-width: 100%;

themes/SuiteP/css/suitep-base/aor.scss

+17-1
Original file line numberDiff line numberDiff line change
@@ -254,4 +254,20 @@
254254
.list-view-rounded-corners > table th:last-of-type {
255255
border-top-right-radius: 0;
256256
}
257-
}
257+
258+
.table-responsive {
259+
border-collapse: collapse;
260+
}
261+
262+
.totalReportRow {
263+
border-top: 1px solid $list-view-header-bg;
264+
border-bottom: 1px solid $list-view-header-bg;
265+
}
266+
267+
.totalReportRow td {
268+
padding: 5px 5px;
269+
font-size: 13px;
270+
font-weight: bold;
271+
background-color: $aor-total;
272+
}
273+
}

0 commit comments

Comments
 (0)