Remove own EDI since AnsiX12 docs suck

This commit is contained in:
Dennis Eichhorn 2017-11-14 19:47:18 +01:00
parent cfe1af3676
commit 6628f8d7cf
286 changed files with 0 additions and 1897 deletions

View File

@ -1,30 +0,0 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types = 1);
namespace phpOMS\Utils\EDI\AnsiX12\Components;
/**
* EDI Header
*
* @link https://www.erico.com/public/library/edi/ERICO850_4010.pdf
* @category Framework
* @package phpOMS\Utils\Converter
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
class BEG
{
}

View File

@ -1,97 +0,0 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types = 1);
namespace phpOMS\Utils\EDI\AnsiX12\Components;
/**
* EDI Header
*
* @link https://www.erico.com/public/library/edi/ERICO850_4010.pdf
* @category Framework
* @package phpOMS\Utils\Converter
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
class BIG
{
private $invoiceDate = null;
private $purchaseDate = null;
private $invoice = '';
private $purchase = '';
private $transactionTypeCode = 0;
public function setInvoiceDate(\DateTime $invoiceDate) /* : void */
{
$this->invoiceDate = $invoiceDate;
}
public function getInvoiceDate() : string
{
return $this->invoiceDate->format('Ymd');
}
public function setInvoiceNumber(string $invoice) /* : void */
{
if (strlen($invoice) < 1 || strlen($invoice) > 22) {
throw new \Exception();
}
$this->invoice = $invoice;
}
public function getInvoiceNumber() : string
{
return $this->invoice;
}
public function setPurchaseDate(\DateTime $purchaseDate) /* : void */
{
$this->purchaseDate = $purchaseDate;
}
public function getPurchaseDate() : string
{
return $this->purchaseDate->format('Ymd');
}
public function setPurchaseNumber(string $purchase) /* : void */
{
if (strlen($purchase) < 1 || strlen($purchase) > 22) {
throw new \Exception();
}
$this->purchase = $purchase;
}
public function getPurchaseNumber() : string
{
return $this->purchase;
}
public function setTransactionTypeCode(int $code) /* : void */
{
if ($code < 10 || $code > 99) {
throw new \Exception();
}
$this->transactionTypeCode = $code;
}
public function getTransactionTypeCode() : string
{
return str_pad((string) $this->transactionTypeCode, 2, '0', STR_PAD_LEFT);
}
}

View File

@ -1,176 +0,0 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types = 1);
namespace phpOMS\Utils\EDI\AnsiX12\Components;
/**
* EDI Header
*
* @category Framework
* @package phpOMS\Utils\Converter
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
class GS
{
private $functionalGroupHeader = 'GS';
private $functionalIdentifierCode = FunctionalIdentifierCode::PO;
private $applicationSenderCode = '';
private $appicationReceiverCode = '';
private $date = null;
private $groupControlNumber = 0;
private $responsibleAgencyCode = '';
private $version = '';
public function __construct()
{
$this->date = new \DateTime();
}
public function getFunctionalGroupHeader() : string
{
return $this->functionalGroupHeader;
}
public function getFunctionalIdentifierCode() : string
{
return $this->functionalIdentifierCode;
}
public function setFunctionalIdentifierCode(string $code) /* : void */
{
if (!FunctionalIdentifierCode::isValidValue($code)) {
throw \Exception();
}
$this->functionalIdentifierCode = $code;
}
public function getApplicationSenderCode() : string
{
return str_pad((string) $this->applicationSenderCode, 2, '0', STR_PAD_LEFT);
}
public function setApplicationSenderCode(string $code) /* : void */
{
if (strlen($code) < 2 || strlen($code) > 15) {
throw new \Exception();
}
$this->applicationSenderCode = $code;
}
public function getApplicationReceiverCode() : string
{
return str_pad((string) $this->applicationReceiverCode, 2, '0', STR_PAD_LEFT);
}
public function setApplicationReceiverCode(string $code) /* : void */
{
if (strlen($code) < 2 || strlen($code) > 15) {
throw new \Exception();
}
$this->applicationReceiverCode = $code;
}
public function setDate(\DateTime $date) /* : void */
{
$this->date = $date;
}
public function getDate() : string
{
return $this->date->format('d:m:y');
}
public function getTime() : string
{
return $this->date->format('d:m:y');
}
public function getGroupControlNumber() : int
{
return $this->groupControlNumber;
}
public function setGroupControlNumber(int $number) /* : void */
{
if ($number < 0) {
throw new \Exception();
}
$this->groupControlNumber = $number;
}
public function getResponsibleAgencyCode() : int
{
return $this->responsibleAgencyCode;
}
public function setResponsibleAgencyCode(int $code) /* : void */
{
if ($code < 0 || $code > 99) {
throw new \Exception();
}
$this->responsibleAgencyCode = $code;
}
public function getVersion() : string
{
return $this->version;
}
public function setVersion(string $version) /* : void */
{
$this->version = $version;
}
public function serialize()
{
return $this->functionalGroupHeader . '*'
. $this->getFunctionalIdentifierCode() . '*'
. $this->getApplicationSenderCode() . '*'
. $this->getApplicationReceiverCode() . '*'
. $this->getDate() . '*'
. $this->getTime() . '*'
. $this->getGroupControlNumber() . '*'
. $this->getResponsibleAgencyCode() . '*'
. $this->getVersion() . '*' . self::COMPONENT_ELEMENT_SEPARATOR;
}
public function unserialize($raw)
{
$split = explode($raw, '*');
$this->setFunctionalGroupHeader(trim($split[0]));
$this->setFunctionalIdentifierCode(trim($split[1]));
$this->setApplicationSenderCode(trim($split[2]));
$this->setApplicationReceiverCode(trim($split[3]));
$this->setDate(new \DateTime(trim($split[4]) . '-' . trim($split[5])));
$this->setGroupControlNumber(trim($split[6]));
$this->setResponsibleAgencyCode((int) trim($split[7]));
$this->setVersion(trim($split[8]));
}
}

