Skip to content

Commit

Permalink
Versão 1.0.1 bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederico Gendorf committed May 10, 2018
1 parent e63e7f0 commit 821fb3f
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions code/REPRegistros.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public function coletaRegistrosPonto() {
* @return array
*/
public function getInclusaoAlteracaoEmpresa($registros) {
$y = 0;
for ($x = 0; sizeof($registros) > $x; ++$x) {
if (substr($registros[$x], 9, 1) == 2) {
++$y;
$regarray[$y]["NSR"] = substr($registros[$x], 0, 9);
$regarray[$y]["tipo"] = substr($registros[$x], 9, 1);
$regarray[$y]["data"] = substr($registros[$x], 10, 8);
Expand All @@ -58,6 +58,7 @@ public function getInclusaoAlteracaoEmpresa($registros) {
$regarray[$y]["cei"] = substr($registros[$x], 37, 12);
$regarray[$y]["razaosocial"] = substr($registros[$x], 49, 150);
$regarray[$y]["local"] = substr($registros[$x], 199, 100);
++$y;
}
}
return $regarray;
Expand All @@ -70,14 +71,15 @@ public function getInclusaoAlteracaoEmpresa($registros) {
* @return array
*/
public function getMarcacaoPonto($registros) {
$y = 0;
for ($x = 0; sizeof($registros) > $x; ++$x) {
if (substr($registros[$x], 9, 1) == 3) {
++$y;
$regarray[$y]["NSR"] = substr($registros[$x], 0, 9);
$regarray[$y]["tipo"] = substr($registros[$x], 9, 1);
$date = DateTime::createFromFormat("dmYHi", substr($registros[$x], 10, 8) . substr($registros[$x], 18, 4));
$regarray[$y]["datahorario"] = $date->format("Y-m-d H:i:s");
$regarray[$y]["pis"] = substr($registros[$x], 22, 12);
++$y;
}
}
return $regarray;
Expand All @@ -90,14 +92,15 @@ public function getMarcacaoPonto($registros) {
* @return array
*/
public function getMarcacaoPontoMatricula($registros) {
$y = 0;
for ($x = 0; sizeof($registros) > $x; ++$x) {
if (substr($registros[$x], 9, 1) == 7) {
++$y;
$regarray[$y]["NSR"] = substr($registros[$x], 0, 9);
$regarray[$y]["tipo"] = substr($registros[$x], 9, 1);
$date = DateTime::createFromFormat("dmYHi", substr($registros[$x], 10, 8) . substr($registros[$x], 18, 4));
$regarray[$y]["datahorario"] = $date->format("Y-m-d H:i:s");
$regarray[$y]["matricula"] = substr($registros[$x], -6);
++$y;
}
}
return $regarray;
Expand All @@ -110,15 +113,16 @@ public function getMarcacaoPontoMatricula($registros) {
* @return array
*/
public function getAjusteRelogio($registros) {
$y = 0;
for ($x = 0; sizeof($registros) > $x; ++$x) {
if (substr($registros[$x], 9, 1) == 4) {
++$y;
$regarray[$y]["NSR"] = substr($registros[$x], 0, 9);
$regarray[$y]["tipo"] = substr($registros[$x], 9, 1);
$regarray[$y]["dataantes"] = substr($registros[$x], 10, 8);
$regarray[$y]["horarioantes"] = substr($registros[$x], 18, 4);
$regarray[$y]["dataajustada"] = substr($registros[$x], 22, 8);
$regarray[$y]["horaajustada"] = substr($registros[$x], 30, 4);
++$y;
}
}
return $regarray;
Expand All @@ -132,15 +136,16 @@ public function getAjusteRelogio($registros) {
* @return array
*/
public function getInclusaoAlteracaoEmpregado($registros) {
$y = 0;
for ($x = 0; sizeof($registros) > $x; ++$x) {
if (substr($registros[$x], 9, 1) == 5) {
++$y;
$regarray[$y]["NSR"] = substr($registros[$x], 0, 9);
$regarray[$y]["tipo"] = substr($registros[$x], 9, 1);
$regarray[$y]["data"] = substr($registros[$x], 10, 12);
$regarray[$y]["acao"] = substr($registros[$x], 22, 1);
$regarray[$y]["pis"] = substr($registros[$x], 23, 12);
$regarray[$y]["colaborador"] = substr($registros[$x], 35, 52);
++$y;
}
}
return $regarray;
Expand Down

0 comments on commit 821fb3f

Please sign in to comment.