function add_supplier($supp_name, $supp_ref, $address, $supp_address, $phone, $phone2, $fax, $gst_no, $email,
$website, $contact, $supp_account_no, $bank_account, $credit_limit, $dimension_id, $dimension2_id,
$curr_code, $payment_terms, $payable_account, $purchase_account, $payment_discount_account,
- $notes, $tax_group_id)
+ $notes, $tax_group_id, $rep_lang)
{
$sql = "INSERT INTO ".TB_PREF."suppliers (supp_name, supp_ref, address, supp_address, phone, phone2, fax, gst_no, email, website,
contact, supp_account_no, bank_account, credit_limit, dimension_id, dimension2_id, curr_code,
- payment_terms, payable_account, purchase_account, payment_discount_account, notes, tax_group_id)
+ payment_terms, payable_account, purchase_account, payment_discount_account, notes, tax_group_id, rep_lang)
VALUES (".db_escape($_POST['supp_name']). ", "
.db_escape($supp_ref). ", "
.db_escape($address) . ", "
.db_escape($purchase_account). ", "
.db_escape($payment_discount_account). ", "
.db_escape($notes). ", "
- .db_escape($tax_group_id). ")";
+ .db_escape($tax_group_id). ", "
+ .db_escape($rep_lang ? $rep_lang : null, true). ")";
db_query($sql,"The supplier could not be added");
}
function update_supplier($supplier_id, $supp_name, $supp_ref, $address, $supp_address, $phone, $phone2, $fax, $gst_no,
$email, $website, $contact, $supp_account_no, $bank_account, $credit_limit, $dimension_id, $dimension2_id,
$curr_code, $payment_terms, $payable_account, $purchase_account, $payment_discount_account,
- $notes, $tax_group_id)
+ $notes, $tax_group_id, $rep_lang)
{
$sql = "UPDATE ".TB_PREF."suppliers SET supp_name=".db_escape($supp_name) . ",
supp_ref=".db_escape($supp_ref) . ",
purchase_account=".db_escape($purchase_account) . ",
payment_discount_account=".db_escape($payment_discount_account) . ",
notes=".db_escape($notes) . ",
- tax_group_id=".db_escape($tax_group_id) . " WHERE supplier_id = ".db_escape($supplier_id);
+ tax_group_id=".db_escape($tax_group_id) . ",
+ rep_lang=".db_escape($rep_lang ? $rep_lang : null, true) . " WHERE supplier_id = ".db_escape($supplier_id);
db_query($sql,"The supplier could not be updated");
}
$_POST['email'], $_POST['website'], $_POST['contact'], $_POST['supp_account_no'], $_POST['bank_account'],
input_num('credit_limit', 0), $_POST['dimension_id'], $_POST['dimension2_id'], $_POST['curr_code'],
$_POST['payment_terms'], $_POST['payable_account'], $_POST['purchase_account'], $_POST['payment_discount_account'],
- $_POST['notes'], $_POST['tax_group_id']);
+ $_POST['notes'], $_POST['tax_group_id'], $_POST['rep_lang']);
update_record_status($_POST['supplier_id'], $_POST['inactive'],
'suppliers', 'supplier_id');
$_POST['website'], $_POST['contact'], $_POST['supp_account_no'], $_POST['bank_account'],
input_num('credit_limit',0), $_POST['dimension_id'], $_POST['dimension2_id'],
$_POST['curr_code'], $_POST['payment_terms'], $_POST['payable_account'], $_POST['purchase_account'],
- $_POST['payment_discount_account'], $_POST['notes'], $_POST['tax_group_id']);
+ $_POST['payment_discount_account'], $_POST['notes'], $_POST['tax_group_id'], $_POST['rep_lang']);
$_POST['supplier_id'] = db_insert_id();
$new_supplier = false;
$_POST['dimension_id'] = $myrow["dimension_id"];
$_POST['dimension2_id'] = $myrow["dimension2_id"];
$_POST['curr_code'] = $myrow["curr_code"];
+ $_POST['rep_lang'] = $myrow["rep_lang"];
$_POST['payment_terms'] = $myrow["payment_terms"];
$_POST['credit_limit'] = price_format($myrow["credit_limit"]);
$_POST['tax_group_id'] = $myrow["tax_group_id"];
$company_record = get_company_prefs();
$_POST['curr_code'] = $company_record["curr_default"];
+ $_POST['rep_lang'] = $dflt_lang;
$_POST['payable_account'] = $company_record["creditors_act"];
$_POST['purchase_account'] = $company_record["default_cogs_act"];
$_POST['payment_discount_account'] = $company_record['pyt_discount_act'];
currencies_list_row(_("Supplier's Currency:"), 'curr_code', null);
}
+languages_list_row(_("Document Language:"), 'rep_lang', null, _('System default'));
+
tax_groups_list_row(_("Tax Group:"), 'tax_group_id', null);
payment_terms_list_row(_("Payment Terms:"), 'payment_terms', null);
class Cpdf extends FPDI {
- function Cpdf($pageSize='A4', $l=array(), $pageOrientation='P')
+ function Cpdf($pageSize='A4', $lang=null, $pageOrientation='P')
{
+ $this->TCPDF($pageOrientation, 'pt', $pageSize);//, $uni, $enc);
+ $this->SetLang($lang);
+ $this->setPrintHeader(false);
+ $this->setPrintFooter(false);
+ $this->setPDFVersion("1.3");
+ $this->setAutoPageBreak(0);
+ $this->SetLineWidth(1);
+ $this->cMargin = 0;
+ }
+ /*
+ Set lamguage for next report
+ */
+ function SetLang($code=null)
+ {
+ global $installed_languages, $dflt_lang, $path_to_root;
+
+ if (!$code)
+ $code = $dflt_lang;
+
+ $lang = array_search_value($code, $installed_languages, 'code');
+ $_SESSION['get_text']->set_language($lang['code'], strtoupper($lang['encoding']));
+ $_SESSION['get_text']->add_domain($lang['code'], $path_to_root . "/lang");
+
+ // re-read translated sys names.
+ include($path_to_root.'/includes/sysnames.inc');
+
+ $l = array('a_meta_charset' => strtoupper($lang['encoding']),
+ 'a_meta_dir' => @$lang['rtl'] ? 'rtl' : 'ltr',
+ 'a_meta_language' => $code, 'w_page' => 'page');
+
if (!isset($l['a_meta_charset']))
$l = array('a_meta_charset' => 'ISO-8859-1', 'a_meta_dir' => 'ltr', 'a_meta_language' => 'en_GB', 'w_page' => 'page');
$enc = $l['a_meta_charset'];
$uni = ($enc == 'UTF-8' || $enc == 'GB2312' ? true : false);
if ($uni)
ini_set("memory_limit", "48M");
- $this->TCPDF($pageOrientation, 'pt', $pageSize, $uni, $enc);
+
+ $this->isunicode = $uni;
$this->setLanguageArray($l);
- $this->setPrintHeader(false);
- $this->setPrintFooter(false);
- $this->setPDFVersion("1.3");
- $this->setAutoPageBreak(0);
- $this->SetLineWidth(1);
- $this->cMargin = 0;
+ if ($uni)
+ {
+ global $unicode, $unicode_mirror, $unicode_arlet, $laa_array, $diacritics;
+ include_once(dirname(__FILE__)."/unicode_data2.php");
+ }
+ $this->encoding = strtoupper($lang['encoding']);
+
+ $this->FontFamily = 'helvetica';
+ $this->FontStyle = '';
+ $this->FontSizePt = 12;
+// $this->utf8Bidi(array(""));
}
+
// $fontname should be a standard PDF font (like 'times', 'helvetica' or 'courier')
// or one that's been installed on your system. An empty string can also be used
// which will retain the font currently in use.
function addInfo($label,$value)
{
- if($label=='Title')
- {
- $this->SetTitle($value);
- }
- if ($label=='Subject')
- {
- $this->SetSubject($value);
- }
- if($label=='Creator')
- {
- // The Creator info in source is not exactly it should be ;)
- $value = str_replace( "ros.co.nz", "tcpdf.org", $value );
- $value = str_replace( "R&OS", "", $value );
- $this->SetCreator( $value );
- }
- if($label=='Author')
- {
- $this->SetAuthor($value);
+ if (in_array($label, array( 'Title', 'Subject', 'Author', 'Creator'))) {
+ $seter = "Set{$label}";
+ $this->$seter($value);
}
}
parent::Ellipse($x0, $y0, $r1, $r2, $angle, $astart. $afinish, ($close?'C':''), "", "", $nSeg);
}
- function Stream()
+ function Stream($fname='')
{
- parent::Output('', 'I');
+ parent::Output($fname, 'I');
}
function calcTextWrap($txt, $width, $spacebreak=false)
+++ /dev/null
-<?php
-/**********************************************************************
- Copyright (C) FrontAccounting, LLC.
- Released under the terms of the GNU General Public License, GPL,
- as published by the Free Software Foundation, either version 3
- of the License, or (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
-***********************************************************************/
-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";
- $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_Extra = "";
- $doc_Our_VAT_no = "Our VAT No.";
- $doc_Domicile = "Domicile";
- 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_Please_Quote = "Please quote ".($doctype==ST_SALESINVOICE ? "Invoice" : "Credit")
- ." no. when paying. All amounts stated in";
- $doc_Bank_Account = "Bank Account";
- }
- $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)
- {
- if ($doctype == ST_SALESQUOTE)
- $this->title = "SALES QUOTATION";
- elseif ($doctype == ST_PURCHORDER)
- $this->title = "PURCHASE ORDER";
- elseif ($doctype == ST_SALESORDER)
- $this->title = ($print_as_quote==1 ? "QUOTE" : "SALES ORDER");
- elseif ($doctype == ST_SALESINVOICE)
- $this->title = "INVOICE";
- elseif ($doctype == ST_CUSTDELIVERY)
- $this->title = ($packing_slip==1 ? "PACKING SLIP" : "DELIVERY NOTE");
- elseif ($doctype == ST_WORKORDER)
- $this->title = "WORK ORDER";
- elseif ($doctype == ST_SUPPAYMENT)
- $this->title = "REMITTANCE";
- elseif ($doctype == ST_CUSTPAYMENT)
- $this->title = "RECEIPT";
- else
- $this->title = "CREDIT NOTE";
- if ($doctype == ST_PURCHORDER)
- $this->headers = array('Item Code', 'Item Description', 'Delivery Date',
- 'Quantity', 'Unit', 'Price', 'Total');
- elseif ($doctype == ST_WORKORDER)
- $this->headers = array("Item Code", "Item Description",
- "From Location", "Work Centre", "Unit Quantity", "Total Quantity", "Units Issued");
- elseif ($doctype == ST_SUPPAYMENT || $doctype == ST_CUSTPAYMENT)
- $this->headers = array('Trans Type', '#', 'Date', 'Due Date', 'Total Amount', 'Left to Allocate', 'This Allocation');
- else
- $this->headers = array('Item Code', 'Item Description', 'Quantity', 'Unit',
- 'Price', 'Discount %', 'Total');
- }
- elseif ($doctype == ST_STATEMENT)
- {
- $this->title = "STATEMENT";
- $this->headers = array('Trans Type', '#', 'Date', 'Due Date', 'Charges',
- 'Credits', 'Allocated', 'Outstanding');
- }
-}
-if (isset($emailtype))
-{
- $doc_Dear_Sirs = "Dear";
- $doc_AttachedFile = "Attached you will find ";
- $doc_Kindest_regards = "Kindest regards";
- $doc_Payment_Link = "You can pay through";
-}
-if (isset($header2type) || isset($linetype))
-{
- $doc_Invoice_no = ($doctype==ST_CUSTDELIVERY ? "Delivery Note No." :
- ($doctype == ST_CUSTPAYMENT ? "Receipt No." :
- ($doctype == ST_SUPPAYMENT ? "Remittance No." :
- (($doctype == ST_SALESQUOTE || $doctype==ST_PURCHORDER || $doctype==ST_SALESORDER) ? "Order no." :
- ($doctype==ST_SALESINVOICE ? "Invoice No." : ($doctype == ST_WORKORDER ? "Work Order No." : "Credit No."))))));
- $doc_Delivery_no = "Delivery Note No.";
- $doc_Order_no = "Order No.";
-}
-if (isset($linetype))
-{
- if ($doctype == ST_SALESQUOTE || $doctype == ST_PURCHORDER || $doctype == ST_SALESORDER || $doctype == ST_SALESINVOICE ||
- $doctype == ST_CUSTCREDIT || $doctype == ST_CUSTDELIVERY)
- {
- $doc_Sub_total = "Sub-total";
- $doc_Shipping = "Shipping";
- $doc_Included = "Included";
- $doc_Amount = "amount";
- $doc_TOTAL_INVOICE = $doctype==ST_SALESINVOICE ? "TOTAL INVOICE" : "TOTAL CREDIT";
- $doc_TOTAL_ORDER = "TOTAL ORDER EX VAT";
- $doc_TOTAL_ORDER2 = "TOTAL ORDER VAT INCL.";
- $doc_TOTAL_PO = "TOTAL PO EX VAT";
- $doc_TOTAL_DELIVERY = "TOTAL DELIVERY INCL. VAT";
- }
- elseif ($doctype == ST_SUPPAYMENT || $doctype == ST_CUSTPAYMENT)
- {
- $doc_Towards = "As advance / full / part / payment towards:";
- $doc_by_Cheque = "By Cash / Cheque* / Draft No.";
- $doc_Dated = "Dated";
- $doc_Drawn = "Drawn on Bank";
- $doc_Drawn_Branch = "Branch";
- $doc_Received = "Received / Sign";
- $doc_Total_Allocated = "Total Allocated";
- $doc_Left_To_Allocate = "Left to Allocate";
- if ($doctype == ST_CUSTPAYMENT)
- $doc_Total_Payment = "TOTAL RECEIPT";
- else
- $doc_Total_Payment = "TOTAL REMITTANCE";
- }
- elseif ($doctype == ST_STATEMENT)
- {
- $doc_Outstanding = "Outstanding Transactions";
- $doc_Current = "Current";
- $doc_Total_Balance = "Total Balance";
- $doc_Statement = "Statement";
- $doc_as_of = "as of";
- $doc_Days = "Days";
- $doc_Over = "Over";
- }
-}
-?>
\ No newline at end of file
$this->currency = '';
$this->scaleLogoWidth = false; // if Logo, scale on width (else height).
$this->SetHeaderType('Header'); // default
-
- $rtl = ($_SESSION['language']->dir === 'rtl' ? 'rtl' : 'ltr');
- $code = $_SESSION['language']->code;
- $enc = strtoupper($_SESSION['language']->encoding);
- // for the language array in class.pdf.inc
- $l = array('a_meta_charset' => $enc, 'a_meta_dir' => $rtl, 'a_meta_language' => $code, 'w_page' => 'page');
- $this->Cpdf($size, $l, $orientation);
+
+ $this->Cpdf($size, $_SESSION['language']->code, $orientation);
}
/*
'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'),
+ 'ov_freight', 'ov_gst', 'ov_amount', 'rep_lang'),
+ 'branch' => array('br_address', 'br_name', 'salesman', 'disable_branch', 'rep_lang'),
'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])) {
+ if (isset(${$var}[$locname]) && (${$var}[$locname]!==null)) {
$this->formData[$locname] = ${$var}[$locname];
}
}
}
}
$this->formData['doctype'] = $doctype;
+ error_log('cust:'.var_export($myrow, true));
+ error_log('branch:'.var_export($branch, true));
}
/*
Set header handler
*/
function Header2()
{
- global $comp_path, $path_to_root, $print_as_quote, $print_invoice_no, $packing_slip; // FIXME
+ global $path_to_root, $print_as_quote,
+ $print_invoice_no, $packing_slip, $dflt_lang; // FIXME should be passed as params
$doctype = $this->formData['doctype'];
$header2type = true;
+ $this->SetLang(@$this->formData['rep_lang'] ? $this->formData['rep_lang'] : $dflt_lang);
+
// leave layout files names without path to enable including
- // modified versions from comapny/x/reporting directory
- if (isset($myrow['curr_code']) && $this->currency != $myrow['curr_code'])
- {
- include("includes/doctext2.inc");
- }
- else
- {
- include("includes/doctext.inc");
- }
-
+ // modified versions from company/x/reporting directory
+ include("includes/doctext.inc");
include("includes/header2.inc");
$this->row = $temp;
// Alternate header style which also supports a simple footer
function Header3()
{
- global $comp_path;
-
// Turn off cell padding for the main report header, restoring the current setting later
$oldcMargin = $this->cMargin;
$this->SetCellPadding(0);
if ($this->companyLogoEnable && ($this->company['coy_logo'] != ''))
{
// Build a string specifying the location of the company logo file
- $logo = $comp_path .'/'. user_company() . "/images/" . $this->company['coy_logo'];
+ $logo = company_path() . "/images/" . $this->company['coy_logo'];
// Width being zero means that the image will be scaled to the specified height
// keeping its aspect ratio intact.
function End($email=0, $subject=null, $myrow=null, $doctype = 0)
{
- global $pdf_debug, $path_to_root, $comp_path;
+ global $pdf_debug, $path_to_root;
if ($pdf_debug == 1)
{
else
{
- $dir = $comp_path.'/'.user_company(). '/pdf_files';
+ $dir = company_path(). '/pdf_files';
//save the file
if (!file_exists($dir))
{
else
$fname = $dir.'/'.uniqid('').'.pdf';
$this->Output($fname, 'F');
+
if ($email == 1)
{
$emailtype = true;
- if ($this->currency != $myrow['curr_code'])
- {
- include("includes/doctext2.inc");
- }
- else
- {
- include("includes/doctext.inc");
- }
+ $this->SetLang($this->formData['rep_lang']);
+ include("includes/doctext.inc");
+
require_once($path_to_root . "/reporting/includes/class.mail.inc");
$mail = new email(str_replace(",", "", $this->company['coy_name']), $this->company['email']);
if (!isset($myrow['email']) || $myrow['email'] == '')
{
$printer = get_report_printer(user_print_profile(), $this->rep_id);
if ($printer == false) {
- if(in_ajax()) {
+ if (in_ajax()) {
global $Ajax;
if (user_rep_popup())
else
$Ajax->redirect($fname); // otherwise use faster method
} else {
- header('Content-type: application/pdf');
- header("Content-Disposition: inline; filename=$this->filename");
- header('Expires: 0');
- header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
- header('Pragma: public');
-
- $this->Stream();
+ header('Content-type: application/pdf');
+ header('Content-Disposition: inline; filename='.$this->filename);
+ header('Expires: 0');
+ header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
+ header('Pragma: public');
+// $this->Stream(basename($fname));
+ $this->Stream($this->filename);
}
} else { // send report to network printer
$prn = new remote_printer($printer['queue'],$printer['host'],
$rep->row = $rep->bottomMargin + (15 * $rep->lineHeight);
$linetype = true;
$doctype = $j;
- if ($rep->currency != $myrow['curr_code'])
- {
- include($path_to_root . "/reporting/includes/doctext2.inc");
- }
- else
- {
- include($path_to_root . "/reporting/includes/doctext.inc");
- }
+ include($path_to_root . "/reporting/includes/doctext.inc");
$rep->TextCol(3, 6, $doc_Sub_total, -2);
$rep->TextCol(6, 7, $DisplaySubTot, -2);
$rep->Info($params, $cols, null, $aligns);
}
- $sql = "SELECT debtor_no, name AS DebtorName, address, tax_id, email, curr_code, curdate() AS tran_date FROM ".TB_PREF."debtors_master";
+ $sql = "SELECT debtor_no, name AS DebtorName, address, tax_id, email, curr_code, curdate() AS tran_date, rep_lang FROM ".TB_PREF."debtors_master";
if ($customer != ALL_NUMERIC)
$sql .= " WHERE debtor_no = ".db_escape($customer);
else
$rep->NewLine();
$linetype = true;
$doctype = ST_STATEMENT;
- if ($rep->currency != $myrow['curr_code'])
- {
- include($path_to_root . "/reporting/includes/doctext2.inc");
- }
- else
- {
- include($path_to_root . "/reporting/includes/doctext.inc");
- }
+ include($path_to_root . "/reporting/includes/doctext.inc");
$rep->fontSize += 2;
$rep->TextCol(0, 8, $doc_Outstanding);
$rep->fontSize -= 2;
$rep->row = $rep->bottomMargin + (15 * $rep->lineHeight);
$linetype = true;
$doctype = ST_SALESORDER;
- if ($rep->currency != $myrow['curr_code'])
- {
- include($path_to_root . "/reporting/includes/doctext2.inc");
- }
- else
- {
- include($path_to_root . "/reporting/includes/doctext.inc");
- }
+ include($path_to_root . "/reporting/includes/doctext.inc");
$rep->TextCol(3, 6, $doc_Sub_total, -2);
$rep->TextCol(6, 7, $DisplaySubTot, -2);
$rep->row = $rep->bottomMargin + (15 * $rep->lineHeight);
$linetype = true;
$doctype=ST_CUSTDELIVERY;
- if ($rep->currency != $myrow['curr_code'])
- {
- include($path_to_root . "/reporting/includes/doctext2.inc");
- }
- else
- {
- include($path_to_root . "/reporting/includes/doctext.inc");
- }
+ include($path_to_root . "/reporting/includes/doctext.inc");
if ($packing_slip == 0)
{
$rep->TextCol(3, 6, $doc_Sub_total, -2);
$rep->row = $rep->bottomMargin + (15 * $rep->lineHeight);
$linetype = true;
$doctype = ST_SALESQUOTE;
- if ($rep->currency != $myrow['curr_code'])
- {
- include($path_to_root . "/reporting/includes/doctext2.inc");
- }
- else
- {
- include($path_to_root . "/reporting/includes/doctext.inc");
- }
+ include($path_to_root . "/reporting/includes/doctext.inc");
$rep->TextCol(3, 6, $doc_Sub_total, -2);
$rep->TextCol(6, 7, $DisplaySubTot, -2);
(".TB_PREF."debtor_trans.ov_amount + ".TB_PREF."debtor_trans.ov_gst + ".TB_PREF."debtor_trans.ov_freight +
".TB_PREF."debtor_trans.ov_freight_tax + ".TB_PREF."debtor_trans.ov_discount) AS Total,
".TB_PREF."debtors_master.name AS DebtorName, ".TB_PREF."debtors_master.debtor_ref,
- ".TB_PREF."debtors_master.curr_code, ".TB_PREF."debtors_master.payment_terms, ".TB_PREF."debtors_master.tax_id AS tax_id,
+ ".TB_PREF."debtors_master.curr_code, ".TB_PREF."debtors_master.payment_terms, "
+ .TB_PREF."debtors_master.tax_id AS tax_id,".TB_PREF."debtors_master.rep_lang,
".TB_PREF."debtors_master.email, ".TB_PREF."debtors_master.address
FROM ".TB_PREF."debtor_trans, ".TB_PREF."debtors_master
WHERE ".TB_PREF."debtor_trans.debtor_no = ".TB_PREF."debtors_master.debtor_no
$linetype = true;
$doctype = ST_CUSTPAYMENT;
- if ($rep->currency != $myrow['curr_code'])
- {
- include($path_to_root . "/reporting/includes/doctext2.inc");
- }
- else
- {
- include($path_to_root . "/reporting/includes/doctext.inc");
- }
+ include($path_to_root . "/reporting/includes/doctext.inc");
$total_allocated = 0;
$rep->TextCol(0, 4, $doc_Towards, -2);
//----------------------------------------------------------------------------------------------------
function get_po($order_no)
{
- $sql = "SELECT ".TB_PREF."purch_orders.*, ".TB_PREF."suppliers.supp_name, ".TB_PREF."suppliers.supp_account_no,
+ $sql = "SELECT ".TB_PREF."purch_orders.*, ".TB_PREF."suppliers.supp_name, "
+ .TB_PREF."suppliers.rep_lang, ".TB_PREF."suppliers.supp_account_no,
".TB_PREF."suppliers.curr_code, ".TB_PREF."suppliers.payment_terms, ".TB_PREF."locations.location_name,
".TB_PREF."suppliers.email, ".TB_PREF."suppliers.address, ".TB_PREF."suppliers.contact
FROM ".TB_PREF."purch_orders, ".TB_PREF."suppliers, ".TB_PREF."locations
$rep->row = $rep->bottomMargin + (15 * $rep->lineHeight);
$linetype = true;
$doctype = ST_PURCHORDER;
- if ($rep->currency != $myrow['curr_code'])
- {
- include($path_to_root . "/reporting/includes/doctext2.inc");
- }
- else
- {
- include($path_to_root . "/reporting/includes/doctext.inc");
- }
+ include($path_to_root . "/reporting/includes/doctext.inc");
$rep->TextCol(3, 6, $doc_Sub_total, -2);
$rep->TextCol(6, 7, $DisplaySubTot, -2);
{
$sql = "SELECT ".TB_PREF."supp_trans.*,
(".TB_PREF."supp_trans.ov_amount+".TB_PREF."supp_trans.ov_gst+".TB_PREF."supp_trans.ov_discount) AS Total,
- ".TB_PREF."suppliers.supp_name, ".TB_PREF."suppliers.supp_account_no,
+ ".TB_PREF."suppliers.supp_name, ".TB_PREF."suppliers.supp_account_no, ".TB_PREF."suppliers.rep_lang,
".TB_PREF."suppliers.curr_code, ".TB_PREF."suppliers.payment_terms, ".TB_PREF."suppliers.gst_no AS tax_id,
".TB_PREF."suppliers.email, ".TB_PREF."suppliers.address, ".TB_PREF."suppliers.contact
FROM ".TB_PREF."supp_trans, ".TB_PREF."suppliers
$linetype = true;
$doctype = ST_SUPPAYMENT;
- if ($rep->currency != $myrow['curr_code'])
- {
- include($path_to_root . "/reporting/includes/doctext2.inc");
- }
- else
- {
- include($path_to_root . "/reporting/includes/doctext.inc");
- }
+ include($path_to_root . "/reporting/includes/doctext.inc");
$total_allocated = 0;
$rep->TextCol(0, 4, $doc_Towards, -2);
ALTER TABLE `0_chart_types` CHANGE `class_id` `class_id` VARCHAR(3) NOT NULL DEFAULT '';
.
UPDATE `0_chart_types` SET parent='' WHERE parent='0' OR parent='-1';
+
+ALTER TABLE `0_debtors_master` ADD COLUMN `rep_lang` char(5) default NULL;
+UPDATE `0_debtors_master` set `rep_lang`= 'en_GB' WHERE `curr_code`<>(SELECT value FROM `0_sys_prefs` WHERE name='curr_default');
+
+ALTER TABLE `0_cust_branch` ADD COLUMN `rep_lang` char(5) default NULL;
+
+ALTER TABLE `0_suppliers` ADD COLUMN `rep_lang` char(5) default NULL;
+UPDATE `0_suppliers` set `rep_lang`= 'en_GB' WHERE `curr_code`<>(SELECT value FROM `0_sys_prefs` WHERE name='curr_default');
`br_post_address` tinytext NOT NULL,
`group_no` int(11) NOT NULL default '0',
`notes` tinytext NOT NULL,
+ `rep_lang` char(5) default NULL,
`inactive` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`branch_code`,`debtor_no`),
KEY `branch_code` (`branch_code`),
### Data of table `0_cust_branch` ###
-INSERT INTO `0_cust_branch` VALUES ('1', '1', 'Beefeater Ltd.', 'Beefeater', '', '1', '1', '', '', '', 'Main Branch', '', 'DEF', '2', '', '4510', '1200', '4500', '1', '0', 'Address 1\r\nAddress 2\r\nAddress 3', '0', '', '0');
-INSERT INTO `0_cust_branch` VALUES ('2', '2', 'Ghostbusters Corp.', 'Ghostbusters', 'Address 1\r\nAddress 2\r\nAddress 3', '1', '1', '', '', '', 'Main Branch', '', 'DEF', '1', '', '4510', '1200', '4500', '1', '0', 'Address 1\r\nAddress 2\r\nAddress 3', '0', '', '0');
-INSERT INTO `0_cust_branch` VALUES ('3', '3', 'Brezan', 'Brezan', 'Address 1\r\nAddress 2\r\nAddress 3', '1', '1', '', '', '', 'Main Branch', '', 'DEF', '1', '', '4510', '1200', '4500', '1', '0', 'Address 1\r\nAddress 2\r\nAddress 3', '0', '', '0');
+INSERT INTO `0_cust_branch` VALUES ('1', '1', 'Beefeater Ltd.', 'Beefeater', '', '1', '1', '', '', '', 'Main Branch', '', 'DEF', '2', '', '4510', '1200', '4500', '1', '0', 'Address 1\r\nAddress 2\r\nAddress 3', '0', '', '', '0');
+INSERT INTO `0_cust_branch` VALUES ('2', '2', 'Ghostbusters Corp.', 'Ghostbusters', 'Address 1\r\nAddress 2\r\nAddress 3', '1', '1', '', '', '', 'Main Branch', '', 'DEF', '1', '', '4510', '1200', '4500', '1', '0', 'Address 1\r\nAddress 2\r\nAddress 3', '0', '', '', '0');
+INSERT INTO `0_cust_branch` VALUES ('3', '3', 'Brezan', 'Brezan', 'Address 1\r\nAddress 2\r\nAddress 3', '1', '1', '', '', '', 'Main Branch', '', 'DEF', '1', '', '4510', '1200', '4500', '1', '0', 'Address 1\r\nAddress 2\r\nAddress 3', '0', '', '', '0');
### Structure of table `0_debtor_trans` ###
`email` varchar(100) NOT NULL default '',
`tax_id` varchar(55) NOT NULL default '',
`curr_code` char(3) NOT NULL default '',
+ `rep_lang` char(5) default NULL,
`sales_type` int(11) NOT NULL default '1',
`dimension_id` int(11) NOT NULL default '0',
`dimension2_id` int(11) NOT NULL default '0',
### Data of table `0_debtors_master` ###
-INSERT INTO `0_debtors_master` VALUES ('1', 'Beefeater Ltd.', 'Beefeater', 'Addr 1\r\nAddr 2\r\nAddr 3', '', '345678', 'GBP', '2', '0', '0', '1', '3', '0', '0', '1000', '', '0');
-INSERT INTO `0_debtors_master` VALUES ('2', 'Ghostbusters Corp.', 'Ghostbusters', 'Address 1\r\nAddress 2\r\nAddress 3', '', '2222222', 'USD', '1', '0', '0', '1', '4', '0', '0', '1000', '', '0');
-INSERT INTO `0_debtors_master` VALUES ('3', 'Brezan', 'Brezan', 'Address 1\r\nAddress 2\r\nAddress 3', '', '7777777', 'EUR', '2', '0', '0', '1', '3', '0', '0', '1000', '', '0');
+INSERT INTO `0_debtors_master` VALUES ('1', 'Beefeater Ltd.', 'Beefeater', 'Addr 1\r\nAddr 2\r\nAddr 3', '', '345678', 'GBP', '', '2', '0', '0', '1', '3', '0', '0', '1000', '', '0');
+INSERT INTO `0_debtors_master` VALUES ('2', 'Ghostbusters Corp.', 'Ghostbusters', 'Address 1\r\nAddress 2\r\nAddress 3', '', '2222222', 'USD', '', '1', '0', '0', '1', '4', '0', '0', '1000', '', '0');
+INSERT INTO `0_debtors_master` VALUES ('3', 'Brezan', 'Brezan', 'Address 1\r\nAddress 2\r\nAddress 3', '', '7777777', 'EUR', '', '2', '0', '0', '1', '3', '0', '0', '1000', '', '0');
### Structure of table `0_dimensions` ###
`website` varchar(100) NOT NULL default '',
`bank_account` varchar(60) NOT NULL default '',
`curr_code` char(3) default NULL,
+ `rep_lang` char(5) default NULL,
`payment_terms` int(11) default NULL,
`dimension_id` int(11) default '0',
`dimension2_id` int(11) default '0',
### Data of table `0_suppliers` ###
-INSERT INTO `0_suppliers` VALUES ('1', 'Junk Beer ApS', 'Junk Beer', 'Mailing 1\r\nMailing 2\r\nMailing 3', 'Address 1\r\nAddress 2\r\nAddress 3', '+45 55667788', '', '', '123456', 'Contact', '111', '', '', '', 'DKK', '3', '1', '0', '2', '1', '5010', '2100', '5060', 'A supplier with junk beers.', '0');
-INSERT INTO `0_suppliers` VALUES ('2', 'Lucky Luke Inc.', 'Lucky Luke', 'Mailing 1\r\nMailing 2\r\nMailing 3', 'Address 1\r\nAddress 2\r\nAddress 3', '(111) 222.333.444', '', '', '654321', 'Luke', '333', '', '', '', 'USD', '3', '0', '0', '1', '1', '5010', '2100', '5060', '', '0');
-INSERT INTO `0_suppliers` VALUES ('3', 'Money Makers Ltd.', 'Money Makers', 'Mailing 1\r\nMailing 2\r\nMailing 3', 'Address 1\r\nAddress 2\r\nAddress 3', '+44 444 555 666', '', '', '987654', 'Makers', '222', '', '', '', 'GBP', '3', '0', '0', '2', '1', '5010', '2100', '5060', '', '0');
+INSERT INTO `0_suppliers` VALUES ('1', 'Junk Beer ApS', 'Junk Beer', 'Mailing 1\r\nMailing 2\r\nMailing 3', 'Address 1\r\nAddress 2\r\nAddress 3', '+45 55667788', '', '', '123456', 'Contact', '111', '', '', '', 'DKK', '', '3', '1', '0', '2', '1', '5010', '2100', '5060', 'A supplier with junk beers.', '0');
+INSERT INTO `0_suppliers` VALUES ('2', 'Lucky Luke Inc.', 'Lucky Luke', 'Mailing 1\r\nMailing 2\r\nMailing 3', 'Address 1\r\nAddress 2\r\nAddress 3', '(111) 222.333.444', '', '', '654321', 'Luke', '333', '', '', '', 'USD', '', '3', '0', '0', '1', '1', '5010', '2100', '5060', '', '0');
+INSERT INTO `0_suppliers` VALUES ('3', 'Money Makers Ltd.', 'Money Makers', 'Mailing 1\r\nMailing 2\r\nMailing 3', 'Address 1\r\nAddress 2\r\nAddress 3', '+44 444 555 666', '', '', '987654', 'Makers', '222', '', '', '', 'GBP', '', '3', '0', '0', '2', '1', '5010', '2100', '5060', '', '0');
### Structure of table `0_sys_prefs` ###
`br_post_address` tinytext NOT NULL,
`group_no` int(11) NOT NULL default '0',
`notes` tinytext NOT NULL,
+ `rep_lang` char(5) default NULL,
`inactive` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`branch_code`,`debtor_no`),
KEY `branch_code` (`branch_code`),
`email` varchar(100) NOT NULL default '',
`tax_id` varchar(55) NOT NULL default '',
`curr_code` char(3) NOT NULL default '',
+ `rep_lang` char(5) default NULL,
`sales_type` int(11) NOT NULL default '1',
`dimension_id` int(11) NOT NULL default '0',
`dimension2_id` int(11) NOT NULL default '0',
`website` varchar(100) NOT NULL default '',
`bank_account` varchar(60) NOT NULL default '',
`curr_code` char(3) default NULL,
+ `rep_lang` char(5) default NULL,
`payment_terms` int(11) default NULL,
`dimension_id` int(11) default '0',
`dimension2_id` int(11) default '0',