1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace ControleOnline\Service; |
4
|
|
|
|
5
|
|
|
use ControleOnline\Entity\Order; |
6
|
|
|
use ControleOnline\Entity\SalesInvoiceTax; |
|
|
|
|
7
|
|
|
use ControleOnline\Entity\OrderInvoiceTax; |
8
|
|
|
use ControleOnline\Library\NFePHP; |
9
|
|
|
|
10
|
|
|
class NFeService extends NFePHP |
11
|
|
|
{ |
12
|
|
|
public function createNfe(Order $order, $model, $version = '4.00') |
13
|
|
|
{ |
14
|
|
|
|
15
|
|
|
$this->model = $model; |
16
|
|
|
$this->version = $version; |
17
|
|
|
|
18
|
|
|
switch ($this->model) { |
19
|
|
|
case '65': |
20
|
|
|
$this->make = new \NFePHP\NFe\Make(); |
|
|
|
|
21
|
|
|
$this->tools = new \NFePHP\NFe\Tools($this->getSignData($order), $this->getCertificate($order)); |
|
|
|
|
22
|
|
|
$this->cupomFiscal($order); |
23
|
|
|
break; |
24
|
|
|
case '55': |
25
|
|
|
$this->make = new \NFePHP\NFe\Make(); |
26
|
|
|
$this->tools = new \NFePHP\NFe\Tools($this->getSignData($order), $this->getCertificate($order)); |
27
|
|
|
$this->nfe($order); |
28
|
|
|
break; |
29
|
|
|
case '57': |
30
|
|
|
$this->make = new \NFePHP\CTe\MakeCTe(); |
|
|
|
|
31
|
|
|
$this->tools = new \NFePHP\CTe\Tools($this->getSignData($order), $this->getCertificate($order)); |
|
|
|
|
32
|
|
|
$this->cte($order); |
33
|
|
|
break; |
34
|
|
|
default: |
35
|
|
|
return; |
36
|
|
|
break; |
|
|
|
|
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
$xml = $this->sign($order); |
40
|
|
|
//$this->persist($order, $xml); |
41
|
|
|
|
42
|
|
|
return $xml; |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
protected function nfe(Order $order) |
46
|
|
|
{ |
47
|
|
|
$this->makeInfNFe($this->version); |
48
|
|
|
$this->makeIde($order); |
49
|
|
|
$this->makeEmit($order); |
50
|
|
|
$this->makeDest($order); |
51
|
|
|
$this->makeProds($order); |
52
|
|
|
$this->makeTransp($order); |
53
|
|
|
$this->makePag($order); |
54
|
|
|
$this->makedetPag($order); |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
protected function cte(Order $order) |
58
|
|
|
{ |
59
|
|
|
$this->makeInfNFe($this->version); |
60
|
|
|
$this->makeIde($order); |
61
|
|
|
$this->makeEmit($order); |
62
|
|
|
$this->makeDest($order); |
63
|
|
|
$this->makePag($order); |
64
|
|
|
$this->makedetPag($order); |
65
|
|
|
$this->makeTomador($order); |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
protected function cupomFiscal(Order $order) |
69
|
|
|
{ |
70
|
|
|
$this->makeInfRespTec(); |
71
|
|
|
$this->makeInfNFe($this->version); |
72
|
|
|
$this->makeIde($order); |
73
|
|
|
$this->makeEmit($order); |
74
|
|
|
$this->makeDest($order); |
75
|
|
|
$this->makeProds($order); |
76
|
|
|
$this->makeTransp($order); |
77
|
|
|
$this->makePag($order); |
78
|
|
|
$this->makedetPag($order); |
79
|
|
|
} |
80
|
|
|
} |
81
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths