$this->row = $temp;
if ($doctype == ST_PURCHORDER)
$this->Text($mcol, $this->company['coy_name']);
- elseif ($doctype != ST_SUPPAYMENT && isset($this->formData['deliver_to']))
- $this->Text($mcol, $this->formData['deliver_to']);
- $this->NewLine();
- if ($doctype != ST_SUPPAYMENT && isset($this->formData['deliver_to']))
- $this->TextWrapLines($mcol, $this->rightMargin - $mcol, $this->formData['delivery_address']);
+ elseif ($doctype != ST_SUPPAYMENT && isset($sales_order['deliver_to']))
+ {
+ $this->Text($mcol, $sales_order['deliver_to']);
+ $this->NewLine();
+ }
+ // 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']);
}
$this->row = $iline2 - $this->lineHeight - 1;
$col = $this->leftMargin;
$col += $width;
if ($doctype == ST_SALESINVOICE)
{
- $deliveries = get_parent_trans(ST_SALESINVOICE, $this->formData['trans_no']);
- $line = "";
- foreach ($deliveries as $delivery)
+ $deliveries = get_sales_parent_numbers(ST_SALESINVOICE, $this->formData['trans_no']);
+ if ($print_invoice_no == 0)
{
- if ($print_invoice_no == 0)
- {
- $ref = get_reference(ST_CUSTDELIVERY, $delivery);
- if ($ref)
- $delivery = $ref;
- }
- if ($line == "")
- $line .= "$delivery";
- else
- $line .= ",$delivery";
- }
- $this->TextWrap($col, $this->row, $width, $line, 'C');
+ foreach($deliveries as $n => $delivery) {
+ $deliveries[$n] = get_reference(ST_CUSTDELIVERY, $delivery);
+ }
+ }
+ $this->TextWrap($col, $this->row, $width, implode(',', $deliveries), 'C');
}
elseif ($doctype == ST_CUSTDELIVERY)
{