Skip to content

Commit e8f0efe

Browse files
author
Mads Møller
committed
- order contact, purchasing contact, account number added
- Allow more delivery terms
1 parent daa90ba commit e8f0efe

File tree

1 file changed

+70
-3
lines changed

1 file changed

+70
-3
lines changed

src/Generator/Orders.php

Lines changed: 70 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ class Orders extends Message
2626
/** @var array */
2727
protected $orderDate;
2828

29+
/** @var array */
30+
protected $orderContact;
31+
32+
/** @var array */
33+
protected $purchasingContact;
34+
2935
/** @var array */
3036
protected $documentDate;
3137

@@ -38,6 +44,9 @@ class Orders extends Message
3844
/** @var array */
3945
protected $deliveryDateEarliest;
4046

47+
/** @var array */
48+
protected $accountNumber;
49+
4150
/** @var array */
4251
protected $collectiveOrderNumber;
4352

@@ -73,6 +82,11 @@ class Orders extends Message
7382
'deliveryDate',
7483
'deliveryDateLatest',
7584
'deliveryDateEarliest',
85+
'orderDescription',
86+
'orderNotification',
87+
'accountNumber',
88+
'orderContact',
89+
'purchasingContact',
7690
'buyerAddress',
7791
'consigneeAddress',
7892
'deliveryPartyAddress',
@@ -81,8 +95,6 @@ class Orders extends Message
8195
'storeKeeperAddress',
8296
'invoiceAddress',
8397
'supplierAddress',
84-
'orderDescription',
85-
'orderNotification',
8698
'internalIdentifier',
8799
'objectNumber',
88100
'objectDescription1',
@@ -212,6 +224,44 @@ public function setOrderDate($orderDate)
212224
return $this;
213225
}
214226

227+
/**
228+
* @return array
229+
*/
230+
public function getOrderContact()
231+
{
232+
return $this->orderContact;
233+
}
234+
235+
/**
236+
* @param string $name
237+
* @param string $identifier
238+
* @return Orders
239+
*/
240+
public function setOrderContact($name, $identifier = '')
241+
{
242+
$this->orderContact = ['CTA', 'OC', [$identifier, $name]];
243+
return $this;
244+
}
245+
246+
/**
247+
* @return array
248+
*/
249+
public function getPurchasingContact()
250+
{
251+
return $this->purchasingContact;
252+
}
253+
254+
/**
255+
* @param string $name
256+
* @param string $identifier
257+
* @return Orders
258+
*/
259+
public function setPurchasingContact($name, $identifier = '')
260+
{
261+
$this->purchasingContact = ['CTA', 'PD', [$identifier, $name]];
262+
return $this;
263+
}
264+
215265
/**
216266
* @return array
217267
*/
@@ -292,7 +342,24 @@ public function setDeliveryDateEarliest($deliveryDateEarliest, $formatQuantifier
292342
return $this;
293343
}
294344

345+
/**
346+
* @param $accountNumber
347+
* @return Orders
348+
* @throws \EDI\Generator\EdifactException
349+
*/
350+
public function setAccountNumber($accountNumber)
351+
{
352+
$this->accountNumber = $this->addRFFSegment('ADE', $accountNumber);
353+
return $this;
354+
}
295355

356+
/**
357+
* @return array
358+
*/
359+
public function getAccountNumber()
360+
{
361+
return $this->accountNumber;
362+
}
296363

297364
/**
298365
* @return array
@@ -442,7 +509,7 @@ public function setDeliveryTerms($deliveryTerms)
442509
{
443510
$this->isAllowed(
444511
$deliveryTerms,
445-
['CAF', 'DDP', 'DAF', 'FCA', 'CAI', 'ZZZ']
512+
['CAF', 'CIP', 'CPT', 'DDP', 'DAF', 'FCA', 'CAI', 'ZZZ']
446513
);
447514
$this->deliveryTerms = ['TOD', '6', '', $deliveryTerms];
448515
return $this;

0 commit comments

Comments
 (0)