Skip to content

Commit

Permalink
ajustes recibo R3010 e getIdFromXml()
Browse files Browse the repository at this point in the history
  • Loading branch information
robmachado committed Feb 6, 2024
1 parent a7eee34 commit b927eb3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/Fake/v2_01_02/Fake_R2010_EvtTomadorServicos.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
//2 - É obra de construção civil, modalidade empreitada parcial.

$std->cnpjprestador = '12345678901234'; //Obrigatório CNPJ do prestador de serviços
$std->vlrtotalbruto = 200.00; //Obrigatório Valor bruto da(s) nota(s) fiscal(is)
$std->vlrtotalbruto = 571123.7; //Obrigatório Valor bruto da(s) nota(s) fiscal(is)
// SOMA de $std->nfs[$n]->vlrbruto

$std->vlrtotalbaseret = 200.00; //Obrigatório Valor soma da base de cálculo da retenção da contribuição previdenciária das notas fiscais emitidas para o contratante.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"nrrecibo": {
"required": false,
"type": ["string", "null"],
"pattern": "^[0-9]{1,18}[-][0-9]{2}[-][0-9]{4}[-][0-9]{4}[-][0-9]{1,18}$"
"pattern": "^[0-9]{1,18}[-][0-9]{2}[-][0-9]{4}[-][0-9]{6}[-][0-9]{1,18}$"
},
"dtapuracao": {
"required": true,
Expand Down Expand Up @@ -265,7 +265,7 @@
$std = new \stdClass();
//$std->sequencial = 1;
$std->indretif = 1;
$std->nrrecibo = '1-12-1234-1234-123456576';
$std->nrrecibo = '1-12-1234-123456-123456576';
$std->dtapuracao = '2017-12-01';
$std->nrinscestab = '12345678901234';

Expand Down
2 changes: 1 addition & 1 deletion jsonSchemes/v2_01_02/evtEspDesportivo.schema
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"nrrecibo": {
"required": false,
"type": ["string", "null"],
"pattern": "^[0-9]{1,18}[-][0-9]{2}[-][0-9]{4}[-][0-9]{4}[-][0-9]{1,18}$"
"pattern": "^[0-9]{1,18}[-][0-9]{2}[-][0-9]{4}[-][0-9]{6}[-][0-9]{1,18}$"
},
"dtapuracao": {
"required": true,
Expand Down
3 changes: 3 additions & 0 deletions src/Tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -788,10 +788,13 @@ protected function getIdFromXml(string $xml)
$id = null;
$grupo = null;
foreach ($keys as $tagname) {
$id = null;
if (!empty($dom->getElementsByTagName($tagname)->item(0))) {
$tag = $dom->getElementsByTagName($tagname)->item(0);
$id = $tag->getAttribute('id');
$grupo = $possibles[$tagname];
}
if (!empty($id)) {
break;
}
}
Expand Down

0 comments on commit b927eb3

Please sign in to comment.