Option for showing company logo on reports. On company base.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 5 Sep 2017 06:58:11 +0000 (08:58 +0200)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 5 Sep 2017 06:58:11 +0000 (08:58 +0200)
admin/company_preferences.php
config.default.php
reporting/includes/pdf_report.inc

index 65c27787b69466fe87aef071b343184081c3fa69..b35ce9ea89bfe10a050e6317993a6c7d8b5aaa9b 100644 (file)
@@ -114,7 +114,7 @@ if (isset($_POST['update']) && $_POST['update'] != "")
                                'use_dimension', 'curr_default', 'f_year', 
                                'no_item_list' => 0, 'no_customer_list' => 0, 
                                'no_supplier_list' =>0, 'base_sales', 
-                               'time_zone' => 0, 'add_pct', 'round_to', 'login_tout', 'auto_curr_reval',
+                               'time_zone' => 0, 'company_logo_report' => 0, 'add_pct', 'round_to', 'login_tout', 'auto_curr_reval',
                                'bcc_email', 'alternative_tax_include_on_docs', 'suppress_tax_rates',
                                'use_manufacturing', 'use_fixed_assets'))
                );
@@ -149,6 +149,12 @@ $_POST['no_supplier_list']  = $myrow["no_supplier_list"];
 $_POST['curr_default']  = $myrow["curr_default"];
 $_POST['f_year']  = $myrow["f_year"];
 $_POST['time_zone']  = $myrow["time_zone"];
+if (empty($myrow["company_logo_report"]))
+{
+       set_company_pref("company_logo_report", "setup.company", "tinyint", 1, '0');
+       $myrow["company_logo_report"] = get_company_pref("company_logo_report");
+}
+$_POST['company_logo_report']  = $myrow["company_logo_report"];
 $_POST['version_id']  = $myrow["version_id"];
 $_POST['add_pct'] = $myrow['add_pct'];
 $_POST['login_tout'] = $myrow['login_tout'];
@@ -188,6 +194,7 @@ check_row(_("Delete Company Logo:"), 'del_coy_logo', $_POST['del_coy_logo']);
 
 check_row(_("Automatic Revaluation Currency Accounts"), 'auto_curr_reval', $_POST['auto_curr_reval']);
 check_row(_("Time Zone on Reports"), 'time_zone', $_POST['time_zone']);
+check_row(_("Company Logo on Reports"), 'company_logo_report', $_POST['company_logo_report']);
 label_row(_("Database Scheme Version"), $_POST['version_id']);
 
 table_section(2);
index 6602baf486306d64eddbcb93c9c7d4bc620917ed..65a66418df01ec41777036e838be1997fc187789 100644 (file)
@@ -127,9 +127,6 @@ if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_
 
        $config_allocation_settled_allowance = 0.005;
 
-       /* Show company logo on reports */
-       $show_company_logo_report = 0;  
-       
        /* Show average costed values instead of fixed standard cost in report, Inventory Valuation Report */
        $use_costed_values = 1; 
        
index c475a29be608bdeafbcc8807db72efac9d40190f..65aaaf9e89b690750ca60d5eb2998ea591cfa31d 100644 (file)
@@ -314,7 +314,7 @@ class FrontReport extends Cpdf
                $this->Font();
                $this->fontSize -= 4;
                $logo = company_path() . "/images/" . $this->company['coy_logo'];
-               if (!empty($SysPrefs->show_company_logo_report) && $this->company['coy_logo'] != '' && file_exists($logo))
+               if (!empty($SysPrefs->prefs['company_logo_report']) && $this->company['coy_logo'] != '' && file_exists($logo))
                {
                        $this->row -= ($this->lineHeight + 3);
                        $this->AddImage($logo, $companyCol, $this->row, 0, 30);