View File

@ -1,427 +0,0 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types = 1);
namespace phpOMS\Utils\EDI\AnsiX12\Components;
/**
* EDI Header
*
* @link https://www.erico.com/public/library/edi/ERICO850_4010.pdf
* @category Framework
* @package phpOMS\Utils\Converter
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
class ISA
{
/* private */ const COMPONENT_ELEMENT_SEPARATOR = '>';
private $interchangeControlHeader = 'ISA';
/**
* Code to identify the type of information in the Authorization Information.
*
* Req: M
* Type: ID
* Min/Max: 2/2
* Usage: Must
*
* 00 = No Authorization Information available
*
* @var int
* @since 1.0.0
*/
private $authorizationInformationQualifier = 0;
/**
* Information used for additional identification or authorization of the interchange
* sender or the data in the interchange; the type of information is set by the Authorization
* Information Qualifier.
*
* Req: M
* Type: AN
* Min/Max: 10/10
* Usage: Must
*
* @var string
* @since 1.0.0
*/
private $authorizationInformation = '';
/**
* Code to identify the type of information in the Security Information.
*
* Req: M
* Type: ID
* Min/Max: 2/2
* Usage: Must
*
* 00 = No Security Information available
*
* @var int
* @since 1.0.0
*/
private $securityInformationQualifer = 0;
/**
* This is used for identifying the security information about the interchange
* sender or the data in the interchange; the type of information is set by the Security
* Information Qualifier.
*
* Req: M
* Type: AN
* Min/Max: 10/10
* Usage: Must
*
* @var string
* @since 1.0.0
*/
private $securityInformation = '';
/**
* Qualifier to designate the system/method of code structure used to designate
* the sender or receiver ID element being qualifiedn.
*
* Req: M
* Type: ID
* Min/Max: 2/2
* Usage: Must
*
* 00 = No Security Information available
*
* @var int
* @since 1.0.0
*/
private $interchangeIdQualifier = 0;
/**
* Interchange Sender
*
* Req: M
* Type: AN
* Min/Max: 15/15
* Usage: Must
*
* @var string
* @since 1.0.0
*/
private $interchangeSender = '';
/**
* DateTime of the interchange
*
* Req: M
* Type: DTM
* Usage: Must
*
* @var \DateTime
* @since 1.0.0
*/
private $interchangeDateTime = null;
/**
* Code to identify the agency responsible for the control standard used by the
* message that is enclosed by the interchange header and trailer.
*
* Req: M
* Type: ID
* Min/Max: 1/1
* Usage: Must
*
* @var string
* @since 1.0.0
*/
private $interchangeControlStandardId = '';
/**
* Code specifying the version number of the interchange control segments.
*
* Req: M
* Type: ID
* Min/Max: 5/5
* Usage: Must
*
* @var int
* @since 1.0.0
*/
private $interchangeControlVersionNumber = 401;
/**
* A control number assigned by the interchange sender.
*
* Req: M
* Type: int
* Min/Max: 9/9
* Usage: Must
*
* @var int
* @since 1.0.0
*/
private $interchangeControlNumber = 0;
/**
* Code sent by the sender to request an interchange acknowledgment.
*
* Req: M
* Type: bool
* Min/Max: 1/1
* Usage: Must
*
* @var bool
* @since 1.0.0
*/
private $acknowledgementRequested = false;
/**
* Code to indicate whether data enclosed by this interchange envelope is test,
* production or information.
*
* Req: M
* Type: ID
* Min/Max: 1/1
* Usage: Must
*
* @var int
* @since 1.0.0
*/
private $usageIndicator = 'T';
public function setInterchangeControlHeader(string $header) /* : void */
{
$this->interchangeControlHeader = $header;
}
public function setAuthorizationInformationQualifier(int $qualifer) /* : void */
{
if ($qualifer > 99) {
throw new \Exception();
}
$this->authorizationInformationQualifier = $qualifier;
}
public function getAuthorizationInformationQualifier() : string
{
return str_pad((string) $this->authorizationInformationQualifier, 2, '0', STR_PAD_LEFT);
}
public function setAuthorizationInformation(string $information) /* : void */
{
if (strlen($information) > 10) {
throw new \Exception();
}
$this->authorizationInformation = $information;
}
public function getAuthorizationInformation() : string
{
return str_pad((string) $this->authorizationInformation, 10, ' ', STR_PAD_RIGHT);
}
public function setSecurityInformationQualifer(int $qualifer) /* : void */
{
if ($qualifer > 99) {
throw new \Exception();
}
$this->securityInformationQualifer = $qualifier;
}
public function getSecurityInformationQualifer() : string
{
return str_pad((string) $this->securityInformationQualifer, 2, '0', STR_PAD_LEFT);
}
public function setSecurityInformation(string $information) /* : void */
{
if (strlen($information) > 10) {
throw new \Exception();
}
$this->securityInformation = $information;
}
public function getSecurityInformation() : string
{
return str_pad((string) $this->securityInformation, 10, ' ', STR_PAD_RIGHT);
}
public function setInterchangeIdQualifier(int $qualifer) /* : void */
{
if ($qualifer > 99) {
throw new \Exception();
}
$this->interchangeIdQualifier = $qualifier;
}
public function getInterchangeIdQualifier() : string
{
return str_pad((string) $this->interchangeIdQualifier, 2, '0', STR_PAD_LEFT);
}
public function setInterchangeSender(string $information) /* : void */
{
if (strlen($information) > 15) {
throw new \Exception();
}
$this->interchangeSender = $information;
}
public function getInterchangeSender() : string
{
return str_pad((string) $this->interchangeSender, 15, ' ', STR_PAD_RIGHT);
}
public function setInterchangeReceiver(string $information) /* : void */
{
if (strlen($information) > 15) {
throw new \Exception();
}
$this->interchangeReceiver = $information;
}
public function getInterchangeReceiver() : string
{
return str_pad((string) $this->interchangeReceiver, 15, ' ', STR_PAD_RIGHT);
}
public function setInterchangeDatetime(\DateTime $interchange) /* : void */
{
$this->interchangeDateTime = $interchange;
}
public function getInterchangeDate() : string
{
return $this->interchangeDateTime->format('d:m:y');
}
public function getInterchangeTime() : string
{
return $this->interchangeDateTime->format('H:i');
}
public function setInterchangeControlStandardId(string $id) /* : void */
{
if (strlen($id) !== 1) {
throw new \Exception();
}
$this->interchangeControlStandardId = $id;
}
public function getInterchangeControlStandardId() : string
{
return $this->interchangeControlStandardId;
}
public function setInterchangeControlVersionNumber(int $version) /* : void */
{
if ($version > 99999) {
throw new \Exception();
}
$this->interchangeControlVersionNumber = $version;
}
public function getInterchangeControlVersionNumber() : string
{
return str_pad((string) $this->interchangeControlVersionNumber, 5, '0', STR_PAD_LEFT);
}
public function setInterchangeControlNumber(int $number) /* : void */
{
if ($number > 999999999) {
throw new \Exception();
}
$this->interchangeControlNumber = $number;
}
public function getInterchangeControlNumber() : string
{
return str_pad((string) $this->interchangeControlNumber, 9, '0', STR_PAD_LEFT);
}
public function setAcknowledgmentRequested(bool $ack) /* : void */
{
$this->acknowledgmentRequested = $ack;
}
public function getAcknowledgmentRequested() : string
{
return (string) $this->acknowledgmentRequested;
}
public function setUsageUndicator(string $id) /* : void */
{
if (strlen($id) !== 1) {
throw new \Exception();
}
$this->usageIndicator = $id;
}
public function getUsageUndicator() : string
{
return $this->usageIndicator;
}
public function serialize()
{
return $this->interchangeControlHeader . '*'
. $this->getAuthorizationInformationQualifier() . '*'
. $this->getAuthorizationInformation() . '*'
. $this->getSecurityInformationQualifer() . '*'
. $this->getSecurityInformation() . '*'
. $this->getInterchangeIdQualifier() . '*'
. $this->getInterchangeSender() . '*'
. $this->getInterchangeIdQualifier() . '*'
. $this->getInterchangeReceiver() . '*'
. $this->getInterchangeDate() . '*'
. $this->getInterchangeTime() . '*'
. $this->getInterchangeControlStandardId() . '*'
. $this->getInterchangeControlVersionNumber() . '*'
. $this->getInterchangeControlNumber() . '*'
. $this->getAcknowledgmentRequested() . '*'
. $this->getUsageUndicator() . '*' . self::COMPONENT_ELEMENT_SEPARATOR;
}
public function unserialize($raw)
{
$split = explode('*', $raw);
$this->setInterchangeControlHeader(trim($split[0]));
$this->setAuthorizationInformationQualifier((int) trim($split[1]));
$this->setAuthorizationInformation(trim($split[2]));
$this->setSecurityInformationQualifer((int) trim($split[3]));
$this->setSecurityInformation(trim($split[4]));
$this->setInterchangeIdQualifier((int) trim($split[5]));
$this->setInterchangeSender(trim($split[6]));
$this->setInterchangeReceiver(trim($split[8]));
$this->setInterchangeDatetime(new \DateTime(trim($split[9]) . '-' . trim($split[10])));
$this->setInterchangeControlStandardId(trim($split[11]));
$this->setInterchangeControlVersionNumber((int) trim($split[12]));
$this->setInterchangeControlNumber((int) trim($split[13]));
$this->setAcknowledgmentRequested((bool) $split[14]);
$this->setUsageUndicator($split[15]);
}
}

