Skip to content

Commit

Permalink
ajuste Make::class com indDeduzDeson chaveando quando deve ou não ser…
Browse files Browse the repository at this point in the history
… aplicada a desoneração vICMSDeson ao total vNF
  • Loading branch information
robmachado committed Apr 8, 2024
1 parent f472908 commit 2f3edbb
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/Make.php
Original file line number Diff line number Diff line change
Expand Up @@ -3423,7 +3423,9 @@ public function tagICMS(stdClass $std): DOMElement
}
break;
case '20':
$this->stdTot->vICMSDeson += (float) !empty($std->vICMSDeson) ? $std->vICMSDeson : 0;
if (!empty($std->indDeduzDeson)) {
$this->stdTot->vICMSDeson += (float)!empty($std->vICMSDeson) ? $std->vICMSDeson : 0;
}
$this->stdTot->vBC += (float) !empty($std->vBC) ? $std->vBC : 0;
$this->stdTot->vICMS += (float) !empty($std->vICMS) ? $std->vICMS : 0;
$this->stdTot->vFCP += (float) !empty($std->vFCP) ? $std->vFCP : 0;
Expand Down Expand Up @@ -3525,7 +3527,9 @@ public function tagICMS(stdClass $std): DOMElement
);
break;
case '30':
$this->stdTot->vICMSDeson += (float) !empty($std->vICMSDeson) ? $std->vICMSDeson : 0;
if (!empty($std->indDeduzDeson)) {
$this->stdTot->vICMSDeson += (float)!empty($std->vICMSDeson) ? $std->vICMSDeson : 0;
}
$this->stdTot->vBCST += (float) !empty($std->vBCST) ? $std->vBCST : 0;
$this->stdTot->vST += (float) !empty($std->vICMSST) ? $std->vICMSST : 0;
$this->stdTot->vFCPST += (float) !empty($std->vFCPST) ? $std->vFCPST : 0;
Expand Down Expand Up @@ -3636,7 +3640,9 @@ public function tagICMS(stdClass $std): DOMElement
case '40':
case '41':
case '50':
$this->stdTot->vICMSDeson += (float) !empty($std->vICMSDeson) ? $std->vICMSDeson : 0;
if (!empty($std->indDeduzDeson)) {
$this->stdTot->vICMSDeson += (float)!empty($std->vICMSDeson) ? $std->vICMSDeson : 0;
}
$icms = $this->dom->createElement("ICMS40");
$this->dom->addChild(
$icms,
Expand Down Expand Up @@ -4015,11 +4021,13 @@ public function tagICMS(stdClass $std): DOMElement
);
break;
case '70':
if (!empty($std->indDeduzDeson)) {
$this->stdTot->vICMSDeson += (float) !empty($std->vICMSDeson) ? $std->vICMSDeson : 0;
}
$this->stdTot->vBC += (float) !empty($std->vBC) ? $std->vBC : 0;
$this->stdTot->vICMS += (float) !empty($std->vICMS) ? $std->vICMS : 0;
$this->stdTot->vBCST += (float) !empty($std->vBCST) ? $std->vBCST : 0;
$this->stdTot->vST += (float) !empty($std->vICMSST) ? $std->vICMSST : 0;
$this->stdTot->vICMSDeson += (float) !empty($std->vICMSDeson) ? $std->vICMSDeson : 0;
$this->stdTot->vFCPST += (float) !empty($std->vFCPST) ? $std->vFCPST : 0;
$this->stdTot->vFCP += (float) !empty($std->vFCP) ? $std->vFCP : 0;

Expand Down Expand Up @@ -4198,6 +4206,9 @@ public function tagICMS(stdClass $std): DOMElement
);
break;
case '90':
if (!empty($std->indDeduzDeson)) {
$this->stdTot->vICMSDeson += (float) !empty($std->vICMSDeson) ? $std->vICMSDeson : 0;
}
$this->stdTot->vBC += (float) !empty($std->vBC) ? $std->vBC : 0;
$this->stdTot->vICMS += (float) !empty($std->vICMS) ? $std->vICMS : 0;
$this->stdTot->vBCST += (float) !empty($std->vBCST) ? $std->vBCST : 0;
Expand Down

0 comments on commit 2f3edbb

Please sign in to comment.