Merge branch 'staging' of https://dev.sismedika.online/febio/aso into staging
This commit is contained in:
@@ -284,6 +284,7 @@ class ClaimController extends Controller
|
|||||||
'Payor ID',
|
'Payor ID',
|
||||||
'Corporate name',
|
'Corporate name',
|
||||||
'Policy Number',
|
'Policy Number',
|
||||||
|
'Total Billing',
|
||||||
'Benefit Code',
|
'Benefit Code',
|
||||||
'Benefit Desc',
|
'Benefit Desc',
|
||||||
'Amt Incurred',
|
'Amt Incurred',
|
||||||
@@ -451,12 +452,15 @@ class ClaimController extends Controller
|
|||||||
{
|
{
|
||||||
$no += $item->no;
|
$no += $item->no;
|
||||||
}
|
}
|
||||||
|
$total_billing = 0;
|
||||||
|
$lastIndex = count($dataClaimLog) - 1;
|
||||||
if (isset($dataClaimLog) && count($dataClaimLog) > 0)
|
if (isset($dataClaimLog) && count($dataClaimLog) > 0)
|
||||||
{
|
{
|
||||||
foreach ($dataClaimLog as $item_benefit)
|
foreach ($dataClaimLog as $index => $item_benefit)
|
||||||
{
|
{
|
||||||
|
$total_billing += !empty($item_benefit->amount_approved) ? $item_benefit->amount_approved : 0;
|
||||||
$rowData = [
|
$rowData = [
|
||||||
$check_first_id != $item->id ? $no : '',
|
$check_first_id != $item->id ? $no : $no,
|
||||||
!empty($item->code) ? $item->code : '',
|
!empty($item->code) ? $item->code : '',
|
||||||
!empty($item->submission_date) ? $item->submission_date : '',
|
!empty($item->submission_date) ? $item->submission_date : '',
|
||||||
!empty($item->discharge_date) ? $item->discharge_date : '',
|
!empty($item->discharge_date) ? $item->discharge_date : '',
|
||||||
@@ -468,6 +472,7 @@ class ClaimController extends Controller
|
|||||||
'LinkSehat',
|
'LinkSehat',
|
||||||
!empty($dataMember->nama_perusahaan) ? $dataMember->nama_perusahaan : '',
|
!empty($dataMember->nama_perusahaan) ? $dataMember->nama_perusahaan : '',
|
||||||
!empty($dataMember->no_polis) ? $dataMember->no_polis : '',
|
!empty($dataMember->no_polis) ? $dataMember->no_polis : '',
|
||||||
|
($lastIndex == $index ? $total_billing : ''),
|
||||||
!empty($item_benefit->code) ? $item_benefit->code : '',
|
!empty($item_benefit->code) ? $item_benefit->code : '',
|
||||||
!empty($item_benefit->benfit) ? $item_benefit->benfit : '',
|
!empty($item_benefit->benfit) ? $item_benefit->benfit : '',
|
||||||
!empty($item_benefit->amount_incurred) ? $item_benefit->amount_incurred : '',
|
!empty($item_benefit->amount_incurred) ? $item_benefit->amount_incurred : '',
|
||||||
@@ -506,6 +511,9 @@ class ClaimController extends Controller
|
|||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
|
||||||
];
|
];
|
||||||
array_push($dataRow,$rowData);
|
array_push($dataRow,$rowData);
|
||||||
@@ -520,10 +528,51 @@ class ClaimController extends Controller
|
|||||||
->setCellAlignment(CellAlignment::LEFT)
|
->setCellAlignment(CellAlignment::LEFT)
|
||||||
// ->setBackgroundColor(Color::YELLOW)
|
// ->setBackgroundColor(Color::YELLOW)
|
||||||
->build();
|
->build();
|
||||||
|
$grand_total_billing = 0;
|
||||||
foreach ($dataRow as $rowData) {
|
foreach ($dataRow as $rowData) {
|
||||||
|
if (is_numeric($rowData[12])) {
|
||||||
|
// Jumlahkan nilai angka ke total
|
||||||
|
$grand_total_billing += $rowData[12];
|
||||||
|
}
|
||||||
$row = WriterEntityFactory::createRowFromArray($rowData, $style);
|
$row = WriterEntityFactory::createRowFromArray($rowData, $style);
|
||||||
$writer->addRow($row);
|
$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();
|
$writer->close();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user