It is another of those problems where the developer didn't initialise the variable before using it. Allowed in PHP but not advisable. By setting error_reporting to be -1 in config.php developers can normally find these errors before committing.
Solution:
Insert
$sql = array();
at line 180 of WOSerialNos.php immediately below the line
I have had to remind you before Phil, that you must remember that the webERP community contains people of many different cultures, and many different languages. Sarcasm rarely works in a language that is not your first (to be honest it's not the greatest way of expressing yourself in any language), and what you might intend as banter or sarcasm can be misunderstood or considered hurtful by people of other cultures or languages.