- // if you need the company name in purchase order then write it as first line in location addresss.
- if ($doctype != ST_SUPPAYMENT && isset($sales_order['delivery_address']))
- $this->TextWrapLines($mcol, $this->rightMargin - $mcol, $sales_order['delivery_address']);
- }
+ if ($doctype != ST_SUPPAYMENT && isset($this->formData['delivery_address']))
+ $this->TextWrapLines($mcol, $this->rightMargin - $mcol, $this->formData['delivery_address']);
+ } // if you need the company name in purchase order then write it as first line in location addresss.
+ elseif ($doctype == ST_PURCHORDER && isset($this->formData['delivery_address']))
+ $this->TextWrapLines($mcol, $this->rightMargin - $mcol, $this->formData['delivery_address']);