Skip to content

Commit bfcec6b

Browse files
authored
Merge pull request #1331 from robmachado/master
Novo pacote de schemas PL_010C
2 parents ddbbae2 + bce959b commit bfcec6b

8 files changed

Lines changed: 3160 additions & 83 deletions

File tree

examples/nfe_v4.00_PL_010B.xml

Lines changed: 1487 additions & 0 deletions
Large diffs are not rendered by default.

examples/nfe_v4.00_PL_010C.xml

Lines changed: 1496 additions & 0 deletions
Large diffs are not rendered by default.

schemes/PL_010_V1.30/leiauteNFe_v4.00.xsd

Lines changed: 101 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,13 @@ Campo preenchido somente quando “indPres = 5 (Operação presencial, fora do e
209209
</xs:element>
210210
<xs:element name="tpNFDebito" type="TTpNFDebito" minOccurs="0">
211211
<xs:annotation>
212-
<xs:documentation>Tipo de Nota de Débito</xs:documentation>
212+
<xs:documentation>Tipo de Nota de Débito:
213+
01=Transferência de créditos para Cooperativas;
214+
02=Anulação de Crédito por Saídas Imunes/Isentas;
215+
03=Débitos de notas fiscais não processadas na apuração;
216+
04=Multa e juros;
217+
05=Transferência de crédito de sucessão.
218+
</xs:documentation>
213219
</xs:annotation>
214220
</xs:element>
215221
<xs:element name="tpNFCredito" type="TTpNFCredito" minOccurs="0">
@@ -501,7 +507,7 @@ Preencher com &quot;2B&quot;, quando se tratar de Cupom Fiscal emitido por máqu
501507
</xs:annotation>
502508
<xs:complexType>
503509
<xs:sequence>
504-
<xs:element name="refNFe" type="TChNFe" minOccurs="1" maxOccurs="99">
510+
<xs:element name="refNFe" type="TChNFe" maxOccurs="99">
505511
<xs:annotation>
506512
<xs:documentation>Chave de acesso da NF-e de antecipação de pagamento</xs:documentation>
507513
</xs:annotation>
@@ -2555,13 +2561,15 @@ ambiente.</xs:documentation>
25552561
</xs:element>
25562562
<xs:element name="motDesICMS">
25572563
<xs:annotation>
2558-
<xs:documentation>Motivo da desoneração do ICMS:3-Uso na agropecuária;9-Outros;12-Fomento agropecuário</xs:documentation>
2564+
<xs:documentation>Motivo da desoneração do ICMS:3-Uso na agropecuária;9-Outros; 10=Deficiente Condutor (Convênio ICMS 38/12); 11=Deficiente Não Condutor (Convênio ICMS 38/12); 12-Fomento agropecuário</xs:documentation>
25592565
</xs:annotation>
25602566
<xs:simpleType>
25612567
<xs:restriction base="xs:string">
25622568
<xs:whiteSpace value="preserve"/>
25632569
<xs:enumeration value="3"/>
25642570
<xs:enumeration value="9"/>
2571+
<xs:enumeration value="10"/>
2572+
<xs:enumeration value="11"/>
25652573
<xs:enumeration value="12"/>
25662574
</xs:restriction>
25672575
</xs:simpleType>
@@ -3395,11 +3403,39 @@ Informar o motivo da desoneração:
33953403
<xs:documentation>Percentual de redução da BC</xs:documentation>
33963404
</xs:annotation>
33973405
</xs:element>
3406+
<xs:element name="cBenefRBC" minOccurs="0">
3407+
<xs:annotation>
3408+
<xs:documentation>Código de Benefício Fiscal na UF aplicado ao item quando houver RBC.</xs:documentation>
3409+
</xs:annotation>
3410+
<xs:simpleType>
3411+
<xs:restriction base="xs:string">
3412+
<xs:whiteSpace value="preserve"/>
3413+
<xs:pattern value="[!-ÿ]{8}|[!-ÿ]{10}"/>
3414+
</xs:restriction>
3415+
</xs:simpleType>
3416+
</xs:element>
33983417
<xs:element name="pICMS" type="TDec_0302a04">
33993418
<xs:annotation>
34003419
<xs:documentation>Alíquota do ICMS</xs:documentation>
34013420
</xs:annotation>
34023421
</xs:element>
3422+
<xs:sequence minOccurs="0">
3423+
<xs:element name="vICMSOp" type="TDec_1302">
3424+
<xs:annotation>
3425+
<xs:documentation>Valor do ICMS da Operação</xs:documentation>
3426+
</xs:annotation>
3427+
</xs:element>
3428+
<xs:element name="pDif" type="TDec_0302a04Max100">
3429+
<xs:annotation>
3430+
<xs:documentation>Percentual do diferemento</xs:documentation>
3431+
</xs:annotation>
3432+
</xs:element>
3433+
<xs:element name="vICMSDif" type="TDec_1302">
3434+
<xs:annotation>
3435+
<xs:documentation>Valor do ICMS da diferido</xs:documentation>
3436+
</xs:annotation>
3437+
</xs:element>
3438+
</xs:sequence>
34033439
<xs:element name="vICMS" type="TDec_1302">
34043440
<xs:annotation>
34053441
<xs:documentation>Valor do ICMS</xs:documentation>
@@ -3422,6 +3458,23 @@ Informar o motivo da desoneração:
34223458
</xs:annotation>
34233459
</xs:element>
34243460
</xs:sequence>
3461+
<xs:sequence minOccurs="0">
3462+
<xs:element name="pFCPDif" type="TDec_0302a04Opc">
3463+
<xs:annotation>
3464+
<xs:documentation>Percentual do diferimento do ICMS relativo ao Fundo de Combate à Pobreza (FCP).</xs:documentation>
3465+
</xs:annotation>
3466+
</xs:element>
3467+
<xs:element name="vFCPDif" type="TDec_1302">
3468+
<xs:annotation>
3469+
<xs:documentation>Valor do ICMS relativo ao Fundo de Combate à Pobreza (FCP) diferido.</xs:documentation>
3470+
</xs:annotation>
3471+
</xs:element>
3472+
<xs:element name="vFCPEfet" type="TDec_1302" minOccurs="0">
3473+
<xs:annotation>
3474+
<xs:documentation>Valor efetivo do ICMS relativo ao Fundo de Combate à Pobreza (FCP).</xs:documentation>
3475+
</xs:annotation>
3476+
</xs:element>
3477+
</xs:sequence>
34253478
</xs:sequence>
34263479
<xs:sequence minOccurs="0">
34273480
<xs:element name="modBCST">
@@ -3569,12 +3622,14 @@ Operação interestadual para consumidor final com partilha do ICMS devido na o
35693622
<xs:annotation>
35703623
<xs:documentation>Tributação pelo ICMS
35713624
10 - Tributada e com cobrança do ICMS por substituição tributária;
3625+
20 – Redução de base de cálculo
35723626
90 – Outros.</xs:documentation>
35733627
</xs:annotation>
35743628
<xs:simpleType>
35753629
<xs:restriction base="xs:string">
35763630
<xs:whiteSpace value="preserve"/>
35773631
<xs:enumeration value="10"/>
3632+
<xs:enumeration value="20"/>
35783633
<xs:enumeration value="90"/>
35793634
</xs:restriction>
35803635
</xs:simpleType>
@@ -3693,6 +3748,43 @@ Operação interestadual para consumidor final com partilha do ICMS devido na o
36933748
<xs:documentation>Sigla da UF para qual é devido o ICMS ST da operação.</xs:documentation>
36943749
</xs:annotation>
36953750
</xs:element>
3751+
<xs:sequence minOccurs="0">
3752+
<xs:annotation>
3753+
<xs:documentation>Grupo desoneração</xs:documentation>
3754+
</xs:annotation>
3755+
<xs:element name="vICMSDeson" type="TDec_1302">
3756+
<xs:annotation>
3757+
<xs:documentation>Valor do ICMS de desoneração</xs:documentation>
3758+
</xs:annotation>
3759+
</xs:element>
3760+
<xs:element name="motDesICMS">
3761+
<xs:annotation>
3762+
<xs:documentation>Motivo da desoneração do ICMS:9-Outros;10=Deficiente Condutor (Convênio ICMS 38/12) 11=Deficiente Não Condutor (Convênio ICMS 38/12)</xs:documentation>
3763+
</xs:annotation>
3764+
<xs:simpleType>
3765+
<xs:restriction base="xs:string">
3766+
<xs:whiteSpace value="preserve"/>
3767+
<xs:enumeration value="9"/>
3768+
<xs:enumeration value="10"/>
3769+
<xs:enumeration value="11"/>
3770+
</xs:restriction>
3771+
</xs:simpleType>
3772+
</xs:element>
3773+
<xs:element name="indDeduzDeson" minOccurs="0">
3774+
<xs:annotation>
3775+
<xs:documentation>Indica se o valor do ICMS desonerado (vICMSDeson) deduz do valor do item (vProd):
3776+
0=Valor do ICMS desonerado (vICMSDeson) não deduz do valor do item (vProd) / total da NF-e;
3777+
1=Valor do ICMS desonerado (vICMSDeson) deduz do valor do item (vProd) / total da NF-e.</xs:documentation>
3778+
</xs:annotation>
3779+
<xs:simpleType>
3780+
<xs:restriction base="xs:string">
3781+
<xs:whiteSpace value="preserve"/>
3782+
<xs:enumeration value="0"/>
3783+
<xs:enumeration value="1"/>
3784+
</xs:restriction>
3785+
</xs:simpleType>
3786+
</xs:element>
3787+
</xs:sequence>
36963788
</xs:sequence>
36973789
</xs:complexType>
36983790
</xs:element>
@@ -6518,16 +6610,16 @@ tipo de ato concessório:
65186610
<xs:whiteSpace value="preserve"/>
65196611
<xs:minLength value="60"/>
65206612
<xs:maxLength value="1000"/>
6521-
<!--QRCODE V1-->
65226613
<xs:pattern value="((HTTPS?|https?)://.*\?chNFe=[0-9]{44}&amp;nVersao=100&amp;tpAmb=[1-2](&amp;cDest=([A-Za-z0-9.:+-/)(]{0}|[A-Za-z0-9.:+-/)(]{5,20})?)?&amp;dhEmi=[A-Fa-f0-9]{50}&amp;vNF=(0|0\.[0-9]{2}|[1-9]{1}[0-9]{0,12}(\.[0-9]{2})?)&amp;vICMS=(0|0\.[0-9]{2}|[1-9]{1}[0-9]{0,12}(\.[0-9]{2})?)&amp;digVal=[A-Fa-f0-9]{56}&amp;cIdToken=[0-9]{6}&amp;cHashQRCode=[A-Fa-f0-9]{40})"/>
6523-
<!--QRCODE V2 ONLINE-->
65246614
<xs:pattern value="((HTTPS?|https?)://.*\?p=([0-9]{34}(1|3|4)[0-9]{9})\|[2]\|[1-2]\|(0|[1-9]{1}([0-9]{1,5})?)\|[A-Fa-f0-9]{40})"/>
6525-
<!--QRCODE V2 OFFLINE-->
65266615
<xs:pattern value="((HTTPS?|https?)://.*\?p=([0-9]{34}9[0-9]{9})\|[2]\|[1-2]\|([0]{1}[1-9]{1}|[1-2]{1}[0-9]{1}|[3]{1}[0-1]{1})\|(0|0\.[0-9]{2}|[1-9]{1}[0-9]{0,12}(\.[0-9]{2})?)\|[A-Fa-f0-9]{56}\|(0|[1-9]{1}([0-9]{1,5})?)\|[A-Fa-f0-9]{40})"/>
6527-
<!--QRCODE V3 ONLINE-->
65286616
<xs:pattern value="((HTTPS?|https?)://.*\?p=([0-9]{34}(1|3|4)[0-9]{9})\|[3]\|[1-2])"/>
6529-
<!--QRCODE V3 OFFLINE-->
65306617
<xs:pattern value="((HTTPS?|https?)://.*\?p=([0-9]{34}(9)[0-9]{9})\|[3]\|[1-2]\|([0]{1}[1-9]{1}|[1-2]{1}[0-9]{1}|[3]{1}[0-1]{1})\|(0|0\.[0-9]{2}|[1-9]{1}[0-9]{0,12}(\.[0-9]{2})?)\|((1|2|3)?)\|(([0-9]{3,14})?)\|([a-zA-Z0-9+/]+[=]{0,2}))"/>
6618+
<!--QRCODE V1-->
6619+
<!--QRCODE V2 ONLINE-->
6620+
<!--QRCODE V2 OFFLINE-->
6621+
<!--QRCODE V3 ONLINE-->
6622+
<!--QRCODE V3 OFFLINE-->
65316623
</xs:restriction>
65326624
</xs:simpleType>
65336625
</xs:element>
@@ -7576,4 +7668,4 @@ alterado para tamanho variavel 1-4. (NT2011/004)</xs:documentation>
75767668
</xs:choice>
75777669
</xs:sequence>
75787670
</xs:complexType>
7579-
</xs:schema>
7671+
</xs:schema>

src/Tools.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public function sefazConsultaChave(string $chave, ?int $tpAmb = null): string
157157
if (empty($chave)) {
158158
throw new InvalidArgumentException('Consulta chave: a chave esta vazia!');
159159
}
160-
if (strlen($chave) != 44 || !is_numeric($chave)) {
160+
if (strlen($chave) != 44) {
161161
throw new InvalidArgumentException("Consulta chave: chave \"$chave\" invalida!");
162162
}
163163
$uf = UFList::getUFByCode((int)substr($chave, 0, 2));

src/Traits/TraitTagCana.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ public function tagforDia(stdClass $std): DOMElement
129129
/**
130130
* Grupo Deduções – Taxas e Contribuições ZC10 pai ZC01
131131
* tag NFe/infNFe/cana/deduc (opcional)
132+
* A partir de 06/06/2026 não será mais usado DEDUC
132133
* @param stdClass $std
133134
* @return DOMElement
134135
* @throws DOMException

src/Traits/TraitTagDetICMS.php

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,13 +1275,13 @@ public function tagICMS(stdClass $std): DOMElement
12751275
"$identificador Percentual da Redução de BC"
12761276
);
12771277
//campo adicionado NT 2022.002 v1.30
1278-
// $this->dom->addChild(
1279-
// $icms,
1280-
// 'cBenefRBC',
1281-
// $std->cBenefRBC ?? null,
1282-
// false,
1283-
// "$identificador Código de Benefício Fiscal na UF aplicado ao item quando houver RBC"
1284-
// );
1278+
$this->dom->addChild(
1279+
$icms,
1280+
'cBenefRBC',
1281+
$std->cBenefRBC ?? null,
1282+
false,
1283+
"$identificador Código de Benefício Fiscal na UF aplicado ao item quando houver RBC"
1284+
);
12851285
$this->dom->addChild(
12861286
$icms,
12871287
'pICMS',
@@ -1291,27 +1291,27 @@ public function tagICMS(stdClass $std): DOMElement
12911291
);
12921292
//grupo EXTRA NT 2022.002 v1.30
12931293
//estes 3 campos serão obrigatórios a partir de 06/06/2026
1294-
// $this->dom->addChild(
1295-
// $icms,
1296-
// 'vICMSOp',
1297-
// $this->conditionalNumberFormatting($std->vICMSOp),
1298-
// false,
1299-
// "$identificador Valor do ICMS da Operação"
1300-
// );
1301-
// $this->dom->addChild(
1302-
// $icms,
1303-
// 'pDif',
1304-
// $this->conditionalNumberFormatting($std->pDif ?? null, 4),
1305-
// false,
1306-
// "$identificador Percentual do diferimento"
1307-
// );
1308-
// $this->dom->addChild(
1309-
// $icms,
1310-
// 'vICMSDif',
1311-
// $this->conditionalNumberFormatting($std->vICMSDif ?? null),
1312-
// false,
1313-
// "$identificador Valor do ICMS diferido"
1314-
// );
1294+
$this->dom->addChild(
1295+
$icms,
1296+
'vICMSOp',
1297+
$this->conditionalNumberFormatting($std->vICMSOp),
1298+
false,
1299+
"$identificador Valor do ICMS da Operação"
1300+
);
1301+
$this->dom->addChild(
1302+
$icms,
1303+
'pDif',
1304+
$this->conditionalNumberFormatting($std->pDif ?? null, 4),
1305+
false,
1306+
"$identificador Percentual do diferimento"
1307+
);
1308+
$this->dom->addChild(
1309+
$icms,
1310+
'vICMSDif',
1311+
$this->conditionalNumberFormatting($std->vICMSDif ?? null),
1312+
false,
1313+
"$identificador Valor do ICMS diferido"
1314+
);
13151315
//fim grupo adicional
13161316
$this->dom->addChild(
13171317
$icms,
@@ -1344,27 +1344,27 @@ public function tagICMS(stdClass $std): DOMElement
13441344
);
13451345
//grupo adicional NT 2022.002 v1.30
13461346
//os dois primeiros campos serão obrigatórios a partir de 06/06/2026
1347-
// $this->dom->addChild(
1348-
// $icms,
1349-
// 'pFCPDif',
1350-
// $this->conditionalNumberFormatting($std->pFCPDif ?? null, 4),
1351-
// false,
1352-
// "$identificador Percentual do diferimento do ICMS relativo ao Fundo de Combate à Pobreza"
1353-
// );
1354-
// $this->dom->addChild(
1355-
// $icms,
1356-
// 'vFCPDif',
1357-
// $this->conditionalNumberFormatting($std->vFCPDif ?? null),
1358-
// false,
1359-
// "$identificador Valor do ICMS relativo ao Fundo de Combate à Pobreza (FCP) diferido"
1360-
// );
1361-
// $this->dom->addChild(
1362-
// $icms,
1363-
// 'vFCPEfet',
1364-
// $this->conditionalNumberFormatting($std->vFCPEfet ?? null),
1365-
// false,
1366-
// "$identificador Valor efetivo do ICMS relativo ao Fundo de Combate à Pobreza (FCP)"
1367-
// );
1347+
$this->dom->addChild(
1348+
$icms,
1349+
'pFCPDif',
1350+
$this->conditionalNumberFormatting($std->pFCPDif ?? null, 4),
1351+
false,
1352+
"$identificador Percentual do diferimento do ICMS relativo ao Fundo de Combate à Pobreza"
1353+
);
1354+
$this->dom->addChild(
1355+
$icms,
1356+
'vFCPDif',
1357+
$this->conditionalNumberFormatting($std->vFCPDif ?? null),
1358+
false,
1359+
"$identificador Valor do ICMS relativo ao Fundo de Combate à Pobreza (FCP) diferido"
1360+
);
1361+
$this->dom->addChild(
1362+
$icms,
1363+
'vFCPEfet',
1364+
$this->conditionalNumberFormatting($std->vFCPEfet ?? null),
1365+
false,
1366+
"$identificador Valor efetivo do ICMS relativo ao Fundo de Combate à Pobreza (FCP)"
1367+
);
13681368
//fim do grupo adicional
13691369
$this->dom->addChild(
13701370
$icms,
@@ -1644,27 +1644,27 @@ public function tagICMSPart(stdClass $std): DOMElement
16441644
"$identificador UF para qual é devido o ICMS ST"
16451645
);
16461646
//grupo adicional NT 2022.002 v1.30
1647-
// $this->dom->addChild(
1648-
// $icmsPart,
1649-
// 'vICMSDeson',
1650-
// $this->conditionalNumberFormatting($std->vICMSDeson ?? null),
1651-
// false,
1652-
// "$identificador Valor do ICMS desonerado"
1653-
// );
1654-
// $this->dom->addChild(
1655-
// $icmsPart,
1656-
// 'motDesICMS',
1657-
// $std->motDesICMS ?? null,
1658-
// false,
1659-
// "$identificador Motivo da desoneração do ICMS"
1660-
// );
1661-
// $this->dom->addChild(
1662-
// $icmsPart,
1663-
// 'indDeduzDeson',
1664-
// $std->indDeduzDeson ?? null,
1665-
// false,
1666-
// "$identificador Indica se o valor do ICMS desonerado (vICMSDeson) deduz do valor do item (vProd)."
1667-
// );
1647+
$this->dom->addChild(
1648+
$icmsPart,
1649+
'vICMSDeson',
1650+
$this->conditionalNumberFormatting($std->vICMSDeson ?? null),
1651+
false,
1652+
"$identificador Valor do ICMS desonerado"
1653+
);
1654+
$this->dom->addChild(
1655+
$icmsPart,
1656+
'motDesICMS',
1657+
$std->motDesICMS ?? null,
1658+
false,
1659+
"$identificador Motivo da desoneração do ICMS"
1660+
);
1661+
$this->dom->addChild(
1662+
$icmsPart,
1663+
'indDeduzDeson',
1664+
$std->indDeduzDeson ?? null,
1665+
false,
1666+
"$identificador Indica se o valor do ICMS desonerado (vICMSDeson) deduz do valor do item (vProd)."
1667+
);
16681668
$this->aICMSPart[$std->item] = $icmsPart;
16691669
return $icmsPart;
16701670
}

tests/TaxCoverageTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ public function testICMS70WithoutSTDeson(): void
514514

515515
public function testICMS90Full(): void
516516
{
517-
$this->markTestSkipped('Campos estarão disponíveis a partir de junho/2026, aguardando publicação do XSD.');
517+
//$this->markTestSkipped('Campos estarão disponíveis a partir de junho/2026, aguardando publicação do XSD.');
518518
$std = new \stdClass();
519519
$std->item = 1;
520520
$std->orig = 0;
@@ -580,7 +580,7 @@ public function testICMS90Minimal(): void
580580

581581
public function testICMSPart(): void
582582
{
583-
$this->markTestSkipped('Campos estarão disponíveis a partir de junho/2026, aguardando publicação do XSD.');
583+
//$this->markTestSkipped('Campos estarão disponíveis a partir de junho/2026, aguardando publicação do XSD.');
584584
// Initialize stdTot->vICMSST which the trait accesses but Make's constructor does not set
585585
if (!isset($this->make->stdTot->vICMSST)) {
586586
$this->make->stdTot->vICMSST = 0;

0 commit comments

Comments
 (0)