AlternativeConditionPrice::getCurrencyID()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
rs 10
c 1
b 0
f 0
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 F72X\Sunat\Operations;
14
use Sabre\Xml\Writer;
15
16
class AlternativeConditionPrice extends BaseComponent {
17
18
    const DECIMALS = 2;
19
20
    protected $currencyID;
21
    protected $PriceAmount;
22
    protected $PriceTypeCode; //@CAT16
23
    protected $validations = [
24
        'currencyID',
25
        'PriceTypeCode',
26
        'PriceAmount'
27
    ];
28
29
    function xmlSerialize(Writer $writer) {
30
        $this->validate();
31
        $writer->write([
32
            [
33
                'name'          => SchemaNS::CBC . 'PriceAmount',
34
                'value'         => Operations::formatAmount($this->PriceAmount, self::DECIMALS),
35
                'attributes'    => [
36
                    'currencyID' => $this->currencyID
37
                ],
38
            ],
39
            [
40
                'name'          => SchemaNS::CBC . 'PriceTypeCode',
41
                'value'         => $this->PriceTypeCode,
42
                'attributes'    => [
43
                    'listName'          => 'SUNAT:Indicador de Tipo de Precio',
44
                    'listAgencyName'    => 'PE:SUNAT',
45
                    'listURI'           => 'urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo16'
46
                ]
47
            ]
48
        ]);
49
    }
50
51
    public function getCurrencyID() {
52
        return $this->currencyID;
53
    }
54
55
    public function setCurrencyID($currencyID) {
56
        $this->currencyID = $currencyID;
57
        return $this;
58
    }
59
60
    public function getPriceAmount() {
61
        return $this->PriceAmount;
62
    }
63
64
    public function setPriceAmount($PriceAmount) {
65
        $this->PriceAmount = $PriceAmount;
66
        return $this;
67
    }
68
69
    public function getPriceTypeCode() {
70
        return $this->PriceTypeCode;
71
    }
72
73
    /**
74
     * 
75
     * @param string $PriceTypeCode @CAT16
76
     * @return $this
77
     */
78
    public function setPriceTypeCode($PriceTypeCode) {
79
        $this->PriceTypeCode = $PriceTypeCode;
80
        return $this;
81
    }
82
83
}
84