Update
This commit is contained in:
@@ -528,10 +528,51 @@ class ClaimController extends Controller
|
||||
->setCellAlignment(CellAlignment::LEFT)
|
||||
// ->setBackgroundColor(Color::YELLOW)
|
||||
->build();
|
||||
$grand_total_billing = 0;
|
||||
foreach ($dataRow as $rowData) {
|
||||
if (is_numeric($rowData[12])) {
|
||||
// Jumlahkan nilai angka ke total
|
||||
$grand_total_billing += $rowData[12];
|
||||
}
|
||||
$row = WriterEntityFactory::createRowFromArray($rowData, $style);
|
||||
$writer->addRow($row);
|
||||
}
|
||||
//Footer
|
||||
$footer = [
|
||||
'Total',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
$grand_total_billing,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
''
|
||||
];
|
||||
$style = (new StyleBuilder())
|
||||
->setFontBold()
|
||||
// ->setFontSize(15)
|
||||
// ->setFontColor(Color::BLUE)
|
||||
// ->setShouldWrapText()
|
||||
->setCellAlignment(CellAlignment::LEFT)
|
||||
// ->setBackgroundColor(Color::YELLOW)
|
||||
->build();
|
||||
|
||||
$footerRow = WriterEntityFactory::createRowFromArray($footer, $style);
|
||||
$writer->addRow($footerRow);
|
||||
}
|
||||
$writer->close();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user