- if (isset($myrow['order_']))
- $this->TextWrap($col, $this->row, $width, $myrow['order_'], 'C');
- $col += $width;
- $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);
- $this->TextWrap($col, $this->row, $width, $row["terms"], 'C');
+ 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');