Posted by Wescotte on 04/14/06 20:18
The application is processing freight EDI files. We have mutliple
vendors who use various file formats. The goal was to create an easy
way for somebody else to add new vendors without having to mess with
the base code.
So they create a php file to with 3 functions
1. Check if the specified file is from that vendor
2. Parse the invoice data
3. Build remittance EDI files
So I'd have a table that would contain
Vendor # for our ERP/PHP file to include
If they wanted to add additional suport they would create a new PHP
file with the 3 functions I described and add an entry into the above
table
If you have a better suggestion on how to allow for such a task please
let me know
The current method is a global detect function that knows what files to
include, a global creation file that knows which files to include based
on detected type and a global remittance function that knows which file
to include based on the vendor #.
So if somebody wants to add a new vendor they have to append their
detection code and add code to all 3 functions. Granted it's only a few
lines each it's still something I'd prefer they didn't have to do.
[Back to original message]
|