- $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_sales_parent_numbers(ST_SALESINVOICE, $this->formData['trans_no']);
- if ($print_invoice_no == 0)
- {
- 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)
- {
- $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)) //!
- {
- $this->row -= (2 * $this->lineHeight);
- if ($doctype == ST_WORKORDER)
- $str = sql2date($this->formData["required_by"]);
- else
- {
- $id = $this->formData['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();
- }