Skip to content

Commit

Permalink
- order contact, purchasing contact, account number added
Browse files Browse the repository at this point in the history
- Allow more delivery terms
  • Loading branch information
Mads Møller committed Apr 2, 2019
1 parent daa90ba commit e8f0efe
Showing 1 changed file with 70 additions and 3 deletions.
73 changes: 70 additions & 3 deletions src/Generator/Orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ class Orders extends Message
/** @var array */
protected $orderDate;

/** @var array */
protected $orderContact;

/** @var array */
protected $purchasingContact;

/** @var array */
protected $documentDate;

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

/** @var array */
protected $accountNumber;

/** @var array */
protected $collectiveOrderNumber;

Expand Down Expand Up @@ -73,6 +82,11 @@ class Orders extends Message
'deliveryDate',
'deliveryDateLatest',
'deliveryDateEarliest',
'orderDescription',
'orderNotification',
'accountNumber',
'orderContact',
'purchasingContact',
'buyerAddress',
'consigneeAddress',
'deliveryPartyAddress',
Expand All @@ -81,8 +95,6 @@ class Orders extends Message
'storeKeeperAddress',
'invoiceAddress',
'supplierAddress',
'orderDescription',
'orderNotification',
'internalIdentifier',
'objectNumber',
'objectDescription1',
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e8f0efe

Please sign in to comment.