View File

@ -1,82 +0,0 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types = 1);
namespace phpOMS\Utils\EDI\AnsiX12\Components;
/**
* EDI Header
*
* @category Framework
* @package phpOMS\Utils\Converter
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
class ST
{
/* private */ const IDENTIFIER = 'ST';
private $transactionSetIdentifierCode = 0;
private $transactionSetControlNumber = '';
public function __construct(int $idCode = 0)
{
$this->transactionSetIdentifierCode = $idCode;
}
public function setTransactionSetIdentifierCode(int $idCode)
{
if ($idCode < 100 || $idCode > 999) {
throw new \Exception();
}
$this->transactionSetIdentifierCode = $idCode;
}
public function getTransactionSetIdentifierCode() : int
{
return $this->transactionSetIdentifierCode;
}
public function setTransactionSetControlNumber(string $controlNumber)
{
if (strlen($controlNumber) < 4 || strlen($controlNumber) > 9) {
throw new \Exception();
}
$this->transactionSetControlNumber = $controlNumber;
}
public function getTransactionSetControlNumber() : string
{
return str_pad((string) $this->transactionSetControlNumber, 9, '0', STR_PAD_LEFT);
}
public function serialize()
{
return self::IDENTIFIER . '*'
. $this->getTransactionSetIdentifierCode() . '*'
. $this->getTransactionSetControlNumber() . '*' . self::COMPONENT_ELEMENT_SEPARATOR;
}
public function unserialize($raw)
{
$split = explode('*', $raw);
$this->setTransactionSetIdentifierCode((int) $split[1]);
$this->setTransactionSetControlNumber(substr($split[2], -1));
}
}

