You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to extract the ATLANTIC string, but I can't seem to find an exact filter for it. $r->readEdiDataValue(['IMD',['1'=>'F', '2'=>'35']],1); doesn't do it but finds 7 matches: 5 for "F" in 1st place + 2 for "35" in 2nd.
Is it even possible? The code for readEdiDataValue() doesn't seem to combine the filters in the array, but just look for lines that match either, but not both at the same time.
Shouldn't that code combine filters via AND instead of OR? RIght now it breaks the inner loop, if the 1st entry in the filter array is "ok" without checking, if the 2nd entry matches, too.
I've got a patch ready, if you agree that this should be changed. With my change applied, $r->readEdiDataValue(['IMD', [1 => 'F', 2 => '35']], 3, 3); gets me the "ATLANTIC" string I wanted.
Second problem
From same PRICAT line item:
ALI+++96E'
ALI+DE'
How would I even filter these, if I need the "DE" string? Just "ALI" is ambiguous but the 2nd entry already contains what I need. Can you filter on "not empty"? Or is that an error and there should really just be one line containing both data points? Seems weird to have 2 "ALI" lines like that.
The text was updated successfully, but these errors were encountered:
Feel free to submit a pull request!
cc @uldisn as he's actually using the class, but as I look at it for the second problem you could tweak $el_value to test against a flag like "EMPTY" or similar..
First problem
Example excerpt from a PRICAT file of a line item:
I'm trying to extract the
ATLANTIC
string, but I can't seem to find an exact filter for it.$r->readEdiDataValue(['IMD',['1'=>'F', '2'=>'35']],1);
doesn't do it but finds 7 matches: 5 for "F" in 1st place + 2 for "35" in 2nd.Is it even possible? The code for
readEdiDataValue()
doesn't seem to combine the filters in the array, but just look for lines that match either, but not both at the same time.Shouldn't that code combine filters via AND instead of OR? RIght now it breaks the inner loop, if the 1st entry in the filter array is "ok" without checking, if the 2nd entry matches, too.
I've got a patch ready, if you agree that this should be changed. With my change applied,
$r->readEdiDataValue(['IMD', [1 => 'F', 2 => '35']], 3, 3);
gets me the "ATLANTIC" string I wanted.Second problem
From same PRICAT line item:
How would I even filter these, if I need the "DE" string? Just "ALI" is ambiguous but the 2nd entry already contains what I need. Can you filter on "not empty"? Or is that an error and there should really just be one line containing both data points? Seems weird to have 2 "ALI" lines like that.
The text was updated successfully, but these errors were encountered: