-if (isset($header2type))
-{
- $doc_Cust_no = _("Cust no");
- $doc_Date = _("Date");
- if ($doctype == ST_PURCHORDER || $doctype == ST_SUPPAYMENT) // Purchase Order
- {
- $doc_Charge_To = _("Order To");
- if ($doctype == ST_PURCHORDER)
- $doc_Delivered_To = _("Deliver To");
- else
- $doc_Delivered_To = _("Charge To");
- }
- else
- {
- if ($doctype == ST_CUSTPAYMENT)
- $doc_Charge_To = _("With thanks from");
- else
- $doc_Charge_To = _("Charge To");
- $doc_Delivered_To = _("Delivered To");
- }
- $doc_Shipping_Company = _("Shipping Company");
- if ($doctype == ST_SALESQUOTE)
- $doc_Due_Date = _("Valid until");
- elseif ($doctype == ST_SALESORDER)
- $doc_Due_Date = _("Delivery Date");
- else
- $doc_Due_Date = _("Due Date");
- $doc_Your_Ref = _("Your Ref");
- if ($doctype == ST_WORKORDER)
- {
- $doc_Our_Ref = _("Type");
- $doc_Your_VAT_no = _("Manufactured Item");
- $doc_Payment_Terms = _("Required By");
- $doc_Customers_Ref = _("Reference");
- $doc_Our_Order_No = _("Into Location");
- $doc_Due_Date = _("Quantity");
- }
- else
- {
- if ($doctype == ST_SUPPAYMENT || $doctype == ST_CUSTPAYMENT)
- $doc_Our_Ref = _("Type");
- else
- $doc_Our_Ref = _("Sales Person");
- $doc_Your_VAT_no = _("Your VAT no.");
- $doc_Payment_Terms = _("Payment Terms");
- $doc_Customers_Ref = _("Customers Reference");
- $doc_Our_Order_No = _("Our Order No");
- }
- $doc_Our_VAT_no = _("Our VAT No.");
- $doc_Domicile = _("Domicile");
- $doc_Extra = "";
- if($doctype == ST_CUSTDELIVERY || $doctype == ST_SALESQUOTE || $doctype == ST_PURCHORDER || $doctype == ST_SALESORDER ||
- $doctype == ST_SUPPAYMENT || $doctype == ST_CUSTPAYMENT) {
- if ($doctype == ST_CUSTPAYMENT)
- $doc_Extra = _("* Subject to Realisation of the Cheque.");
- $doc_Bank_Account = '';
- $doc_Please_Quote = _("All amounts stated in");
- } else {
- $doc_Bank_Account = _("Bank Account");
- $doc_Please_Quote = $doctype==ST_SALESINVOICE ?
- _("Please quote Invoice no. when paying. All amounts stated in") :
- _("Please quote Credit no. when paying. All amounts stated in");
- }
- $doc_Address = _("Address");
- $doc_Phone_Fax_Email = _("Phone/Fax/Email");
- $doc_Bank = _("Bank");
- $doc_Payment_Link = _("You can pay through");
- if ($doctype == ST_SALESQUOTE || $doctype == ST_PURCHORDER || $doctype == ST_SALESORDER || $doctype == ST_SALESINVOICE ||
- $doctype == ST_CUSTCREDIT || $doctype == ST_CUSTDELIVERY || $doctype == ST_WORKORDER || $doctype == ST_SUPPAYMENT ||
- $doctype == ST_CUSTPAYMENT)
+/*****
+*
+* Set document type dependent elements of common page layout.
+*
+*/
+ $Addr1 = array(
+ 'title' => _("Charge To"),
+ 'name' => @$this->formData['br_name'] ? $this->formData['br_name'] : @$this->formData['DebtorName'],
+ 'address' => @$this->formData['br_address'] ? $this->formData['br_address'] : @$this->formData['address']
+ );
+ $Addr2 = array(
+ 'title' => _("Delivered To"),
+ 'name' => @$this->formData['deliver_to'],
+ 'address' => @$this->formData['delivery_address']
+ );
+
+ // default item column headers
+ $this->headers = array(_("Item Code"), _("Item Description"), _("Quantity"),
+ _("Unit"), _("Price"), _("Discount %"), _("Total"));
+
+ // for links use 'text' => 'url'
+ $Footer[0] = _("All amounts stated in") . " - " . @$this->formData['curr_code'];
+
+ switch ($this->formData['doctype'])