Code Monkey home page Code Monkey logo

edifact-generator's People

Contributors

andreyserdjuk avatar buffcode avatar davidvandertuijn avatar gaxweb avatar pazion avatar raphaelbeckmann avatar rdoppeltplus avatar sabas avatar sinisastrbac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

edifact-generator's Issues

Add Free Text Instructions to Orders

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?

Missing item segment

PIA ( To specify additional or substitutional item identification codes ) segment is missing in Order Item . Possible to add it please ?

Incompatible with PHP 8.3 due to redeclaration of composeKeys

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

Incomplete iftmin implementation

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

FTX segment implémentation with C107 segment (TEXT REFERENCE)

In the FTX implementation, i think there is a missing parameter (segment 1131) when you provide C107 segment.

image

image

If you add a Free text identification (4441 segment) ($reference here) you have to provide 2 additionals field

  • Code list qualifier (segment 1131)
  • Code list responsible agency (segment 3055)

image

So, for exemple the assertion of the testFreeText will be :

FTX+OSI++HAE::89+reduction of fees text

image

Traits PSR-4 violation / inconsistency

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 compose must be compatible

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

EDI-INVOIC

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).

CPS segment in DESADV message

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'

Item quantity qualifier

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,
],
];

CNT segment error

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

[Help Wanted] Formatting & Working with output

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!

LOC segment is not generating in Codeco\Container

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.

public function compose()

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;
}

Errors running demo code

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

Decimals in Item prices

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.