1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* LibreDTE: Biblioteca PHP (Núcleo). |
7
|
|
|
* Copyright (C) LibreDTE <https://www.libredte.cl> |
8
|
|
|
* |
9
|
|
|
* Este programa es software libre: usted puede redistribuirlo y/o modificarlo |
10
|
|
|
* bajo los términos de la Licencia Pública General Affero de GNU publicada por |
11
|
|
|
* la Fundación para el Software Libre, ya sea la versión 3 de la Licencia, o |
12
|
|
|
* (a su elección) cualquier versión posterior de la misma. |
13
|
|
|
* |
14
|
|
|
* Este programa se distribuye con la esperanza de que sea útil, pero SIN |
15
|
|
|
* GARANTÍA ALGUNA; ni siquiera la garantía implícita MERCANTIL o de APTITUD |
16
|
|
|
* PARA UN PROPÓSITO DETERMINADO. Consulte los detalles de la Licencia Pública |
17
|
|
|
* General Affero de GNU para obtener una información más detallada. |
18
|
|
|
* |
19
|
|
|
* Debería haber recibido una copia de la Licencia Pública General Affero de |
20
|
|
|
* GNU junto a este programa. |
21
|
|
|
* |
22
|
|
|
* En caso contrario, consulte <http://www.gnu.org/licenses/agpl.html>. |
23
|
|
|
*/ |
24
|
|
|
|
25
|
|
|
namespace libredte\lib\Core\Package\Billing\Component\TradingParties\Entity; |
26
|
|
|
|
27
|
|
|
use libredte\lib\Core\Package\Billing\Component\TradingParties\Contract\AutorizacionDteInterface; |
28
|
|
|
use libredte\lib\Core\Package\Billing\Component\TradingParties\Contract\EmisorInterface; |
29
|
|
|
use libredte\lib\Core\Package\Billing\Component\TradingParties\Trait\CorreoIntercambioDteInfoTrait; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* Clase para representar un emisor de un documento tributario. |
33
|
|
|
*/ |
34
|
|
|
class Emisor extends Contribuyente implements EmisorInterface |
35
|
|
|
{ |
36
|
|
|
// Traits que usa esta entidad. |
37
|
|
|
use CorreoIntercambioDteInfoTrait; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* Código de la sucursal del emisor en el SII. |
41
|
|
|
* |
42
|
|
|
* Nota: La casa matriz también tiene código de sucursal asignado por SII. |
43
|
|
|
* |
44
|
|
|
* @var int|null |
45
|
|
|
*/ |
46
|
|
|
private ?int $sucursal = null; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* Nombre o código del vendedor que está representando al emisor. |
50
|
|
|
* |
51
|
|
|
* @var string|null |
52
|
|
|
*/ |
53
|
|
|
private ?string $vendedor = null; |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* Entrega el código de la sucursal asignado por el SII al emisor. |
57
|
|
|
* |
58
|
|
|
* @return integer|null |
59
|
|
|
*/ |
60
|
1 |
|
public function getSucursal(): ?int |
61
|
|
|
{ |
62
|
1 |
|
return $this->sucursal; |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* Entrega el nombre o código del vendedor que está representando al emisor. |
67
|
|
|
* |
68
|
|
|
* @return string|null |
69
|
|
|
*/ |
70
|
1 |
|
public function getVendedor(): ?string |
71
|
|
|
{ |
72
|
1 |
|
return $this->vendedor; |
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* Información de la autorización que da el SII para ser emisor de |
77
|
|
|
* documentos tributarios electrónicos. |
78
|
|
|
* |
79
|
|
|
* La autorización contiene además el ambiente en que se autoriza al emisor. |
80
|
|
|
* |
81
|
|
|
* @var AutorizacionDteInterface|null |
82
|
|
|
*/ |
83
|
|
|
private ?AutorizacionDteInterface $autorizacionDte = null; |
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* Logo del emisor. |
87
|
|
|
* |
88
|
|
|
* @var string|null |
89
|
|
|
*/ |
90
|
|
|
private ?string $logo = null; |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* {@inheritDoc} |
94
|
|
|
*/ |
95
|
|
|
public function setAutorizacionDte(AutorizacionDteInterface $autorizacionDte): static |
96
|
|
|
{ |
97
|
|
|
$this->autorizacionDte = $autorizacionDte; |
98
|
|
|
|
99
|
|
|
return $this; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* {@inheritDoc} |
104
|
|
|
*/ |
105
|
56 |
|
public function getAutorizacionDte(): ?AutorizacionDteInterface |
106
|
|
|
{ |
107
|
56 |
|
return $this->autorizacionDte; |
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
/** |
111
|
|
|
* {@inheritDoc} |
112
|
|
|
*/ |
113
|
|
|
public function setLogo(string $logo): static |
114
|
|
|
{ |
115
|
|
|
$this->logo = $logo; |
116
|
|
|
|
117
|
|
|
return $this; |
118
|
|
|
} |
119
|
|
|
|
120
|
|
|
/** |
121
|
|
|
* {@inheritDoc} |
122
|
|
|
*/ |
123
|
|
|
public function getLogo(): ?string |
124
|
|
|
{ |
125
|
|
|
return $this->logo; |
126
|
|
|
} |
127
|
|
|
} |
128
|
|
|
|