- 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');
- else if ($doctype != 8 && $doctype != 11 && isset($myrow['due_date']))
- $this->TextWrap($col, $this->row, $width, sql2date($myrow['due_date']), 'C');
-
+ 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();
+ }