- global $comp_path, $path_to_root, $print_as_quote, $print_invoice_no, $packing_slip;
-
- $this->pageNumber++;
- if ($this->pageNumber > 1)
- $this->newPage();
- $header2type = true;
- if (isset($myrow['curr_code']) && $this->currency != $myrow['curr_code'])
- {
- include($path_to_root . "/reporting/includes/doctext2.inc");
+// $this->formData = array_merge($myrow, $branch, $sales_order,
+// $bank_account, array('doctype' => $doctype));
+
+ $this->formData = array();
+ $datnames = array(
+ 'myrow' => array('ord_date', 'date_', 'tran_date',
+ 'order_no','reference', 'id', 'trans_no', 'name', 'location_name',
+ 'delivery_address', 'supp_name', 'address',
+ 'DebtorName', 'supp_account_no', 'wo_ref', 'debtor_ref','type', 'trans_no',
+ 'StockItemName', 'tax_id', 'order_', 'delivery_date', 'units_issued',
+ 'due_date', 'required_by', 'payment_terms', 'curr_code',
+ 'ov_freight', 'ov_gst', 'ov_amount'),
+ 'branch' => array('br_address', 'br_name', 'salesman', 'disable_branch'),
+ 'sales_order' => array('deliver_to', 'delivery_address', 'customer_ref'),
+ 'bankaccount' => array('bank_name', 'bank_account_number')
+ );
+
+ foreach($datnames as $var => $fields) {
+ if (isset($$var)) {
+ foreach($fields as $locname) {
+ if (isset(${$var}[$locname]) && (${$var}[$locname]!==null)) {
+ $this->formData[$locname] = ${$var}[$locname];
+ }
+ }
+ }