1 | <?php |
||
12 | class ItemEnvelope implements Billable |
||
13 | { |
||
14 | /** |
||
15 | * @var Billable |
||
16 | */ |
||
17 | private $billable; |
||
18 | |||
19 | /** |
||
20 | * Pack billable at construct |
||
21 | */ |
||
22 | 15 | public function __construct(Billable $billable) |
|
26 | |||
27 | /** |
||
28 | * Get packed billable |
||
29 | */ |
||
30 | 13 | public function getBillable(): Billable |
|
31 | { |
||
32 | 13 | return $this->billable; |
|
33 | } |
||
34 | |||
35 | /** |
||
36 | * Get total cost of all units (VAT excluded) |
||
37 | */ |
||
38 | 8 | public function getTotalUnitCost(): Amount |
|
42 | |||
43 | /** |
||
44 | * Get total VAT cost for all units |
||
45 | */ |
||
46 | 5 | public function getTotalVatCost(): Amount |
|
50 | |||
51 | /** |
||
52 | * Get total cost (VAT included) |
||
53 | */ |
||
54 | 1 | public function getTotalCost(): Amount |
|
58 | |||
59 | /** |
||
60 | * Pass to decorated billable |
||
61 | */ |
||
62 | 1 | public function getBillingDescription(): string |
|
63 | { |
||
64 | 1 | return $this->getBillable()->getBillingDescription(); |
|
65 | } |
||
66 | |||
67 | /** |
||
68 | * Pass to decorated billable |
||
69 | */ |
||
70 | 9 | public function getCostPerUnit(): Amount |
|
71 | { |
||
72 | 9 | return $this->getBillable()->getCostPerUnit(); |
|
73 | } |
||
74 | |||
75 | /** |
||
76 | * Pass to decorated billable |
||
77 | */ |
||
78 | 10 | public function getNrOfUnits(): int |
|
79 | { |
||
80 | 10 | return $this->getBillable()->getNrOfUnits(); |
|
81 | } |
||
82 | |||
83 | /** |
||
84 | * Pass to decorated billable |
||
85 | */ |
||
86 | 7 | public function getVatRate(): Amount |
|
90 | } |
||
91 |