Check for AP->GL link before setting GL code to 0
Bring code into line with coding guidelines
New parameter for freight calculation module