-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from Napp/feature/orders_extended
Orders extended
- Loading branch information
Showing
13 changed files
with
878 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,6 @@ _ide_helper.php | |
coverage | ||
coverage.xml | ||
phpunit.local.xml | ||
.phpunit.result.cache | ||
composer.lock | ||
/tests/_output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -164,7 +164,7 @@ UNT+31+M5C5201079DE48' | |
UNZ+1+I5C5201079DADD' | ||
``` | ||
|
||
``` | ||
|
||
CODECO | ||
------ | ||
Container move report. Multiple containers per message. Each message can be for gate in or for gate out. | ||
|
@@ -335,7 +335,7 @@ COHAOR | |
------ | ||
Container special handling order message | ||
|
||
``` | ||
```php | ||
$oInterchange = (new \EDI\Generator\Interchange('ME', 'YOU')); | ||
|
||
$sMessageReferenceNumber = 'ROW' . str_pad(1, 11, 0, STR_PAD_LEFT); | ||
|
@@ -490,3 +490,66 @@ CNT+16:1' | |
UNT+12+ROW00000000001' | ||
UNZ+1+I5C51F7D31CFF8' | ||
``` | ||
|
||
|
||
ORDERS | ||
------ | ||
Purchase order. | ||
|
||
```php | ||
$interchange = new \EDI\Generator\Interchange('UNB-Identifier-Sender','UNB-Identifier-Receiver'); | ||
$interchange->setCharset('UNOC', '3'); | ||
|
||
$orders = new \EDI\Generator\Orders(); | ||
$orders | ||
->setOrderNumber('AB76104') | ||
->setContactPerson('John Doe') | ||
->setMailAddress('[email protected]') | ||
->setPhoneNumber('+49123456789') | ||
->setDeliveryDate(new \DateTime()) | ||
->setDeliveryAddress( | ||
'Name 1', | ||
'Name 2', | ||
'Name 3', | ||
'Street', | ||
'99999', | ||
'city', | ||
'DE' | ||
) | ||
->setDeliveryTerms('CAF'); | ||
|
||
// adding order items | ||
$item = new \EDI\Generator\Orders\Item(); | ||
$item->setPosition('1', '8290123', 'EN')->setQuantity(3); | ||
$orders->addItem($item); | ||
|
||
$item = new \EDI\Generator\Orders\Item(); | ||
$item->setPosition('2', 'AB992233', 'EN')->setQuantity(1); | ||
$orders->addItem($item); | ||
|
||
$orders->compose(); | ||
|
||
$encoder = new \EDI\Encoder($interchange->addMessage($orders)->getComposed(), true); | ||
$encoder->setUNA(":+,? '"); | ||
echo $encoder->get(); | ||
``` | ||
|
||
``` | ||
UNB+UNOC:3+UNB-Identifier-Sender+UNB-Identifier-Receiver+190325:1242+I5C98CCC536C91' | ||
UNH+M5C98CCC536CA2+ORDERS:D:96B:UN:ITEK35' | ||
BGM+120+AB76104+9' | ||
DTM+2:201903251242:203' | ||
CTA++:John Doe' | ||
[email protected]:EM' | ||
COM+?+49123456789:TE' | ||
NAD+ST+::ZZZ++Name 1:Name 2:Name 3+Street+city++99999+DE' | ||
TOD+6++CAF' | ||
LIN+1++8290123:EN' | ||
QTY+12:3:PCE' | ||
LIN+2++AB992233:EN' | ||
QTY+12:1:PCE' | ||
UNS+S' | ||
CNT+2+2' | ||
UNT+15+M5C98CCC536CA2' | ||
UNZ+1+I5C98CCC536C91' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace EDI\Generator; | ||
|
||
/** | ||
* Class EdifactCurrency | ||
* @url http://www.unece.org/trade/untdid/d96b/uncl/uncl6343.htm | ||
* @package EDI\Generator | ||
*/ | ||
class EdifactCurrency | ||
{ | ||
const CURRENCY_CUSTOMS_VALUATIONS = '1'; | ||
const CURRENCY_INSURANCE = '2'; | ||
const CURRENCY_HOME = '3'; | ||
const CURRENCY_INVOICING = '4'; | ||
const CURRENCY_ACCOUNT = '5'; | ||
const CURRENCY_REFERENCE = '6'; | ||
const CURRENCY_TARGET = '7'; | ||
const CURRENCY_PRICE_LIST = '8'; | ||
const CURRENCY_ORDER = '9'; | ||
const CURRENCY_PRICING = '10'; | ||
const CURRENCY_PAYMENT = '11'; | ||
const CURRENCY_QUOTATION = '12'; | ||
const CURRENCY_RECIPIENT_LOCAL = '13'; | ||
const CURRENCY_SUPPLIER = '14'; | ||
const CURRENCY_SENDER_LOCAL = '15'; | ||
const CURRENCY_TARIFF = '16'; | ||
const CURRENCY_CHARGE_CALCULATION = '17'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.