Skip to content

Commit

Permalink
Merge pull request #1074 from nagahshi/patch-3
Browse files Browse the repository at this point in the history
Update Make.php
  • Loading branch information
robmachado authored Sep 12, 2024
2 parents bd9aae6 + 7a9ac05 commit 18ab87b
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/Make.php
Original file line number Diff line number Diff line change
Expand Up @@ -1857,8 +1857,17 @@ public function tagprod(stdClass $std): DOMElement
$this->errors[] = "cEANTrib {$ceantrib} " . $e->getMessage();
}
}
$CRT = $this->emit->getElementsByTagName("CRT")->item(0)->nodeValue ?? null;
$idDest = $this->ide->getElementsByTagName("idDest")->item(0)->nodeValue ?? null;

$CRT = null;
if (!empty($this->emit->getElementsByTagName("CRT")->item(0))) {
$CRT = (int) $this->emit->getElementsByTagName("CRT")->item(0)->nodeValue;
}

$idDest = null;
if (!empty($this->ide->getElementsByTagName("idDest")->item(0))) {
$idDest = (int) $this->ide->getElementsByTagName("idDest")->item(0)->nodeValue;
}

$allowEmptyNcm = $CRT == 4 && $idDest == 1;

if ($allowEmptyNcm && empty($std->NCM)) {
Expand Down Expand Up @@ -4770,7 +4779,11 @@ public function tagICMSSN(stdClass $std): DOMElement
$this->stdTot->vFCPST += (float) !empty($std->vFCPST) ? $std->vFCPST : 0;
$this->stdTot->vFCPSTRet += (float) !empty($std->vFCPSTRet) ? $std->vFCPSTRet : 0;

$CRT = $this->emit->getElementsByTagName("CRT")->item(0)->nodeValue ?? null;
$CRT = null;
if (!empty($this->emit->getElementsByTagName("CRT")->item(0))) {
$CRT = (int) $this->emit->getElementsByTagName("CRT")->item(0)->nodeValue;
}

$allowEmptyOrig = $CRT == 4 && in_array($std->CSOSN, [
'102', '103', '300', '400', '900',
]);
Expand Down

0 comments on commit 18ab87b

Please sign in to comment.