diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..780e6838 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.php text eol=lf \ No newline at end of file diff --git a/src/Easybill/ZUGFeRD/Model/Trade/Agreement.php b/src/Easybill/ZUGFeRD/Model/Trade/Agreement.php index 0d30654d..34ddc0a7 100644 --- a/src/Easybill/ZUGFeRD/Model/Trade/Agreement.php +++ b/src/Easybill/ZUGFeRD/Model/Trade/Agreement.php @@ -7,6 +7,14 @@ class Agreement { + /** + * @var string + * @Type("string") + * @XmlElement(cdata = false, namespace = "urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:12") + * @SerializedName("BuyerReference") + */ + private $buyerReference; + /** * @var TradeParty * @Type("Easybill\ZUGFeRD\Model\Trade\TradeParty") @@ -23,6 +31,25 @@ class Agreement */ private $buyer; + /** + * @return string + */ + public function getBuyerReference() + { + return $this->name; + } + + /** + * @param string $buyerReference + * + * @return self + */ + public function setBuyerReference($buyerReference) + { + $this->buyerReference = $buyerReference; + return $this; + } + /** * @return \Easybill\ZUGFeRD\Model\Trade\TradeParty */ diff --git a/src/Easybill/ZUGFeRD/Tests/BuilderTest.php b/src/Easybill/ZUGFeRD/Tests/BuilderTest.php index 77be2ec4..bdc382fe 100644 --- a/src/Easybill/ZUGFeRD/Tests/BuilderTest.php +++ b/src/Easybill/ZUGFeRD/Tests/BuilderTest.php @@ -50,6 +50,7 @@ public function testGetXML() + AB-312 Lieferant GmbH @@ -216,6 +217,7 @@ public function testGetXML() private function setAgreement(\Easybill\ZUGFeRD\Model\Trade\Trade $trade) { $trade->getAgreement() + ->setBuyerReference('AB-312') ->setSeller( new \Easybill\ZUGFeRD\Model\Trade\TradeParty('Lieferant GmbH', new \Easybill\ZUGFeRD\Model\Address('80333', 'Lieferantenstraße 20', null, 'München', 'DE'),