- $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');
- }
- elseif ($doctype == 26)
- $this->TextWrap($col, $this->row, $width, $wo_types_array[$myrow["type"]], 'C');
- $col += $width;
- if ($doctype == 26)
- $this->TextWrap($col, $this->row, $width, $myrow["StockItemName"], 'C');
- elseif ($doctype != 8 && isset($myrow['tax_id']))
- $this->TextWrap($col, $this->row, $width, $myrow['tax_id'], 'C');
- $col += $width;
- if ($doctype == 10)
- {
- $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 == 13)
- {
- $ref = "";
- 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 == 26)
- $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 == 9 || $doctype == 7)
- $this->TextWrap($col, $this->row, $width, sql2date($myrow['delivery_date']), 'C');
- elseif ($doctype == 26)
- $this->TextWrap($col, $this->row, $width, $myrow["units_issued"], 'C');
- elseif ($doctype != 8 && $doctype != 11 && isset($myrow['due_date']))
- $this->TextWrap($col, $this->row, $width, sql2date($myrow['due_date']), 'C');
- if (!isset($packing_slip) || $packing_slip == 0)
- {
- $this->row -= (2 * $this->lineHeight);
- if ($doctype == 26)
- $str = sql2date($myrow["required_by"]);
- else
- {
- $id = $myrow['payment_terms'];
- $sql = "SELECT terms FROM ".TB_PREF."payment_terms WHERE terms_indicator='$id'";
- $result = db_query($sql,"could not get paymentterms");
- $row = db_fetch($result);
- $str = $row["terms"];
- }
- $this->Font('italic');
- $this->TextWrap($ccol, $this->row, $right-$ccol, $doc_Payment_Terms . ": " . $str);
- $this->Font();