View File

@ -1,41 +0,0 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types = 1);
namespace phpOMS\Utils\EDI\AnsiX12;
/**
* EDI
*
* @category Framework
* @package phpOMS\Utils\Converter
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
abstract class EDIAbstract
{
private $header = null;
private $heading = null;
private $detail = null;
private $summary = null;
public function __construct()
{
$this->header = new Header();
}
}

View File

@ -1,176 +0,0 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types = 1);
namespace phpOMS\Utils\EDI\AnsiX12;
/**
* EDI Header
*
* @category Framework
* @package phpOMS\Utils\Converter
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
class FunctionalGroupHedaer
{
private $functionalGroupHeader = 'GS';
private $functionalIdentifierCode = FunctionalIdentifierCode::PO;
private $applicationSenderCode = '';
private $appicationReceiverCode = '';
private $date = null;
private $groupControlNumber = 0;
private $responsibleAgencyCode = '';
private $version = '';
public function __construct()
{
$this->date = new \DateTime();
}
public function getFunctionalGroupHeader() : string
{
return $this->functionalGroupHeader;
}
public function getFunctionalIdentifierCode() : string
{
return $this->functionalIdentifierCode;
}
public function setFunctionalIdentifierCode(string $code) /* : void */
{
if (!FunctionalIdentifierCode::isValidValue($code)) {
throw \Exception();
}
$this->functionalIdentifierCode = $code;
}
public function getApplicationSenderCode() : string
{
return str_pad((string) $this->applicationSenderCode, 2, '0', STR_PAD_LEFT);
}
public function setApplicationSenderCode(string $code) /* : void */
{
if (strlen($code) < 2 || strlen($code) > 15) {
throw new \Exception();
}
$this->applicationSenderCode = $code;
}
public function getApplicationReceiverCode() : string
{
return str_pad((string) $this->applicationReceiverCode, 2, '0', STR_PAD_LEFT);
}
public function setApplicationReceiverCode(string $code) /* : void */
{
if (strlen($code) < 2 || strlen($code) > 15) {
throw new \Exception();
}
$this->applicationReceiverCode = $code;
}
public function setDate(\DateTime $date) /* : void */
{
$this->date = $date;
}
public function getDate() : string
{
return $this->date->format('d:m:y');
}
public function getTime() : string
{
return $this->date->format('d:m:y');
}
public function getGroupControlNumber() : int
{
return $this->groupControlNumber;
}
public function setGroupControlNumber(int $number) /* : void */
{
if ($number < 0) {
throw new \Exception();
}
$this->groupControlNumber = $number;
}
public function getResponsibleAgencyCode() : int
{
return $this->responsibleAgencyCode;
}
public function setResponsibleAgencyCode(int $code) /* : void */
{
if ($code < 0 || $code > 99) {
throw new \Exception();
}
$this->responsibleAgencyCode = $code;
}
public function getVersion() : string
{
return $this->version;
}
public function setVersion(string $version) /* : void */
{
$this->version = $version;
}
public function serialize()
{
return $this->functionalGroupHeader . '*'
. $this->getFunctionalIdentifierCode() . '*'
. $this->getApplicationSenderCode() . '*'
. $this->getApplicationReceiverCode() . '*'
. $this->getDate() . '*'
. $this->getTime() . '*'
. $this->getGroupControlNumber() . '*'
. $this->getResponsibleAgencyCode() . '*'
. $this->getVersion() . '*' . self::COMPONENT_ELEMENT_SEPARATOR;
}
public function unserialize($raw)
{
$split = explode($raw);
$this->setFunctionalGroupHeader(trim($split[0]));
$this->setFunctionalIdentifierCode(trim($split[1]));
$this->setApplicationSenderCode(trim($split[2]));
$this->setApplicationReceiverCode(trim($split[3]));
$this->setDate(new \DateTime(trim($split[4]) . '-' . trim($split[5])));
$this->setGroupControlNumber(trim($split[6]));
$this->setResponsibleAgencyCode((int) trim($split[7]));
$this->setVersion(trim($split[8]));
}
}

