line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::TinyERP; |
2
|
2
|
|
|
2
|
|
138591
|
use strict; |
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
76
|
|
3
|
2
|
|
|
2
|
|
13
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
52
|
|
4
|
2
|
|
|
2
|
|
836
|
use Net::TinyERP::NotaFiscal; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
435
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.06'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
5
|
|
|
5
|
0
|
3040
|
my ($class, @params) = @_; |
10
|
5
|
100
|
|
|
|
25
|
die 'Net::TinyERP->new() precisa do argumento "token"' unless @params; |
11
|
4
|
50
|
|
|
|
19
|
my %params = @params > 1 ? @params : %{$params[0]}; |
|
0
|
|
|
|
|
0
|
|
12
|
|
|
|
|
|
|
my $self = { |
13
|
|
|
|
|
|
|
token => $params{token} || die 'argumento "token" obrigatório', |
14
|
4
|
|
100
|
|
|
41
|
api_version => $params{api_version} || '2.0', |
15
|
|
|
|
|
|
|
}; |
16
|
2
|
|
|
|
|
10
|
bless $self, $class; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub nota_fiscal { |
20
|
1
|
|
|
1
|
1
|
5
|
my ($self) = @_; |
21
|
1
|
50
|
|
|
|
7
|
if (!exists $self->{_nf_obj}) { |
22
|
1
|
|
|
|
|
14
|
$self->{_nf_obj} = Net::TinyERP::NotaFiscal->new($self); |
23
|
|
|
|
|
|
|
} |
24
|
1
|
|
|
|
|
65
|
return $self->{_nf_obj}; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub nota_servicos { |
28
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
29
|
0
|
0
|
|
|
|
|
if (!exists $self->{_nfs_obj}) { |
30
|
0
|
|
|
|
|
|
$self->{_nfs_obj} = Net::TinyERP::NotaFiscalServicos->new($self); |
31
|
|
|
|
|
|
|
} |
32
|
0
|
|
|
|
|
|
return $self->{_nfs_obj}; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
__END__ |