TaxSubTotal::getTaxableAmount()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
rs 10
c 0
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 TaxSubTotal extends BaseComponent {
17
18
    const DECIMALS = 2;
19
20
    protected $currencyID;
21
    protected $TaxableAmount;
22
    protected $TaxAmount;
23
24
    /** @var TaxCategory */
25
    protected $TaxCategory;
26
    protected $validations = ['currencyID', 'TaxableAmount', 'TaxAmount', 'TaxCategory'];
27
28
    function xmlSerialize(Writer $writer) {
29
        $this->validate();
30
31
        $writer->write([
32
            [
33
                'name'  => SchemaNS::CBC . 'TaxableAmount',
34
                'value' => Operations::formatAmount($this->TaxableAmount, self::DECIMALS),
35
                'attributes' => [
36
                    'currencyID' => $this->currencyID
37
                ]
38
            ],
39
            [
40
                'name'  => SchemaNS::CBC . 'TaxAmount',
41
                'value' => Operations::formatAmount($this->TaxAmount, self::DECIMALS),
42
                'attributes' => [
43
                    'currencyID' => $this->currencyID
44
                ]
45
            ],
46
            SchemaNS::CAC . 'TaxCategory' => $this->TaxCategory
47
        ]);
48
    }
49
50
    public function getTaxableAmount() {
51
        return $this->TaxableAmount;
52
    }
53
54
    public function setTaxableAmount($TaxableAmount) {
55
        $this->TaxableAmount = $TaxableAmount;
56
        return $this;
57
    }
58
59
    public function getTaxAmount() {
60
        return $this->TaxAmount;
61
    }
62
63
    public function setTaxAmount($TaxAmount) {
64
        $this->TaxAmount = $TaxAmount;
65
        return $this;
66
    }
67
68
    public function getCurrencyID() {
69
        return $this->currencyID;
70
    }
71
72
    public function setCurrencyID($currencyID) {
73
        $this->currencyID = $currencyID;
74
        return $this;
75
    }
76
77
    public function getTaxCategory() {
78
        return $this->TaxCategory;
79
    }
80
81
    public function setTaxCategory($TaxCategory) {
82
        $this->TaxCategory = $TaxCategory;
83
        return $this;
84
    }
85
86
}
87