Skip to content

Commit

Permalink
Ajustes na formatação do valor
Browse files Browse the repository at this point in the history
  • Loading branch information
gersonfs committed May 31, 2024
1 parent 833a8f3 commit a29c12a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ public function sefazCCe(
string $xCorrecao,
int $nSeqEvento = 1,
?\DateTimeInterface $dhEvento = null,
?int $lote = null
?string $lote = null
): string {
if (empty($chave) || empty($xCorrecao)) {
throw new InvalidArgumentException('CC-e: chave ou motivo da correcao vazio!');
Expand Down Expand Up @@ -986,7 +986,7 @@ public function sefazEvento(
int $nSeqEvento = 1,
string $tagAdic = '',
?\DateTimeInterface $dhEvento = null,
?int $lote = null
?string $lote = null
): string {
$eventos = [
self::EVT_CCE => ['versao' => '1.00', 'nome' => 'envCCe'],
Expand Down Expand Up @@ -1021,8 +1021,9 @@ public function sefazEvento(
$cnpj = $this->config->cnpj ?? '';
$dt = new \DateTime(date("Y-m-d H:i:sP"), new \DateTimeZone($this->timezone));
$dt->setTimezone(new \DateTimeZone($this->timezone));
if ($dhEvento == null) {
$dhEvento = $dt->format('Y-m-d\TH:i:sP');
$dhEventoString = $dt->format('Y-m-d\TH:i:sP');
if ($dhEvento != null) {
$dhEventoString = $dhEvento->format('Y-m-d\TH:i:sP');

Check warning on line 1026 in src/Tools.php

View check run for this annotation

Codecov / codecov/patch

src/Tools.php#L1024-L1026

Added lines #L1024 - L1026 were not covered by tests
}
$sSeqEvento = str_pad((string)$nSeqEvento, 2, "0", STR_PAD_LEFT);
$eventId = "ID" . $tpEvento . $chave . $sSeqEvento;
Expand All @@ -1037,7 +1038,7 @@ public function sefazEvento(
$request .= "<CPF>$cnpj</CPF>";
}
$request .= "<chNFe>$chave</chNFe>"
. "<dhEvento>$dhEvento</dhEvento>"
. "<dhEvento>$dhEventoString</dhEvento>"

Check warning on line 1041 in src/Tools.php

View check run for this annotation

Codecov / codecov/patch

src/Tools.php#L1041

Added line #L1041 was not covered by tests
. "<tpEvento>$tpEvento</tpEvento>"
. "<nSeqEvento>$nSeqEvento</nSeqEvento>"
. "<verEvento>$verEvento</verEvento>"
Expand Down

0 comments on commit a29c12a

Please sign in to comment.