Skip to content

Add ORDERS compatibility APIs and preserve legacy EDI output formatting#41

Open
JshGrn wants to merge 5 commits intophp-edifact:masterfrom
JshGrn:master
Open

Add ORDERS compatibility APIs and preserve legacy EDI output formatting#41
JshGrn wants to merge 5 commits intophp-edifact:masterfrom
JshGrn:master

Conversation

@JshGrn
Copy link

@JshGrn JshGrn commented Feb 26, 2026

We were using an older forked version of this repo, things were changed and we were unable to open a PR against this branch so this is a fresh fork with backporting of functionality for our use case. All tests pass in our app after switching to this implementation.

Summary

  • add backward-compatible ORDERS APIs used by downstream integrations
  • preserve legacy-compatible UNB and NAD output formatting
  • add package-level compatibility tests for custom order, QLI/IMD/GIR, UNB appref, and NAD trimming
  • remove dynamic-property writes in Item trait to avoid PHP 8.2+ deprecation warnings

API/Behavior Additions

  • Orders::setCustomIdentifier() (RFF+ON)
  • Orders::setCustomOrderNumber() supports EANCOM-style composite doc type (31C::28) while keeping scalar output for numeric types
  • Item::setQli()
  • Item::addInformation()
  • Item::addGir()
  • ItemPrice::setOurPrice() (PRI+AAE)

Validation

  • package tests pass: 33 tests, 55 assertions
  • this is working as expected

$unb[] = [];
$unb[] = [];
$unb[] = [];
$unb[] = [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the empty fields?


$applicationReference = $this->appref;
if ($applicationReference === null && isset($composedMessages[0][0][2][0])) {
$applicationReference = (string) $composedMessages[0][0][2][0];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems quite specific? Seems to pick a field from UNH?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants