php-edifact / edifact-generator Goto Github PK
View Code? Open in Web Editor NEWFormatter for EDI messages
License: GNU Lesser General Public License v3.0
Formatter for EDI messages
License: GNU Lesser General Public License v3.0
I try to figure out how to add a message of type FTX+AAI to an order. The class Iftmin offers a method called setFreeTextInstructions for adding such an entity. How would I use this method on an order?
PIA ( To specify additional or substitutional item identification codes ) segment is missing in Order Item . Possible to add it please ?
The current version is incompatible with PHP 8.3.
When trying to initialize new EDI\Generator\Orders\Item
, it crashes with the following error message:
EDI\Generator\Base and EDI\Generator\Traits\Item define the same property ($composeKeys) in the composition of EDI\Generator\Orders\Item. However, the definition differs and is considered incompatible. Class was composed at...
This problem occurs due to the declaration of $composeKeys
in the Base model that was added in commit d96ec82.
d96ec82#diff-71e03770b3ae304472c9a73545a905c54a97c2555eaedc8a558b8ab328ca5439
I having problems updating this library to the latest changes using composer update.
If i look at packagist the latest source reference is '7bb1aeea77338e5090f65ced3ca425c667ffa42d'
https://packagist.org/packages/php-edifact/edifact-generator
This is a reference to an old commit:
7bb1aee
Why is this source reference not updated ?
Hi there,
Thanks for the library.
I must say I'm really struggling to find a way to build a BICS file for Iftmin D01A... I can easily build the base segments with the iftmin class, however, there's no corresponding container classes that I can use to add and really build up my file.
I want to build an iftmin file that includes several containers with several terminal stops but I can't seem to find a way to do it with your library.
It seems the only way to do it is to just build further on top of it...
Am I missing something here?
If I'm actually doing useful work I'd like to open up a PR.. But then again, I'm literally building a file based on an example :D not sure if that's the best way
In the FTX implementation, i think there is a missing parameter (segment 1131) when you provide C107 segment.
If you add a Free text identification (4441 segment) ($reference here) you have to provide 2 additionals field
So, for exemple the assertion of the testFreeText will be :
FTX+OSI++HAE::89+reduction of fees text
The traits
directory does not match the PSR-4 naming schema.
Furthermore, the traits use different namespaces:
EDI\Generator\traits\VatAndCurrency
EDI\Generator\Traits\TransportData
The error can be detected by removing the autoload.classmap
configuration from composer.json
and running composer dump-autoload -a
:
Class EDI\Generator\Traits\ContactPerson located in php-edifact/edifact-generator/src/Generator/traits/ContactPerson.php does not comply with psr-4 autoloading standard. Skipping.
Class EDI\Generator\Traits\Item located in php-edifact/edifact-generator/src/Generator/traits/Item.php does not comply with psr-4 autoloading standard. Skipping.
Class EDI\Generator\Traits\ItemPrice located in php-edifact/edifact-generator/src/Generator/traits/ItemPrice.php does not comply with psr-4 autoloading standard. Skipping.
Class EDI\Generator\Traits\NameAndAddress located in php-edifact/edifact-generator/src/Generator/traits/NameAndAddress.php does not comply with psr-4 autoloading standard. Skipping.
Class EDI\Generator\Traits\TransportData located in php-edifact/edifact-generator/src/Generator/traits/TransportData.php does not comply with psr-4 autoloading standard. Skipping.
Declaration of EDI\Generator\Vermas::compose($msgStatus = 5, $documentCode = 749) must be compatible with EDI\Generator\Message::compose(?string $sMessageFunctionCode, ?string $sDocumentNameCode, ?string $sDocumentIdentifier): EDI\Generator\Message
Hi, thanks for your awesome work. Would it be possible to add an INVOIC sample in the samples?
I just want to make sure to use everything correctly and get the correct EDI Message...
I'm not really sure if I use the library the right way, 'cause there's always an Error in my created Messages when they get too much information (like if I pass too much information for the Invoic).
Hi, first of all, thanks for this superb package.
I need to create a DESADV message, I think it needs to follow the D96A or D96B standard.
Apparently the message also needs a CPS segment, Consignment Packing Sequence.
I'm also missing how to create PAC and PCI segments, but those are optional.
I'm new to the whole EDI thing, so bare with me if I'm missing something.. :) Thanks in advance
Hereunder an example of a message I need to be able to create.
UNA:+.? ' UNB+UNOC:3+5430002362007:14+8711577188481:14+150618:0804+20140616471273+++++’ UNH+1+DESADV:D:96A:UN:EAN008' BGM+351::9+3021471273+9' DTM+11:20210218:102' DTM+132:20210219:102' DTM+137:20210218:102' RFF+ON:2048232' DTM+171:20210218:102' RFF+ON:471273' NAD+BY+5430002362038::9' NAD+DP+5430002362038::9' NAD+SU+8714252006209::9’ CPS+2+1' PAC+1+:52+PK' PCI+33E' GIN+BJ+387118580006435421' LIN+1++4039784418349:EN' PIA+5+12254AEC22:SA' QTY+12:1' RFF+ON:2048232' LIN+2++4039784295803:EN' PIA+5+12254AEC25:SA' QTY+12:1' RFF+ON:2048232' LIN+3++4002667005646:EN' PIA+5+12254AEC29:SA' QTY+12:1' RFF+ON:2048232' CNT+2:3' UNT+26+1' UNZ+1+20150618471273'
Hello,
In Trait "Item", function setQuantity should have $quantifier parameter.
For example when i make "ORDERS" and $item->setQuantity, item qualifier must be 21 ( "Orderded quantity" qualifier ) not 12 ( "Despatch quantity" qualifier )
** /traits/Item.php l.173:**
$this->quantity = [
'QTY',
[
'12',
(string)$quantity,
$unit,
],
];
Hello there is an error in item count section, in this part you can see CNT+2+2 and it should be CNT+2:2
...
PIA+G144621+5:IN'
QTY+12:7:PCE'
PRI+AAA:12.96:::1:PCE'
LIN+2++3573678678200:EN'
PIA+G144712+5:IN'
QTY+12:7:PCE'
PRI+AAA:6.90:::1:PCE'
UNS+S'
CNT+2+2'
...
Thank you
After looking at the source from this repository I noticed that the generators are based on the XML mapping files from https://github.com/php-edifact/edifact-mapping.
I'm looking to implement the DESADV D96A.
Am I right to think that I could use one of the generators like Coprar, Copino, etc as a start point?
Sample file that I'm looking to generate.
DESADV.txt
Hey.
First things first, thank you for the hard work that has gone into this package. I am currently working with a fork & am implementing a QUOTE implementation for EDIFACT.
I've never worked with this standard / file so I'm by no means an expert, I am struggling to conform to the output provided by our example files however.
As an example, I'm currently adding a GIR segment in my fork & have noticed my example segments look as follow:
GIR+001+D:LLO+DVDN:LSQ+STOCK_AV:LFN+10.21:LCV
GIR+002+P:LLO+DVDN:LSQ+STOCK_AV:LFN+10.21:LCV
GIR+003+CW:LLO+DVDN:LSQ+STOCK_AV:LFN+10.21:LCV
When I generate my test data using a similar approach to the other examples within the project, I get:
GIR+1:D:LLO
Which I assume is to be expected, I am however wondering how to specify that the $sepData
character should be used? Am I missing something? My DTM etc are all formatting correctly.
Happy to PR this back once the quote functionality is working if it would be of value. Any help regarding the internals would be appreciated. Thanks again!
Does this libary support COHAOR (Container special handling order message) , UN/EDIFACT D17B ?
https://service.unece.org/trade/untdid/d17b/trmd/cohaor_c.htm
Can be used to convert to XML/EDIFACT from EDIFACT?
I wrote a code like belows:
$oContainer = (new \EDI\Generator\Codeco\Container())
->setContainer('test', '45G1', 1, 4)
->setLocation('SESTO')
;
But it's not generating LOC segment in output, I noticed it hasn't been added to compose function.
proposed function:
/**
* @return array
*/
public function compose()
{
$composed = [$this->cntr];
if ($this->bkg !== null) {
$composed[] = $this->bkg;
}
$composed[] = $this->effectiveDate;
if ($this->weight !== null) {
$composed[] = $this->weight;
}
if ($this->seal !== null) {
$composed[] = $this->seal;
}
if ($this->modeOfTransport !== null) {
$composed[] = $this->modeOfTransport;
}
if ($this->destination !== null) {
$composed[] = $this->destination;
}
return $composed;
}
Dears,
I have a problem running VERMAS demo code from SAMPLES.md file. I have PHP 8.0.3. Can you please help
PHP Fatal error: Uncaught TypeError: EDI\Encoder::escapeValue(): Argument #1 ($str) must be of type string, int given, called in C:\0 - Dream\GDisk\000 - Work\003\019 -IATA\edifact-generator\vendor\sabas\edifact\src\EDI\Encoder.php on line 134 and defined in C:\0 - Dream\GDisk\000 - Work\003\019 -IATA\edifact-generator\vendor\sabas\edifact\src\EDI\Encoder.php:162
Stack trace:
#0 C:\0 - Dream\GDisk\000 - Work\003\019 -IATA\edifact-generator\vendor\sabas\edifact\src\EDI\Encoder.php(134): EDI\Encoder->escapeValue(2)
#1 C:\0 - Dream\GDisk\000 - Work\003\019 -IATA\edifact-generator\vendor\sabas\edifact\src\EDI\Encoder.php(101): EDI\Encoder->encodeSegment(Array)
#2 C:\0 - Dream\GDisk\000 - Work\003\019 -IATA\edifact-generator\vendor\sabas\edifact\src\EDI\Encoder.php(77): EDI\Encoder->encode(Array, false)
#3 C:\0 - Dream\GDisk\000 - Work\003\019 -IATA\edifact-generator\rbo.php(27): EDI\Encoder->__construct(Array, false)
#4 {main}
thrown in C:\0 - Dream\GDisk\000 - Work\003\019 -IATA\edifact-generator\vendor\sabas\edifact\src\EDI\Encoder.php on line 162
Fatal error: Uncaught TypeError: EDI\Encoder::escapeValue(): Argument #1 ($str) must be of type string, int given, called in C:\0 - Dream\GDisk\000 - Work\003\019 -IATA\edifact-generator\vendor\sabas\edifact\src\EDI\Encoder.php on line 134 and defined in C:\0 - Dream\GDisk\000 - Work\003\019 -IATA\edifact-generator\vendor\sabas\edifact\src\EDI\Encoder.php:162
Stack trace:
#0 C:\0 - Dream\GDisk\000 - Work\003\019 -IATA\edifact-generator\vendor\sabas\edifact\src\EDI\Encoder.php(134): EDI\Encoder->escapeValue(2)
#1 C:\0 - Dream\GDisk\000 - Work\003\019 -IATA\edifact-generator\vendor\sabas\edifact\src\EDI\Encoder.php(101): EDI\Encoder->encodeSegment(Array)
#2 C:\0 - Dream\GDisk\000 - Work\003\019 -IATA\edifact-generator\vendor\sabas\edifact\src\EDI\Encoder.php(77): EDI\Encoder->encode(Array, false)
#3 C:\0 - Dream\GDisk\000 - Work\003\019 -IATA\edifact-generator\rbo.php(27): EDI\Encoder->__construct(Array, false)
#4 {main}
thrown in C:\0 - Dream\GDisk\000 - Work\003\019 -IATA\edifact-generator\vendor\sabas\edifact\src\EDI\Encoder.php on line 162
Hello again.
I can not set item price properly , if I set UNA to ":+.? '" item price is not "10.03" (dot) but "10,03" (comma). And my order is refused by my supplier...
So i can see that we can not set decimal count for formatting ( ex : 0.254 ) too
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.