|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace VasilDakov\Speedy\Service\Shipment; |
|
6
|
|
|
|
|
7
|
|
|
use Doctrine\Common\Collections\ArrayCollection; |
|
8
|
|
|
use JMS\Serializer\Annotation as Serializer; |
|
9
|
|
|
|
|
10
|
|
|
/** |
|
11
|
|
|
* Class ShipmentPrice |
|
12
|
|
|
* |
|
13
|
|
|
* @Serializer\AccessType("public_method") |
|
14
|
|
|
* @author Vasil Dakov <[email protected]> |
|
15
|
|
|
* @copyright 2009-2022 Neutrino.bg |
|
16
|
|
|
* @version 1.0 |
|
17
|
|
|
*/ |
|
18
|
|
|
class ShipmentPrice |
|
19
|
|
|
{ |
|
20
|
|
|
/** |
|
21
|
|
|
* @var float |
|
22
|
|
|
* @Serializer\Type("float") |
|
23
|
|
|
*/ |
|
24
|
|
|
private float $amount; |
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* @var float |
|
28
|
|
|
* @Serializer\Type("float") |
|
29
|
|
|
*/ |
|
30
|
|
|
private float $vat; |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* @var float |
|
34
|
|
|
* @Serializer\Type("float") |
|
35
|
|
|
*/ |
|
36
|
|
|
private float $total; |
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* @var string |
|
40
|
|
|
* @Serializer\Type("string") |
|
41
|
|
|
*/ |
|
42
|
|
|
private string $currency; |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* @var ArrayCollection |
|
46
|
|
|
* @Serializer\Type("ArrayCollection<string, VasilDakov\Speedy\Service\Shipment\ShipmentPriceAmount>") |
|
47
|
|
|
*/ |
|
48
|
|
|
private ArrayCollection $details; |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* @var float |
|
52
|
|
|
* @Serializer\Type("float") |
|
53
|
|
|
*/ |
|
54
|
|
|
private float $amountLocal; |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* @var float |
|
58
|
|
|
* @Serializer\Type("float") |
|
59
|
|
|
*/ |
|
60
|
|
|
private float $vatLocal; |
|
61
|
|
|
|
|
62
|
|
|
/** |
|
63
|
|
|
* @var float |
|
64
|
|
|
* @Serializer\Type("float") |
|
65
|
|
|
*/ |
|
66
|
|
|
private float $totalLocal; |
|
67
|
|
|
|
|
68
|
|
|
/** |
|
69
|
|
|
* @var string |
|
70
|
|
|
* @Serializer\Type("string") |
|
71
|
|
|
*/ |
|
72
|
|
|
private string $currencyLocal; |
|
73
|
|
|
|
|
74
|
|
|
/** |
|
75
|
|
|
* @var ArrayCollection |
|
76
|
|
|
* @Serializer\Type("ArrayCollection<string, VasilDakov\Speedy\Service\Shipment\ShipmentPriceAmount>") |
|
77
|
|
|
*/ |
|
78
|
|
|
private ArrayCollection $detailsLocal; |
|
79
|
|
|
|
|
80
|
|
|
/** |
|
81
|
|
|
* @var int |
|
82
|
|
|
* @Serializer\Type("integer") |
|
83
|
|
|
*/ |
|
84
|
|
|
private int $currencyExchangeRateUnit; |
|
85
|
|
|
|
|
86
|
|
|
/** |
|
87
|
|
|
* @var float |
|
88
|
|
|
* @Serializer\Type("float") |
|
89
|
|
|
*/ |
|
90
|
|
|
private float $currencyExchangeRate; |
|
91
|
|
|
|
|
92
|
|
|
/** |
|
93
|
|
|
* @var ?ReturnAmounts |
|
94
|
|
|
* @Serializer\Type("VasilDakov\Speedy\Service\Shipment\ReturnAmounts") |
|
95
|
|
|
*/ |
|
96
|
|
|
private ?ReturnAmounts $returnAmounts = null; |
|
97
|
|
|
|
|
98
|
|
|
|
|
99
|
2 |
|
public function __construct() |
|
100
|
|
|
{ |
|
101
|
2 |
|
$this->details = new ArrayCollection(); |
|
102
|
2 |
|
$this->detailsLocal = new ArrayCollection(); |
|
103
|
|
|
} |
|
104
|
|
|
|
|
105
|
|
|
|
|
106
|
|
|
/** |
|
107
|
|
|
* @return float |
|
108
|
|
|
*/ |
|
109
|
2 |
|
public function getAmount(): float |
|
110
|
|
|
{ |
|
111
|
2 |
|
return $this->amount; |
|
112
|
|
|
} |
|
113
|
|
|
|
|
114
|
|
|
/** |
|
115
|
|
|
* @param float $amount |
|
116
|
|
|
*/ |
|
117
|
6 |
|
public function setAmount(float $amount): void |
|
118
|
|
|
{ |
|
119
|
6 |
|
$this->amount = $amount; |
|
120
|
|
|
} |
|
121
|
|
|
|
|
122
|
|
|
/** |
|
123
|
|
|
* @return float |
|
124
|
|
|
*/ |
|
125
|
2 |
|
public function getVat(): float |
|
126
|
|
|
{ |
|
127
|
2 |
|
return $this->vat; |
|
128
|
|
|
} |
|
129
|
|
|
|
|
130
|
|
|
/** |
|
131
|
|
|
* @param float $vat |
|
132
|
|
|
*/ |
|
133
|
5 |
|
public function setVat(float $vat): void |
|
134
|
|
|
{ |
|
135
|
5 |
|
$this->vat = $vat; |
|
136
|
|
|
} |
|
137
|
|
|
|
|
138
|
|
|
/** |
|
139
|
|
|
* @return float |
|
140
|
|
|
*/ |
|
141
|
2 |
|
public function getTotal(): float |
|
142
|
|
|
{ |
|
143
|
2 |
|
return $this->total; |
|
144
|
|
|
} |
|
145
|
|
|
|
|
146
|
|
|
/** |
|
147
|
|
|
* @param float $total |
|
148
|
|
|
*/ |
|
149
|
5 |
|
public function setTotal(float $total): void |
|
150
|
|
|
{ |
|
151
|
5 |
|
$this->total = $total; |
|
152
|
|
|
} |
|
153
|
|
|
|
|
154
|
|
|
/** |
|
155
|
|
|
* @return string |
|
156
|
|
|
*/ |
|
157
|
2 |
|
public function getCurrency(): string |
|
158
|
|
|
{ |
|
159
|
2 |
|
return $this->currency; |
|
160
|
|
|
} |
|
161
|
|
|
|
|
162
|
|
|
/** |
|
163
|
|
|
* @param string $currency |
|
164
|
|
|
*/ |
|
165
|
2 |
|
public function setCurrency(string $currency): void |
|
166
|
|
|
{ |
|
167
|
2 |
|
$this->currency = $currency; |
|
168
|
|
|
} |
|
169
|
|
|
|
|
170
|
|
|
/** |
|
171
|
|
|
* @codeCoverageIgnore |
|
172
|
|
|
* @return ArrayCollection |
|
173
|
|
|
*/ |
|
174
|
|
|
public function getDetails(): ArrayCollection |
|
175
|
|
|
{ |
|
176
|
|
|
return $this->details; |
|
177
|
|
|
} |
|
178
|
|
|
|
|
179
|
|
|
/** |
|
180
|
|
|
* @codeCoverageIgnore |
|
181
|
|
|
* @param ArrayCollection $details |
|
182
|
|
|
*/ |
|
183
|
|
|
public function setDetails(ArrayCollection $details): void |
|
184
|
|
|
{ |
|
185
|
|
|
$this->details = $details; |
|
186
|
|
|
} |
|
187
|
|
|
|
|
188
|
|
|
/** |
|
189
|
|
|
* @return float |
|
190
|
|
|
*/ |
|
191
|
2 |
|
public function getAmountLocal(): float |
|
192
|
|
|
{ |
|
193
|
2 |
|
return $this->amountLocal; |
|
194
|
|
|
} |
|
195
|
|
|
|
|
196
|
|
|
/** |
|
197
|
|
|
* @param float $amountLocal |
|
198
|
|
|
*/ |
|
199
|
5 |
|
public function setAmountLocal(float $amountLocal): void |
|
200
|
|
|
{ |
|
201
|
5 |
|
$this->amountLocal = $amountLocal; |
|
202
|
|
|
} |
|
203
|
|
|
|
|
204
|
|
|
/** |
|
205
|
|
|
* @return float |
|
206
|
|
|
*/ |
|
207
|
2 |
|
public function getVatLocal(): float |
|
208
|
|
|
{ |
|
209
|
2 |
|
return $this->vatLocal; |
|
210
|
|
|
} |
|
211
|
|
|
|
|
212
|
|
|
/** |
|
213
|
|
|
* @param float $vatLocal |
|
214
|
|
|
*/ |
|
215
|
5 |
|
public function setVatLocal(float $vatLocal): void |
|
216
|
|
|
{ |
|
217
|
5 |
|
$this->vatLocal = $vatLocal; |
|
218
|
|
|
} |
|
219
|
|
|
|
|
220
|
|
|
/** |
|
221
|
|
|
* @return float |
|
222
|
|
|
*/ |
|
223
|
2 |
|
public function getTotalLocal(): float |
|
224
|
|
|
{ |
|
225
|
2 |
|
return $this->totalLocal; |
|
226
|
|
|
} |
|
227
|
|
|
|
|
228
|
|
|
/** |
|
229
|
|
|
* @param float $totalLocal |
|
230
|
|
|
*/ |
|
231
|
5 |
|
public function setTotalLocal(float $totalLocal): void |
|
232
|
|
|
{ |
|
233
|
5 |
|
$this->totalLocal = $totalLocal; |
|
234
|
|
|
} |
|
235
|
|
|
|
|
236
|
|
|
/** |
|
237
|
|
|
* @return string |
|
238
|
|
|
*/ |
|
239
|
2 |
|
public function getCurrencyLocal(): string |
|
240
|
|
|
{ |
|
241
|
2 |
|
return $this->currencyLocal; |
|
242
|
|
|
} |
|
243
|
|
|
|
|
244
|
|
|
/** |
|
245
|
|
|
* @param string $currencyLocal |
|
246
|
|
|
*/ |
|
247
|
5 |
|
public function setCurrencyLocal(string $currencyLocal): void |
|
248
|
|
|
{ |
|
249
|
5 |
|
$this->currencyLocal = $currencyLocal; |
|
250
|
|
|
} |
|
251
|
|
|
|
|
252
|
|
|
/** |
|
253
|
|
|
* @codeCoverageIgnore |
|
254
|
|
|
* @return ArrayCollection |
|
255
|
|
|
*/ |
|
256
|
|
|
public function getDetailsLocal(): ArrayCollection |
|
257
|
|
|
{ |
|
258
|
|
|
return $this->detailsLocal; |
|
259
|
|
|
} |
|
260
|
|
|
|
|
261
|
|
|
/** |
|
262
|
|
|
* @codeCoverageIgnore |
|
263
|
|
|
* @param ArrayCollection $detailsLocal |
|
264
|
|
|
*/ |
|
265
|
|
|
public function setDetailsLocal(ArrayCollection $detailsLocal): void |
|
266
|
|
|
{ |
|
267
|
|
|
$this->detailsLocal = $detailsLocal; |
|
268
|
|
|
} |
|
269
|
|
|
|
|
270
|
|
|
/** |
|
271
|
|
|
* @return int |
|
272
|
|
|
*/ |
|
273
|
2 |
|
public function getCurrencyExchangeRateUnit(): int |
|
274
|
|
|
{ |
|
275
|
2 |
|
return $this->currencyExchangeRateUnit; |
|
276
|
|
|
} |
|
277
|
|
|
|
|
278
|
|
|
/** |
|
279
|
|
|
* @param int $currencyExchangeRateUnit |
|
280
|
|
|
*/ |
|
281
|
5 |
|
public function setCurrencyExchangeRateUnit(int $currencyExchangeRateUnit): void |
|
282
|
|
|
{ |
|
283
|
5 |
|
$this->currencyExchangeRateUnit = $currencyExchangeRateUnit; |
|
284
|
|
|
} |
|
285
|
|
|
|
|
286
|
|
|
/** |
|
287
|
|
|
* @return float |
|
288
|
|
|
*/ |
|
289
|
2 |
|
public function getCurrencyExchangeRate(): float |
|
290
|
|
|
{ |
|
291
|
2 |
|
return $this->currencyExchangeRate; |
|
292
|
|
|
} |
|
293
|
|
|
|
|
294
|
|
|
/** |
|
295
|
|
|
* @param float $currencyExchangeRate |
|
296
|
|
|
*/ |
|
297
|
5 |
|
public function setCurrencyExchangeRate(float $currencyExchangeRate): void |
|
298
|
|
|
{ |
|
299
|
5 |
|
$this->currencyExchangeRate = $currencyExchangeRate; |
|
300
|
|
|
} |
|
301
|
|
|
|
|
302
|
|
|
/** |
|
303
|
|
|
* @return ?ReturnAmounts |
|
304
|
|
|
*/ |
|
305
|
1 |
|
public function getReturnAmounts(): ?ReturnAmounts |
|
306
|
|
|
{ |
|
307
|
1 |
|
return $this->returnAmounts; |
|
308
|
|
|
} |
|
309
|
|
|
|
|
310
|
|
|
/** |
|
311
|
|
|
* @param ?ReturnAmounts $returnAmounts |
|
312
|
|
|
*/ |
|
313
|
|
|
public function setReturnAmounts(?ReturnAmounts $returnAmounts): void |
|
314
|
|
|
{ |
|
315
|
|
|
$this->returnAmounts = $returnAmounts; |
|
316
|
|
|
} |
|
317
|
|
|
} |
|
318
|
|
|
|