Informes anteriores y siguientes

This commit is contained in:
Juan Pablo Vial
2024-04-05 14:48:17 -03:00
parent 0502b8e735
commit 47d43f504d
3 changed files with 31 additions and 3 deletions

View File

@ -345,7 +345,12 @@ class Excel extends Ideal\Service
$rowIndex ++;
}
$end = $rowIndex;
$sheet->getCell("V{$totalRow}")->setValue("=SUM(C{$start}:D{$end})");
$sumFormula = match($tipo) {
'ingresos' => "=SUM(C{$start}:C{$end})",
'egresos' => "=SUM(D{$start}:D{$end})",
default => ''
};
$sheet->getCell("V{$totalRow}")->setValue($sumFormula);
$sheet->getStyle("C{$start}:D{$end}")->getNumberFormat()
->setFormatCode(self::CURRENCY_CODE);
}