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