- if ($doctype == ST_PURCHORDER || $doctype == ST_SUPPAYMENT)
- $this->TextWrap($col, $this->row, $width, $this->formData['supp_account_no'], 'C');
- elseif ($doctype == ST_WORKORDER)
- $this->TextWrap($col, $this->row, $width, $this->formData['wo_ref'], 'C');
- elseif (isset($this->formData["customer_ref"]))
- $this->TextWrap($col, $this->row, $width, $this->formData["customer_ref"], 'C');
- elseif (isset($this->formData["debtor_ref"]))
- $this->TextWrap($col, $this->row, $width, $this->formData["debtor_ref"], 'C');
- $col += $width;
- if (isset($this->formData['salesman']))
- {
- $id = $this->formData['salesman'];
- //$sql = "SELECT salesman_name FROM ".TB_PREF."salesman WHERE salesman_code='$id'";
- //$result = db_query($sql,"could not get sales person");
- //$row = db_fetch($result);
- //$this->TextWrap($col, $this->row, $width, $row['salesman_name'], 'C');
- $this->TextWrap($col, $this->row, $width, get_salesman_name($id), 'C');
- }
- elseif ($doctype == ST_SUPPAYMENT || $doctype == ST_CUSTPAYMENT)
- $this->TextWrap($col, $this->row, $width, $systypes_array[$this->formData["type"]], 'C');
- elseif ($doctype == ST_WORKORDER)
- $this->TextWrap($col, $this->row, $width, $wo_types_array[$this->formData["type"]], 'C');
- $col += $width;
- if ($doctype == ST_WORKORDER)
- $this->TextWrap($col, $this->row, $width, $this->formData["StockItemName"], 'C');
- elseif ($doctype != ST_PURCHORDER && isset($this->formData['tax_id']))
- $this->TextWrap($col, $this->row, $width, $this->formData['tax_id'], 'C');
- $col += $width;
- if ($doctype == ST_SALESINVOICE)
- {
- $deliveries = get_parent_trans(ST_SALESINVOICE, $this->formData['trans_no']);
- $line = "";
- foreach ($deliveries as $delivery)
- {
- 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');
- }
- elseif ($doctype == ST_CUSTDELIVERY)
- {
- $ref = $this->formData['order_'];
- if ($print_invoice_no == 0)
- {
- $ref = get_reference(ST_SALESORDER, $this->formData['order_']);
- if (!$ref)
- $ref = $this->formData['order_'];
- }
- $this->TextWrap($col, $this->row, $width, $ref, 'C');
- }
- elseif ($doctype == ST_WORKORDER)
- $this->TextWrap($col, $this->row, $width, $this->formData["location_name"], 'C');
- elseif (isset($this->formData['order_']) && $this->formData['order_'] != 0)
- $this->TextWrap($col, $this->row, $width, $this->formData['order_'], 'C');
- $col += $width;
- if ($doctype == ST_SALESORDER || $doctype == ST_SALESQUOTE)
- $this->TextWrap($col, $this->row, $width, sql2date($this->formData['delivery_date']), 'C');
- elseif ($doctype == ST_WORKORDER)
- $this->TextWrap($col, $this->row, $width, $this->formData["units_issued"], 'C');
- elseif ($doctype != ST_PURCHORDER && $doctype != ST_CUSTCREDIT && $doctype != ST_CUSTPAYMENT &&
- $doctype != ST_SUPPAYMENT && isset($this->formData['due_date']))
- $this->TextWrap($col, $this->row, $width, sql2date($this->formData['due_date']), 'C');
- if ((!isset($packing_slip) || $packing_slip == 0) && ($doctype != ST_STATEMENT)) //!