Merge remote-tracking branch 'origin/staging' into origin/production

This commit is contained in:
Linksehat Staging Server
2024-01-24 10:30:46 +07:00

View File

@@ -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();