- $temp = $this->row;
- if ($doctype == ST_SALESQUOTE || $doctype == ST_SALESORDER)
- {
- $this->Text($ccol, $this->formData['name'], $icol);
- }
- elseif ($doctype == ST_WORKORDER)
- {
- $this->Text($ccol, $this->formData['location_name'], $icol);
- $this->NewLine();
- $this->TextWrapLines($ccol, $icol - $ccol, $this->formData['delivery_address']);
- }
- else
- {
- if ($doctype == ST_PURCHORDER || $doctype == ST_SUPPAYMENT) {
- $name = $this->formData['supp_name'];
- $addr = $this->formData['address'];
- } else {
- if (isset($this->formData['br_address']) &&
- trim($this->formData['br_address']) != '') {
- $name = $this->formData['br_name'];
- $addr = $this->formData['br_address'];
- } else {
- $name = $this->formData['DebtorName'];
- $addr = $this->formData['address'];
- }
- }
- $this->Text($ccol, $name, $icol);
- $this->NewLine();
- $this->TextWrapLines($ccol, $icol - $ccol, $addr);
- }
- if (isset($this->formData['deliver_to']))
- {
- $this->row = $temp;
- if ($doctype == ST_PURCHORDER)
- $this->Text($mcol, $this->company['coy_name']);
- 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;
- $this->TextWrap($col, $this->row, $width, $doc_Customers_Ref, 'C');
- $col += $width;
- $this->TextWrap($col, $this->row, $width, $doc_Our_Ref, 'C');
- $col += $width;
- $this->TextWrap($col, $this->row, $width, $doc_Your_VAT_no, 'C');
- $col += $width;
- if ($doctype == ST_SALESINVOICE)
- $this->TextWrap($col, $this->row, $width, $doc_Delivery_no, 'C');
- else
- $this->TextWrap($col, $this->row, $width, $doc_Our_Order_No, 'C');
- $col += $width;
- $this->TextWrap($col, $this->row, $width, $doc_Due_Date, 'C');
- $this->row = $iline3 - $this->lineHeight - 1;