View File

@ -1,38 +0,0 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types = 1);
namespace phpOMS\Utils\EDI\AnsiX12;
/**
* EDI Header
*
* @category Framework
* @package phpOMS\Utils\Converter
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
class Header
{
private $interchangeControlHeader = null;
private $functionalGroupHeader = null;
public function __construct()
{
$this->interchangeControlHeader = new InterchangeControlHeader();
$this->functionalGroupHeader = new FunctionalGroupHeader();
}
}

View File

@ -1,427 +0,0 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types = 1);
namespace phpOMS\Utils\EDI\AnsiX12;
/**
* EDI Header
*
* @link https://www.erico.com/public/library/edi/ERICO850_4010.pdf
* @category Framework
* @package phpOMS\Utils\Converter
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
class InterchangeControlHeader
{
/* private */ const COMPONENT_ELEMENT_SEPARATOR = '>';
private $interchangeControlHeader = InterchangeControlHeader::ISA;
/**
* Code to identify the type of information in the Authorization Information.
*
* Req: M
* Type: ID
* Min/Max: 2/2
* Usage: Must
*
* 00 = No Authorization Information available
*
* @var int
* @since 1.0.0
*/
private $authorizationInformationQualifier = 0;
/**
* Information used for additional identification or authorization of the interchange
* sender or the data in the interchange; the type of information is set by the Authorization
* Information Qualifier.
*
* Req: M
* Type: AN
* Min/Max: 10/10
* Usage: Must
*
* @var string
* @since 1.0.0
*/
private $authorizationInformation = '';
/**
* Code to identify the type of information in the Security Information.
*
* Req: M
* Type: ID
* Min/Max: 2/2
* Usage: Must
*
* 00 = No Security Information available
*
* @var int
* @since 1.0.0
*/
private $securityInformationQualifer = 0;
/**
* This is used for identifying the security information about the interchange
* sender or the data in the interchange; the type of information is set by the Security
* Information Qualifier.
*
* Req: M
* Type: AN
* Min/Max: 10/10
* Usage: Must
*
* @var string
* @since 1.0.0
*/
private $securityInformation = '';
/**
* Qualifier to designate the system/method of code structure used to designate
* the sender or receiver ID element being qualifiedn.
*
* Req: M
* Type: ID
* Min/Max: 2/2
* Usage: Must
*
* 00 = No Security Information available
*
* @var int
* @since 1.0.0
*/
private $interchangeIdQualifier = 0;
/**
* Interchange Sender
*
* Req: M
* Type: AN
* Min/Max: 15/15
* Usage: Must
*
* @var string
* @since 1.0.0
*/
private $interchangeSender = '';
/**
* DateTime of the interchange
*
* Req: M
* Type: DTM
* Usage: Must
*
* @var \DateTime
* @since 1.0.0
*/
private $interchangeDateTime = null;
/**
* Code to identify the agency responsible for the control standard used by the
* message that is enclosed by the interchange header and trailer.
*
* Req: M
* Type: ID
* Min/Max: 1/1
* Usage: Must
*
* @var string
* @since 1.0.0
*/
private $interchangeControlStandardId = '';
/**
* Code specifying the version number of the interchange control segments.
*
* Req: M
* Type: ID
* Min/Max: 5/5
* Usage: Must
*
* @var int
* @since 1.0.0
*/
private $interchangeControlVersionNumber = 401;
/**
* A control number assigned by the interchange sender.
*
* Req: M
* Type: int
* Min/Max: 9/9
* Usage: Must
*
* @var int
* @since 1.0.0
*/
private $interchangeControlNumber = 0;
/**
* Code sent by the sender to request an interchange acknowledgment.
*
* Req: M
* Type: bool
* Min/Max: 1/1
* Usage: Must
*
* @var bool
* @since 1.0.0
*/
private $acknowledgementRequested = false;
/**
* Code to indicate whether data enclosed by this interchange envelope is test,
* production or information.
*
* Req: M
* Type: ID
* Min/Max: 1/1
* Usage: Must
*
* @var int
* @since 1.0.0
*/
private $usageIndicator = 'T';
public function setInterchangeControlHeader(string $header) /* : void */
{
$this->interchangeControlHeader = $header;
}
public function setAuthorizationInformationQualifier(int $qualifer) /* : void */
{
if ($qualifer > 99) {
throw new \Exception();
}
$this->authorizationInformationQualifier = $qualifier;
}
public function getAuthorizationInformationQualifier() : string
{
return str_pad((string) $this->authorizationInformationQualifier, 2, '0', STR_PAD_LEFT);
}
public function setAuthorizationInformation(string $information) /* : void */
{
if (strlen($information) > 10) {
throw new \Exception();
}
$this->authorizationInformation = $information;
}
public function getAuthorizationInformation() : string
{
return str_pad((string) $this->authorizationInformation, 10, ' ', STR_PAD_RIGHT);
}
public function setSecurityInformationQualifer(int $qualifer) /* : void */
{
if ($qualifer > 99) {
throw new \Exception();
}
$this->securityInformationQualifer = $qualifier;
}
public function getSecurityInformationQualifer() : string
{
return str_pad((string) $this->securityInformationQualifer, 2, '0', STR_PAD_LEFT);
}
public function setSecurityInformation(string $information) /* : void */
{
if (strlen($information) > 10) {
throw new \Exception();
}
$this->securityInformation = $information;
}
public function getSecurityInformation() : string
{
return str_pad((string) $this->securityInformation, 10, ' ', STR_PAD_RIGHT);
}
public function setInterchangeIdQualifier(int $qualifer) /* : void */
{
if ($qualifer > 99) {
throw new \Exception();
}
$this->interchangeIdQualifier = $qualifier;
}
public function getInterchangeIdQualifier() : string
{
return str_pad((string) $this->interchangeIdQualifier, 2, '0', STR_PAD_LEFT);
}
public function setInterchangeSender(string $information) /* : void */
{
if (strlen($information) > 15) {
throw new \Exception();
}
$this->interchangeSender = $information;
}
public function getInterchangeSender() : string
{
return str_pad((string) $this->interchangeSender, 15, ' ', STR_PAD_RIGHT);
}
public function setInterchangeReceiver(string $information) /* : void */
{
if (strlen($information) > 15) {
throw new \Exception();
}
$this->interchangeReceiver = $information;
}
public function getInterchangeReceiver() : string
{
return str_pad((string) $this->interchangeReceiver, 15, ' ', STR_PAD_RIGHT);
}
public function setInterchangeDatetime(\DateTime $interchange) /* : void */
{
$this->interchangeDateTime = $interchange;
}
public function getInterchangeDate() : string
{
return $this->interchangeDateTime->format('d:m:y');
}
public function getInterchangeTime() : string
{
return $this->interchangeDateTime->format('H:i');
}
public function setInterchangeControlStandardId(string $id) /* : void */
{
if (strlen($id) !== 1) {
throw new \Exception();
}
$this->interchangeControlStandardId = $id;
}
public function getInterchangeControlStandardId() : string
{
return $this->interchangeControlStandardId;
}
public function setInterchangeControlVersionNumber(int $version) /* : void */
{
if ($version > 99999) {
throw new \Exception();
}
$this->interchangeControlVersionNumber = $version;
}
public function getInterchangeControlVersionNumber() : string
{
return str_pad((string) $this->interchangeControlVersionNumber, 5, '0', STR_PAD_LEFT);
}
public function setInterchangeControlNumber(int $number) /* : void */
{
if ($number > 999999999) {
throw new \Exception();
}
$this->interchangeControlNumber = $number;
}
public function getInterchangeControlNumber() : string
{
return str_pad((string) $this->interchangeControlNumber, 9, '0', STR_PAD_LEFT);
}
public function setAcknowledgmentRequested(bool $ack) /* : void */
{
$this->acknowledgmentRequested = $ack;
}
public function getAcknowledgmentRequested() : string
{
return (string) $this->acknowledgmentRequested;
}
public function setUsageUndicator(string $id) /* : void */
{
if (strlen($id) !== 1) {
throw new \Exception();
}
$this->usageIndicator = $id;
}
public function getUsageUndicator() : string
{
return $this->usageIndicator;
}
public function serialize()
{
return $this->interchangeControlHeader . '*'
. $this->getAuthorizationInformationQualifier() . '*'
. $this->getAuthorizationInformation() . '*'
. $this->getSecurityInformationQualifer() . '*'
. $this->getSecurityInformation() . '*'
. $this->getInterchangeIdQualifier() . '*'
. $this->getInterchangeSender() . '*'
. $this->getInterchangeIdQualifier() . '*'
. $this->getInterchangeReceiver() . '*'
. $this->getInterchangeDate() . '*'
. $this->getInterchangeTime() . '*'
. $this->getInterchangeControlStandardId() . '*'
. $this->getInterchangeControlVersionNumber() . '*'
. $this->getInterchangeControlNumber() . '*'
. $this->getAcknowledgmentRequested() . '*'
. $this->getUsageUndicator() . '*' . self::COMPONENT_ELEMENT_SEPARATOR;
}
public function unserialize($raw)
{
$split = explode($raw);
$this->setInterchangeControlHeader(trim($split[0]));
$this->setAuthorizationInformationQualifier((int) trim($split[1]));
$this->setAuthorizationInformation(trim($split[2]));
$this->setSecurityInformationQualifer((int) trim($split[3]));
$this->setSecurityInformation(trim($split[4]));
$this->setInterchangeIdQualifier((int) trim($split[5]));
$this->setInterchangeSender(trim($split[6]));
$this->setInterchangeReceiver(trim($split[8]));
$this->setInterchangeDatetime(new \DateTime(trim($split[9]) . '-' . trim($split[10])));
$this->setInterchangeControlStandardId(trim($split[11]));
$this->setInterchangeControlVersionNumber((int) trim($split[12]));
$this->setInterchangeControlNumber((int) trim($split[13]));
$this->setAcknowledgmentRequested((bool) $split[14]);
$this->setUsageUndicator($split[15]);
}
}

