FIX: Saldo actual informe tesoreria
This commit is contained in:
@ -271,6 +271,7 @@ class Excel extends Ideal\Service
|
||||
'formatCode' => self::CURRENCY_CODE
|
||||
]
|
||||
]);
|
||||
$rowSaldoAnterior = $rowIndex;
|
||||
$rowIndex ++;
|
||||
|
||||
$styles = [
|
||||
@ -284,6 +285,9 @@ class Excel extends Ideal\Service
|
||||
'bold' => true
|
||||
]
|
||||
];
|
||||
$rowDap = null;
|
||||
$rowIngreso = null;
|
||||
$rowEgreso = null;
|
||||
foreach ($data['movimientos'] as $tipo => $movimientos) {
|
||||
if ($tipo === 'capital dap') {
|
||||
$sheet->getCell("B{$rowIndex}")->setValue('CAPITAL DAP');
|
||||
@ -291,6 +295,7 @@ class Excel extends Ideal\Service
|
||||
$sheet->getStyle("B{$rowIndex}:V{$rowIndex}")->applyFromArray($styles);
|
||||
$sheet->getCell("V{$rowIndex}")->getStyle()->getNumberFormat()->setFormatCode(self::CURRENCY_CODE);
|
||||
$totalRow = $rowIndex;
|
||||
$rowDap = $rowIndex;
|
||||
$rowIndex ++;
|
||||
if (count($movimientos['ingresos']) === 0 and count($movimientos['egresos']) === 0) {
|
||||
$sheet->getCell("V{$totalRow}")->setValue(0);
|
||||
@ -319,6 +324,11 @@ class Excel extends Ideal\Service
|
||||
$sheet->getCell("V{$rowIndex}")->getStyle()->getNumberFormat()
|
||||
->setFormatCode(self::CURRENCY_CODE);
|
||||
$totalRow = $rowIndex;
|
||||
if (!isset($rowIngreso) or $rowIngreso === null) {
|
||||
$rowIngreso = $rowIndex;
|
||||
} else {
|
||||
$rowEgreso = $rowIndex;
|
||||
}
|
||||
$rowIndex ++;
|
||||
if (count($movimientos) === 0) {
|
||||
$sheet->getCell("V{$totalRow}")->setValue(0);
|
||||
@ -363,7 +373,7 @@ class Excel extends Ideal\Service
|
||||
'formatCode' => PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DDMMYYYY
|
||||
]
|
||||
]);
|
||||
$sheet->getCell("V{$rowIndex}")->setValue(0)->getStyle()->applyFromArray([
|
||||
$sheet->getCell("V{$rowIndex}")->setValue("=V{$rowSaldoAnterior}+V{$rowDap}+V{$rowIngreso}+V{$rowEgreso}")->getStyle()->applyFromArray([
|
||||
'font' => [
|
||||
'bold' => true
|
||||
],
|
||||
|
Reference in New Issue
Block a user