<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Trying to change Printing Profiles]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=4401&amp;type=atom" />
	<updated>2013-09-18T16:20:36Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=4401</id>
		<entry>
			<title type="html"><![CDATA[Re: Trying to change Printing Profiles]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=17876#p17876" />
			<content type="html"><![CDATA[<p>Nice <a href="http://devel.frontaccounting.com/git/?p=fa-stable.git;a=commitdiff;h=38aefa8e6e4edeffecb139d7d7d200b38d41e16e">Fix</a>.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2013-09-18T16:20:36Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=17876#p17876</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Trying to change Printing Profiles]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=17870#p17870" />
			<content type="html"><![CDATA[<p>Fixed in repo, thanks.<br />Janusz</p>]]></content>
			<author>
				<name><![CDATA[itronics]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=89</uri>
			</author>
			<updated>2013-09-18T13:33:33Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=17870#p17870</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Trying to change Printing Profiles]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=17861#p17861" />
			<content type="html"><![CDATA[<p>Lines 1109-1123 of <strong>sql/en_US-new.sql</strong>:<br /></p><div class="codebox"><pre><code>CREATE TABLE IF NOT EXISTS `0_print_profiles` (
  `id` smallint(6) unsigned NOT NULL auto_increment,
  `profile` varchar(30) NOT NULL,
  `report` varchar(5) default NULL,
  `printer` tinyint(3) unsigned default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `profile` (`profile`,`report`)
) ENGINE=MyISAM  AUTO_INCREMENT=10 ;

--
-- Dumping data for table `0_print_profiles`
--

INSERT INTO `0_print_profiles` VALUES(1, &#039;Out of office&#039;, &#039;&#039;, 0);
INSERT INTO `0_print_profiles` VALUES(2, &#039;Sales Department&#039;, &#039;&#039;, 0);</code></pre></div><p>Therefore an integer should be used and not a string. This was not an issue for older MySQL versions, but the later ones after Oracle took over seem to become more strict in such insert syntaxes. Wonder if NULL values would cause trouble (backward compatibility issues) or a mere 0 should suffice.</p><p>Lines 52-65 of <strong>admin/db/printers_db.inc</strong>:<br /></p><div class="codebox"><pre><code>function update_printer_profile($name, $dest)
{
    foreach( $dest as $rep =&gt; $printer) {
        if ($printer != &#039;&#039; || $rep == &#039;&#039;) {
            $sql = &quot;REPLACE INTO &quot;.TB_PREF.&quot;print_profiles &quot;
            .&quot;(profile, report, printer) VALUES (&quot;
            .db_escape($name).&quot;,&quot;
            .db_escape($rep).&quot;,&quot;
            .db_escape($printer).&quot;)&quot;;
        } else {
            $sql = &quot;DELETE FROM &quot;.TB_PREF.&quot;print_profiles WHERE (&quot;
                .&quot;report=&quot; . db_escape($rep)
                .&quot; AND profile=&quot;.db_escape($name).&quot;)&quot;;
        }</code></pre></div><p>A prior integer cast for <strong>$printer</strong> may be in order here.</p><p>The offending line is line 60 in the above code:<br /></p><div class="codebox"><pre><code>            .db_escape($printer).&quot;)&quot;;</code></pre></div><p>which may be replaced with:<br /></p><div class="codebox"><pre><code>            . ($printer + 0) .&quot;)&quot;;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2013-09-18T02:51:02Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=17861#p17861</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Trying to change Printing Profiles]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=17855#p17855" />
			<content type="html"><![CDATA[<p>When I try to make changes to the Sales Department profile, I get this error:</p><p>DATABASE ERROR : could not update printing profile<br />error code : 1366<br />error message : Incorrect integer value: &#039;&#039; for column &#039;printer&#039; at row 1<br />sql that failed was : REPLACE INTO 9_print_profiles (profile, report, printer) VALUES (&#039;Sales Department&#039;,&#039;&#039;,&#039;&#039;)</p>]]></content>
			<author>
				<name><![CDATA[crspencer@sol-tech.co]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=18469</uri>
			</author>
			<updated>2013-09-17T21:34:51Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=17855#p17855</id>
		</entry>
</feed>
