$this->trans_type = $type;
$this->reference = $Refs->get_next($this->trans_type);
+ if ($type == ST_CUSTCREDIT)
+ $this->src_date = $this->document_date;
+
$this->document_date = new_doc_date();
for($line_no = 0; $line_no < count($this->line_items); $line_no++) {
$this->due_date = get_invoice_duedate($this->payment, $this->document_date);
}
- if ($type == ST_CUSTCREDIT)
- $this->src_date = $this->document_date;
-
$this->src_docs = $this->trans_no;
$this->trans_no = 0;
}