PartyTaxScheme   A
last analyzed

Complexity

Total Complexity 12

Size/Duplication

Total Lines 78
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 35
dl 0
loc 78
rs 10
c 0
b 0
f 0
wmc 12

11 Methods

Rating   Name   Duplication   Size   Complexity  
A setTaxScheme() 0 3 1
A getSchemeID() 0 2 1
A setSchemeID() 0 3 1
A getRegistrationAddress() 0 2 1
A setRegistrationName() 0 3 1
A xmlSerialize() 0 21 2
A setCompanyID() 0 3 1
A getTaxScheme() 0 2 1
A getCompanyID() 0 2 1
A getRegistrationName() 0 2 1
A setRegistrationAddress() 0 3 1
1
<?php
2
3
/**
4
 * MÓDULO DE EMISIÓN ELECTRÓNICA F72X
5
 * UBL 2.1
6
 * Version 1.0
7
 * 
8
 * Copyright 2019, Jaime Cruz
9
 */
10
11
namespace F72X\UblComponent;
12
13
use Sabre\Xml\Writer;
14
use Sabre\Xml\Element\Cdata;
15
16
class PartyTaxScheme extends BaseComponent {
17
18
    protected $RegistrationName;
19
    protected $CompanyID;
20
    protected $schemeID;
21
22
    /** @var RegistrationAddress */
23
    protected $RegistrationAddress;
24
25
    /** @var TaxScheme */
26
    protected $TaxScheme;
27
28
    function xmlSerialize(Writer $writer) {
29
        $writer->write([
30
            SchemaNS::CBC . 'RegistrationName'  => new Cdata($this->RegistrationName),
31
            [
32
                'name'          => SchemaNS::CBC . 'CompanyID',
33
                'value'         => $this->CompanyID,
34
                'attributes'    => [
35
                    'schemeID'          => $this->schemeID,
36
                    'schemeName'        => 'SUNAT:Identificador de Documento de Identidad',
37
                    'schemeAgencyName'  => 'PE:SUNAT',
38
                    'schemeURI'         => 'urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06'
39
                ]
40
            ]
41
        ]);
42
        if ($this->RegistrationAddress) {
43
            $writer->write([
44
                SchemaNS::CAC . 'RegistrationAddress' => $this->RegistrationAddress
45
            ]);
46
        }
47
        $writer->write([
48
            SchemaNS::CAC . 'TaxScheme'         => $this->TaxScheme
49
        ]);
50
    }
51
52
    public function getRegistrationName() {
53
        return $this->RegistrationName;
54
    }
55
56
    public function setRegistrationName($RegistrationName) {
57
        $this->RegistrationName = $RegistrationName;
58
        return $this;
59
    }
60
61
    public function getCompanyID() {
62
        return $this->CompanyID;
63
    }
64
65
    public function setCompanyID($CompanyID) {
66
        $this->CompanyID = $CompanyID;
67
        return $this;
68
    }
69
    public function getSchemeID() {
70
        return $this->schemeID;
71
    }
72
73
    public function setSchemeID($schemeID) {
74
        $this->schemeID = $schemeID;
75
        return $this;
76
    }
77
78
    public function getRegistrationAddress() {
79
        return $this->RegistrationAddress;
80
    }
81
82
    public function setRegistrationAddress(RegistrationAddress $RegistrationAddress) {
83
        $this->RegistrationAddress = $RegistrationAddress;
84
        return $this;
85
    }
86
87
    public function getTaxScheme() {
88
        return $this->TaxScheme;
89
    }
90
91
    public function setTaxScheme(TaxScheme $TaxScheme) {
92
        $this->TaxScheme = $TaxScheme;
93
        return $this;
94
    }
95
96
}
97