-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathPrice.php
More file actions
100 lines (87 loc) · 2.3 KB
/
Price.php
File metadata and controls
100 lines (87 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
declare(strict_types=1);
namespace Easybill\ZUGFeRD\Model\Trade\Item;
use Easybill\ZUGFeRD\Model\AllowanceCharge;
use Easybill\ZUGFeRD\Model\Trade\Amount;
use JMS\Serializer\Annotation as JMS;
/**
* @deprecated ZUGFeRD 1.0 is deprecated and will be removed in a future release. Please migrate to ZUGFeRD 2.0 (Easybill\ZUGFeRD2).
*/
class Price
{
/**
* @var Amount
*/
#[JMS\Type(Amount::class)]
#[JMS\XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:12')]
#[JMS\SerializedName('ChargeAmount')]
private $amount;
/**
* @var Quantity
*/
#[JMS\Type(Quantity::class)]
#[JMS\XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:12')]
#[JMS\SerializedName('BasisQuantity')]
private $quantity;
/**
* @var AllowanceCharge[]
*/
#[JMS\Type('array<Easybill\ZUGFeRD\Model\AllowanceCharge>')]
#[JMS\XmlList(entry: 'AppliedTradeAllowanceCharge', inline: true, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:12')]
private $allowanceCharges = [];
/**
* GrossPrice constructor.
*
* @param float $value
* @param string $currency
* @param bool $isSum
*/
public function __construct($value, $currency = 'EUR', $isSum = true)
{
$this->amount = new Amount($value, $currency, $isSum);
}
/**
* @return Amount
*/
public function getAmount()
{
return $this->amount;
}
/**
* @param Amount $amount
*/
public function setAmount($amount)
{
$this->amount = $amount;
}
/**
* @return AllowanceCharge[]
*/
public function getAllowanceCharges()
{
return $this->allowanceCharges;
}
/**
* @return self
*/
public function addAllowanceCharge(AllowanceCharge $allowanceCharge)
{
$this->allowanceCharges[] = $allowanceCharge;
return $this;
}
/**
* @return Quantity
*/
public function getQuantity()
{
return $this->quantity;
}
/**
* @return self
*/
public function setQuantity(Quantity $quantity)
{
$this->quantity = $quantity;
return $this;
}
}