1 | <?php |
||
8 | class PaymentLine |
||
9 | { |
||
10 | /** |
||
11 | * @var string |
||
12 | */ |
||
13 | protected $productNumber; |
||
14 | |||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | protected $name; |
||
19 | |||
20 | /** |
||
21 | * @var int |
||
22 | */ |
||
23 | protected $quantity; |
||
24 | |||
25 | /** |
||
26 | * The price excl vat. |
||
27 | * |
||
28 | * @var Money |
||
29 | */ |
||
30 | protected $price; |
||
31 | |||
32 | /** |
||
33 | * This is the VAT percentage, i.e. 25 for Denmark. |
||
34 | * |
||
35 | * @var int |
||
36 | */ |
||
37 | protected $vat; |
||
38 | |||
39 | /** |
||
40 | * @var Payment |
||
41 | */ |
||
42 | protected $payment; |
||
43 | |||
44 | /** |
||
45 | * @param string $productNumber |
||
46 | * @param string $name |
||
47 | * @param int $quantity |
||
48 | * @param Money $price |
||
49 | * @param int $vat |
||
50 | */ |
||
51 | 9 | public function __construct(string $productNumber, string $name, int $quantity, Money $price, int $vat) |
|
59 | |||
60 | /****************** |
||
61 | * Helper methods * |
||
62 | *****************/ |
||
63 | |||
64 | /** |
||
65 | * @return Money |
||
66 | */ |
||
67 | 3 | public function getPriceExclVat(): Money |
|
71 | |||
72 | /** |
||
73 | * @return Money |
||
74 | */ |
||
75 | 3 | public function getPriceInclVat(): Money |
|
79 | |||
80 | /** |
||
81 | * @return Money |
||
82 | */ |
||
83 | 3 | public function getVatAmount(): Money |
|
89 | |||
90 | /********************* |
||
91 | * Getters / Setters * |
||
92 | ********************/ |
||
93 | |||
94 | /** |
||
95 | * @return string |
||
96 | */ |
||
97 | 6 | public function getProductNumber(): string |
|
101 | |||
102 | /** |
||
103 | * @param string $productNumber |
||
104 | * |
||
105 | * @return PaymentLine |
||
106 | */ |
||
107 | 9 | public function setProductNumber(string $productNumber): self |
|
113 | |||
114 | /** |
||
115 | * @return string |
||
116 | */ |
||
117 | 6 | public function getName(): string |
|
121 | |||
122 | /** |
||
123 | * @param string $name |
||
124 | * |
||
125 | * @return PaymentLine |
||
126 | */ |
||
127 | 9 | public function setName(string $name): self |
|
133 | |||
134 | /** |
||
135 | * @return int |
||
136 | */ |
||
137 | 6 | public function getQuantity(): int |
|
141 | |||
142 | /** |
||
143 | * @param int $quantity |
||
144 | * |
||
145 | * @return PaymentLine |
||
146 | */ |
||
147 | 9 | public function setQuantity(int $quantity): self |
|
153 | |||
154 | /** |
||
155 | * Returns the price excl vat. |
||
156 | * |
||
157 | * @return Money |
||
158 | */ |
||
159 | 6 | public function getPrice(): Money |
|
163 | |||
164 | /** |
||
165 | * @param Money $price |
||
166 | * |
||
167 | * @return PaymentLine |
||
168 | */ |
||
169 | 9 | public function setPrice(Money $price): self |
|
175 | |||
176 | /** |
||
177 | * Returns the VAT percentage. |
||
178 | * |
||
179 | * @return int |
||
180 | */ |
||
181 | 6 | public function getVat(): int |
|
185 | |||
186 | /** |
||
187 | * @param int $vat |
||
188 | * |
||
189 | * @return PaymentLine |
||
190 | */ |
||
191 | 9 | public function setVat(int $vat): self |
|
197 | |||
198 | /** |
||
199 | * @return Payment |
||
200 | */ |
||
201 | 3 | public function getPayment(): Payment |
|
205 | |||
206 | /** |
||
207 | * @param Payment $payment |
||
208 | * |
||
209 | * @return PaymentLine |
||
210 | */ |
||
211 | 6 | public function setPayment(Payment $payment): self |
|
217 | } |
||
218 |