Skip to content

Commit

Permalink
fix menor
Browse files Browse the repository at this point in the history
  • Loading branch information
estebandelaf committed Oct 18, 2019
1 parent 5b186d8 commit ff3a639
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/Sii/ConsumoFolio.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,9 @@ public function setCaratula(array $caratula)
public function generar()
{
// si ya se había generado se entrega directamente
if ($this->xml_data)
if ($this->xml_data) {
return $this->xml_data;
}
// generar XML del envío
$xmlEnvio = (new \sasco\LibreDTE\XML())->generate([
'ConsumoFolios' => [
Expand Down Expand Up @@ -125,8 +126,9 @@ public function getFechaEmisionInicial()
{
$fecha = '9999-12-31';
foreach ($this->detalles as &$d) {
if ($d['FchDoc'] < $fecha)
if ($d['FchDoc'] < $fecha) {
$fecha = $d['FchDoc'];
}
}
return $fecha;
}
Expand All @@ -141,8 +143,9 @@ public function getFechaEmisionFinal()
{
$fecha = '0000-01-01';
foreach ($this->detalles as &$d) {
if ($d['FchDoc'] > $fecha)
if ($d['FchDoc'] > $fecha) {
$fecha = $d['FchDoc'];
}
}
return $fecha;
}
Expand Down Expand Up @@ -191,7 +194,7 @@ private function getResumen()
if ($d['MntExe']) {
$Resumen[$d['TpoDoc']]['MntExento'] += $d['MntExe'];
}
$Resumen[$d['TpoDoc']]['MntTotal'] += $d['MntTotal'];
$Resumen[$d['TpoDoc']]['MntTotal'] += (int)$d['MntTotal'];
$Resumen[$d['TpoDoc']]['FoliosEmitidos']++;
// ir guardando folios emitidos para luego crear rangos
$RangoUtilizados[$d['TpoDoc']][] = $d['NroDoc'];
Expand Down

0 comments on commit ff3a639

Please sign in to comment.