Skip to content

Commit

Permalink
Merge pull request #31 from robmachado/master
Browse files Browse the repository at this point in the history
[UPD] outras atualizações
  • Loading branch information
robmachado committed Dec 15, 2017
2 parents 69529f2 + 55f9d70 commit d0bdbe7
Show file tree
Hide file tree
Showing 20 changed files with 1,867 additions and 57 deletions.
2 changes: 1 addition & 1 deletion examples/Fake/v1_02_00/FaketestEvtPgtosDivs.php
Expand Up @@ -27,7 +27,7 @@
$std = new \stdClass();
$std->sequencial = 1;
$std->indretif = 1;
$std->nrrecibo = '737373737373737';
$std->nrrecibo = '1-00-1234-1234-1234556789012345';
$std->perapur = '2017-11';

$std->codpgto = '0916';
Expand Down
5 changes: 3 additions & 2 deletions examples/schemes/v1_02_00/testJsonSchemaEvtPgtosDivs.php
Expand Up @@ -30,7 +30,8 @@
"nrrecibo": {
"required": false,
"type": ["string","null"],
"maxLength": 52
"maxLength": 52,
"pattern": "^([0-9]{1,18}[-][0-9]{2}[-][0-9]{4}[-][0-9]{4}[-][0-9]{1,18})$"
},
"perapur": {
"required": true,
Expand Down Expand Up @@ -577,7 +578,7 @@
$std = new \stdClass();
$std->sequencial = 1;
$std->indretif = 1;
$std->nrrecibo = '737373737373737';
$std->nrrecibo = '1-00-1234-1234-1234556789012345';
$std->perapur = '2017-11';

$std->codpgto = '0916';
Expand Down
3 changes: 2 additions & 1 deletion jsonSchemes/v1_02_00/evtPgtosDivs.schema
Expand Up @@ -17,7 +17,8 @@
"nrrecibo": {
"required": false,
"type": ["string","null"],
"maxLength": 52
"maxLength": 52,
"pattern": "^([0-9]{1,18}[-][0-9]{2}[-][0-9]{4}[-][0-9]{4}[-][0-9]{1,18})$"
},
"perapur": {
"required": true,
Expand Down
2 changes: 1 addition & 1 deletion schemes/v1_02_00/evtFechamento-v1_02_00.xsd
Expand Up @@ -105,7 +105,7 @@
<xs:restriction base="xs:string">
<xs:minLength value="8"/>
<xs:maxLength value="14"/>
<xs:pattern value="[0-9]{8,11,14}"/>
<xs:pattern value="[0-9]{8}|[0-9]{11}|[0-9]{14}"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
Expand Down
1,096 changes: 1,096 additions & 0 deletions schemes/v1_02_00/evtPagsDivs-v1_02_00.xsd

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/Common/Factory.php
Expand Up @@ -266,7 +266,7 @@ protected function init()
$this->dom->addChild(
$ideContri,
"tpInsc",
$this->tpInsc,
(string) $this->tpInsc,
true
);
$this->dom->addChild(
Expand Down Expand Up @@ -416,7 +416,9 @@ protected function sign($tagsigned = '')
[true, false, null, null]
);
//validation by XSD schema throw Exception if dont pass
Validator::isValid($xml, $this->schema);
if ($this->schema) {
Validator::isValid($xml, $this->schema);
}
}
$this->xml = $xml;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Factories/EvtAssocDespRec.php
Expand Up @@ -28,19 +28,19 @@ class EvtAssocDespRec extends Factory implements FactoryInterface
* @param string $config
* @param stdClass $std
* @param Certificate $certificate
* @param string date
* @param string $data
*/
public function __construct(
$config,
stdClass $std,
Certificate $certificate = null,
$date = ''
$data = ''
) {
$params = new \stdClass();
$params->evtName = 'evtRecursoRecebidoAssociacao';
$params->evtTag = 'evtAssocDespRec';
$params->evtAlias = 'R-2030';
parent::__construct($config, $std, $params, $certificate, $date);
parent::__construct($config, $std, $params, $certificate, $data);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/Factories/EvtAssocDespRep.php
Expand Up @@ -28,19 +28,19 @@ class EvtAssocDespRep extends Factory implements FactoryInterface
* @param string $config
* @param stdClass $std
* @param Certificate $certificate
* @param string date
* @param string $data
*/
public function __construct(
$config,
stdClass $std,
Certificate $certificate = null,
$date = ''
$data = ''
) {
$params = new \stdClass();
$params->evtName = 'evtRecursoRepassadoAssociacao';
$params->evtTag = 'evtAssocDespRep';
$params->evtAlias = 'R-2040';
parent::__construct($config, $std, $params, $certificate, $date);
parent::__construct($config, $std, $params, $certificate, $data);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/Factories/EvtCPRB.php
Expand Up @@ -28,19 +28,19 @@ class EvtCPRB extends Factory implements FactoryInterface
* @param string $config
* @param stdClass $std
* @param Certificate $certificate
* @param string date
* @param string $data
*/
public function __construct(
$config,
stdClass $std,
Certificate $certificate = null,
$date = ''
$data = ''
) {
$params = new \stdClass();
$params->evtName = 'evtInfoCPRB';
$params->evtTag = 'evtCPRB';
$params->evtAlias = 'R-2060';
parent::__construct($config, $std, $params, $certificate, $date);
parent::__construct($config, $std, $params, $certificate, $data);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/Factories/EvtComProd.php
Expand Up @@ -28,19 +28,19 @@ class EvtComProd extends Factory implements FactoryInterface
* @param string $config
* @param stdClass $std
* @param Certificate $certificate
* @param string date
* @param string $data
*/
public function __construct(
$config,
stdClass $std,
Certificate $certificate = null,
$date = ''
$data = ''
) {
$params = new \stdClass();
$params->evtName = 'evtInfoProdRural';
$params->evtTag = 'evtComProd';
$params->evtAlias = 'R-2050';
parent::__construct($config, $std, $params, $certificate, $date);
parent::__construct($config, $std, $params, $certificate, $data);
}

/**
Expand Down Expand Up @@ -163,7 +163,7 @@ protected function toNode()
$ideEstab->appendChild($tipoCom);
}
if (!empty($this->std->infoproc)) {
foreach($this->std->infoproc as $ip) {
foreach ($this->std->infoproc as $ip) {
$infoProc = $this->dom->createElement("infoProc");
$this->dom->addChild(
$infoProc,
Expand Down
18 changes: 9 additions & 9 deletions src/Factories/EvtEspDesportivo.php
Expand Up @@ -28,19 +28,19 @@ class EvtEspDesportivo extends Factory implements FactoryInterface
* @param string $config
* @param stdClass $std
* @param Certificate $certificate
* @param string date
* @param string $data
*/
public function __construct(
$config,
stdClass $std,
Certificate $certificate = null,
$date = ''
$data = ''
) {
$params = new \stdClass();
$params->evtName = 'evtEspDesportivo';
$params->evtTag = 'evtEspDesportivo';
$params->evtAlias = 'R-3010';
parent::__construct($config, $std, $params, $certificate, $date);
parent::__construct($config, $std, $params, $certificate, $data);
}

/**
Expand Down Expand Up @@ -185,7 +185,7 @@ protected function toNode()
"uf",
$bo->uf,
true
);
);
$this->dom->addChild(
$boletim,
"qtdePagantes",
Expand All @@ -199,8 +199,8 @@ protected function toNode()
true
);

foreach($bo->receitaingressos as $rec) {
$recIng = $this->dom->createElement("receitaIngressos");
foreach ($bo->receitaingressos as $rec) {
$recIng = $this->dom->createElement("receitaIngressos");
$this->dom->addChild(
$recIng,
"tpIngresso",
Expand Down Expand Up @@ -247,7 +247,7 @@ protected function toNode()
}

if (!empty($bo->outrasreceitas)) {
foreach ($bo->outrasreceitas as $or) {
foreach ($bo->outrasreceitas as $or) {
$oRec = $this->dom->createElement("outrasReceitas");
$this->dom->addChild(
$oRec,
Expand Down Expand Up @@ -279,7 +279,7 @@ protected function toNode()
"vlrReceitaTotal",
number_format($rt->vlrreceitatotal, 2, ',', ''),
true
);
);
$this->dom->addChild(
$recTot,
"vlrCP",
Expand Down Expand Up @@ -312,7 +312,7 @@ protected function toNode()
"vlrCPSusp",
number_format($ifp->vlrcpsusp, 2, ',', ''),
true
);
);
$this->dom->addChild(
$infoProc,
"tpProc",
Expand Down
6 changes: 3 additions & 3 deletions src/Factories/EvtExclusao.php
Expand Up @@ -28,19 +28,19 @@ class EvtExclusao extends Factory implements FactoryInterface
* @param string $config
* @param stdClass $std
* @param Certificate $certificate
* @param string date
* @param string $data
*/
public function __construct(
$config,
stdClass $std,
Certificate $certificate = null,
$date = ''
$data = ''
) {
$params = new \stdClass();
$params->evtName = 'evtExclusao';
$params->evtTag = 'evtExclusao';
$params->evtAlias = 'R-9000';
parent::__construct($config, $std, $params, $certificate, $date);
parent::__construct($config, $std, $params, $certificate, $data);
}

/**
Expand Down

0 comments on commit d0bdbe7

Please sign in to comment.