From e8f0efe85f4d68b74c5bac1ed1e830fbb2510bc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mads=20M=C3=B8ller?= Date: Tue, 2 Apr 2019 15:46:22 +0200 Subject: [PATCH] - order contact, purchasing contact, account number added - Allow more delivery terms --- src/Generator/Orders.php | 73 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 70 insertions(+), 3 deletions(-) diff --git a/src/Generator/Orders.php b/src/Generator/Orders.php index 46853b7..5ffa55d 100755 --- a/src/Generator/Orders.php +++ b/src/Generator/Orders.php @@ -26,6 +26,12 @@ class Orders extends Message /** @var array */ protected $orderDate; + /** @var array */ + protected $orderContact; + + /** @var array */ + protected $purchasingContact; + /** @var array */ protected $documentDate; @@ -38,6 +44,9 @@ class Orders extends Message /** @var array */ protected $deliveryDateEarliest; + /** @var array */ + protected $accountNumber; + /** @var array */ protected $collectiveOrderNumber; @@ -73,6 +82,11 @@ class Orders extends Message 'deliveryDate', 'deliveryDateLatest', 'deliveryDateEarliest', + 'orderDescription', + 'orderNotification', + 'accountNumber', + 'orderContact', + 'purchasingContact', 'buyerAddress', 'consigneeAddress', 'deliveryPartyAddress', @@ -81,8 +95,6 @@ class Orders extends Message 'storeKeeperAddress', 'invoiceAddress', 'supplierAddress', - 'orderDescription', - 'orderNotification', 'internalIdentifier', 'objectNumber', 'objectDescription1', @@ -212,6 +224,44 @@ public function setOrderDate($orderDate) return $this; } + /** + * @return array + */ + public function getOrderContact() + { + return $this->orderContact; + } + + /** + * @param string $name + * @param string $identifier + * @return Orders + */ + public function setOrderContact($name, $identifier = '') + { + $this->orderContact = ['CTA', 'OC', [$identifier, $name]]; + return $this; + } + + /** + * @return array + */ + public function getPurchasingContact() + { + return $this->purchasingContact; + } + + /** + * @param string $name + * @param string $identifier + * @return Orders + */ + public function setPurchasingContact($name, $identifier = '') + { + $this->purchasingContact = ['CTA', 'PD', [$identifier, $name]]; + return $this; + } + /** * @return array */ @@ -292,7 +342,24 @@ public function setDeliveryDateEarliest($deliveryDateEarliest, $formatQuantifier return $this; } + /** + * @param $accountNumber + * @return Orders + * @throws \EDI\Generator\EdifactException + */ + public function setAccountNumber($accountNumber) + { + $this->accountNumber = $this->addRFFSegment('ADE', $accountNumber); + return $this; + } + /** + * @return array + */ + public function getAccountNumber() + { + return $this->accountNumber; + } /** * @return array @@ -442,7 +509,7 @@ public function setDeliveryTerms($deliveryTerms) { $this->isAllowed( $deliveryTerms, - ['CAF', 'DDP', 'DAF', 'FCA', 'CAI', 'ZZZ'] + ['CAF', 'CIP', 'CPT', 'DDP', 'DAF', 'FCA', 'CAI', 'ZZZ'] ); $this->deliveryTerms = ['TOD', '6', '', $deliveryTerms]; return $this;