- if ($doctype == ST_PURCHORDER || $doctype == ST_SUPPAYMENT)
- $this->TextWrap($col, $this->row, $width, $myrow['supp_account_no'], 'C');
- elseif ($doctype == ST_WORKORDER)
- $this->TextWrap($col, $this->row, $width, $myrow['wo_ref'], 'C');
- elseif (isset($sales_order["customer_ref"]))
- $this->TextWrap($col, $this->row, $width, $sales_order["customer_ref"], 'C');
- $col += $width;
- if ($branch != null)
- {
- $id = $branch['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)
- $this->TextWrap($col, $this->row, $width, $systypes_array[$myrow["type"]], 'C');
- elseif ($doctype == ST_WORKORDER)
- $this->TextWrap($col, $this->row, $width, $wo_types_array[$myrow["type"]], 'C');
- $col += $width;
- if ($doctype == ST_WORKORDER)
- $this->TextWrap($col, $this->row, $width, $myrow["StockItemName"], 'C');
- elseif ($doctype != ST_PURCHORDER && isset($myrow['tax_id']))
- $this->TextWrap($col, $this->row, $width, $myrow['tax_id'], 'C');
- $col += $width;
- if ($doctype == ST_SALESINVOICE)
- {
- $deliveries = get_parent_trans(ST_SALESINVOICE, $myrow['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 = $myrow['order_'];
- if ($print_invoice_no == 0)
- {
- $ref = get_reference(ST_SALESORDER, $myrow['order_']);
- if (!$ref)
- $ref = $myrow['order_'];
- }
- $this->TextWrap($col, $this->row, $width, $ref, 'C');
- }
- elseif ($doctype == ST_WORKORDER)
- $this->TextWrap($col, $this->row, $width, $myrow["location_name"], 'C');
- elseif (isset($myrow['order_']))
- $this->TextWrap($col, $this->row, $width, $myrow['order_'], 'C');
- $col += $width;
- if ($doctype == ST_SALESORDER || $doctype == ST_SALESQUOTE)
- $this->TextWrap($col, $this->row, $width, sql2date($myrow['delivery_date']), 'C');
- elseif ($doctype == ST_WORKORDER)
- $this->TextWrap($col, $this->row, $width, $myrow["units_issued"], 'C');
- elseif ($doctype != ST_PURCHORDER && $doctype != ST_CUSTCREDIT && isset($myrow['due_date']))
- $this->TextWrap($col, $this->row, $width, sql2date($myrow['due_date']), 'C');
- if (!isset($packing_slip) || $packing_slip == 0)