View File

@ -1,58 +0,0 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types = 1);
namespace phpOMS\Utils\EDI\AnsiX12\Purchase\PurchaseOrder;
use phpOMS\Utils\EDI\AnsiX12\EDIAbstract;
use phpOMS\Utils\EDI\AnsiX12\Component;
/**
* EDI 850 - Purchase order.
*
* @category Framework
* @package phpOMS\Utils\Converter
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
class EDI850 extends EDIAbstract
{
private $interchangeControlHeader = null;
private $functionalGroupHeader = null;
private $heading = null;
private $detail = null;
private $summary = null;
private $functionalGroupTrailer = null;
private $interchangeControlTrailer = null;
public function __construct()
{
$this->interchangeControlHeader = new ISA();
$this->functionalGroupHeader = new GS();
$this->heading = new EDI850Heading();
$this->detail = new EDI850Detail();
$this->summary = new EDI850Summary();
$this->functionalGroupTrailer = new GE();
$this->interchangeControlTrailer = new IEA();
}
}

View File

@ -1,44 +0,0 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types = 1);
namespace phpOMS\Utils\EDI\AnsiX12\Purchase\PurchaseOrder;
use phpOMS\Utils\EDI\AnsiX12\Component;
/**
* EDI 850 - Purchase order.
*
* @category Framework
* @package phpOMS\Utils\Converter
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
class EDI850Detail
{
private $detailBaselineItemData = '';
private $detailProductItemDescrpition = '';
private $detailReferenceId = '';
private $detailServicePromoLotInfo = '';
private $detailDateTime = null;
private $detailMarkNumbers = 0;
private $detailLineItemSchedule = '';
}

View File

@ -1,54 +0,0 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types = 1);
namespace phpOMS\Utils\EDI\AnsiX12\Purchase;
use phpOMS\Utils\EDI\AnsiX12\Component;
/**
* EDI 850 - Purchase order.
*
* @category Framework
* @package phpOMS\Utils\Converter
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
class EDI850Heading
{
private $headingTransactionSetHeader = null;
private $headingBeginningSegmentPO = null;
private $headingCurrency = '';
private $headingReferenceID = '';
private $headingAdministrativeCommunicationsContact = '';
private $headingDateTimeReference = null;
private $headignCarrierDetails = '';
private $headingMarksNumbers = 0;
private $headingLoopId = [];
public function __construct()
{
$this->headingTransactionSetHeader = new ST(850);
$this->headingBeginningSegmentPO = new BEG();
}
}

View File

@ -1,36 +0,0 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types = 1);
namespace phpOMS\Utils\EDI\AnsiX12\Purchase\PurchaseOrder;
use phpOMS\Utils\EDI\AnsiX12\Component;
/**
* EDI 850 - Purchase order.
*
* @category Framework
* @package phpOMS\Utils\Converter
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
class EDI850Summary
{
private $summaryTransationTotals = 0;
private $summaryMonetaryAmount = 0;
private $summaryTransectionSetTrailer = '';
}

View File

@ -1,73 +0,0 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types = 1);
namespace phpOMS\Utils\EDI\AnsiX12\Purchase\PurchaseOrder;
/**
* EDI 850 - Purchase order.
*
* @category Framework
* @package phpOMS\Utils\Converter
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
class TransactionSetHeader
{
/* private */ const IDENTIFIER = 'ST';
private $transactionSetIdentifierCode = 850;
private $transactionSetControlNumber = '';
public function getTransactionSetIdentiferCode() : int
{
return $this->transactionSetIdentifierCode;
}
public function setTransactionIdentifierCode(int $code) /* : void */
{
$this->transactionSetIdentifierCode = $code;
}
public function getTransactionSetControlNumber() : string
{
return str_pad((string) $this->transactionSetControlNumber, 9, '0', STR_PAD_LEFT);
}
public function setTransactionSetControlNumber(string $number) /* : void */
{
if (strlen($number) < 4 || strlen($number) > 9) {
throw new \Exception();
}
$this->transactionSetControlNumber = $number;
}
public function unserialize($raw)
{
$split = explode($raw);
$this->setTransactionSetIdentifierCode((int) trim($split[1]));
$this->setTransactionSetControlNumber(trim($split[2]));
}
public function serialize()
{
return self::IDENTIFIER . '*'
. $this->getTransactionSetIdentifierCode() . '*'
. $this->getTransactionSetControlNumber();
}
}

View File

@ -1,47 +0,0 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types = 1);
namespace phpOMS\Utils\EDI\Edifact\Components;
/**
* EDI Header
*
* @category Framework
* @package phpOMS\Utils\Converter
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
class BGM
{
private $id = '';
private $date = null;
private $subersion = '06A';
private $un = 'UN';
private $bdewVersion = '2.6d';
public function __construct(string $type, string $version, string $subersion, string $un, string $bdewVersion)
{
$this->type = $type;
$this->version = $version;
$this->subersion = $subersion;
$this->un = $un;
$this->bdewVersion = $bdewVersion;
}
}

Some files were not shown because too many files have changed in this diff Show More