1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace CfdiUtils\Elements\Nomina12; |
4
|
|
|
|
5
|
|
|
use CfdiUtils\Elements\Common\AbstractElement; |
6
|
|
|
|
7
|
|
|
class Percepciones extends AbstractElement |
8
|
|
|
{ |
9
|
8 |
|
public function getElementName(): string |
10
|
|
|
{ |
11
|
8 |
|
return 'nomina12:Percepciones'; |
12
|
|
|
} |
13
|
|
|
|
14
|
8 |
|
public function getChildrenOrder(): array |
15
|
|
|
{ |
16
|
|
|
return [ |
17
|
8 |
|
'nomina12:Percepcion', |
18
|
|
|
'nomina12:JubilacionPensionRetiro', |
19
|
|
|
'nomina12:SeparacionIndemnizacion', |
20
|
|
|
]; |
21
|
|
|
} |
22
|
|
|
|
23
|
2 |
|
public function addPercepcion(array $attributes, array $children = []): Percepcion |
24
|
|
|
{ |
25
|
2 |
|
$percepcion = new Percepcion($attributes, $children); |
26
|
2 |
|
$this->addChild($percepcion); |
27
|
2 |
|
return $percepcion; |
28
|
|
|
} |
29
|
|
|
|
30
|
1 |
|
public function multiPercepcion(array ...$elementAttributes): self |
31
|
|
|
{ |
32
|
1 |
|
foreach ($elementAttributes as $attributes) { |
33
|
1 |
|
$this->addPercepcion($attributes); |
34
|
|
|
} |
35
|
1 |
|
return $this; |
36
|
|
|
} |
37
|
|
|
|
38
|
2 |
|
public function getJubilacionPensionRetiro(): JubilacionPensionRetiro |
39
|
|
|
{ |
40
|
|
|
/** @noinspection PhpIncompatibleReturnTypeInspection */ |
41
|
2 |
|
return $this->helperGetOrAdd(new JubilacionPensionRetiro()); |
|
|
|
|
42
|
|
|
} |
43
|
|
|
|
44
|
1 |
|
public function addJubilacionPensionRetiro(array $attributes = []): JubilacionPensionRetiro |
45
|
|
|
{ |
46
|
1 |
|
$jubilacionPensionRetiro = $this->getJubilacionPensionRetiro(); |
47
|
1 |
|
$jubilacionPensionRetiro->addAttributes($attributes); |
48
|
1 |
|
return $jubilacionPensionRetiro; |
49
|
|
|
} |
50
|
|
|
|
51
|
2 |
|
public function getSeparacionIndemnizacion(): SeparacionIndemnizacion |
52
|
|
|
{ |
53
|
|
|
/** @noinspection PhpIncompatibleReturnTypeInspection */ |
54
|
2 |
|
return $this->helperGetOrAdd(new SeparacionIndemnizacion()); |
|
|
|
|
55
|
|
|
} |
56
|
|
|
|
57
|
1 |
|
public function addSeparacionIndemnizacion(array $attributes = []): SeparacionIndemnizacion |
58
|
|
|
{ |
59
|
1 |
|
$separacionIndemnizacion = $this->getSeparacionIndemnizacion(); |
60
|
1 |
|
$separacionIndemnizacion->addAttributes($attributes); |
61
|
1 |
|
return $separacionIndemnizacion; |
62
|
|
|
} |
63
|
|
|
} |
64
|
|
|
|