<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Adding Column Value in Drop Down]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7612&amp;type=atom" />
	<updated>2018-07-11T08:26:42Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=7612</id>
		<entry>
			<title type="html"><![CDATA[Re: Adding Column Value in Drop Down]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32171#p32171" />
			<content type="html"><![CDATA[<p>You can use query concatenation to achieve this. </p><div class="codebox"><pre><code>CONCAT_WS(&#039; &#039;, i.description, s.long_description) as full_description </code></pre></div><p>Use the full_description within the combo_input</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2018-07-11T08:26:42Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32171#p32171</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Adding Column Value in Drop Down]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32168#p32168" />
			<content type="html"><![CDATA[<p>Can&#039;t we use both? i.description and s.long_description?</p>]]></content>
			<author>
				<name><![CDATA[boxygen]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=20175</uri>
			</author>
			<updated>2018-07-11T07:06:31Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32168#p32168</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Adding Column Value in Drop Down]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32167#p32167" />
			<content type="html"><![CDATA[<p>You can replace the <em>i.description</em> with the <strong>s.long_description</strong> with appropriate substitution there or add in the latter where the former is.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-07-11T06:59:03Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32167#p32167</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Adding Column Value in Drop Down]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32161#p32161" />
			<content type="html"><![CDATA[<p>I want to add another column in Drop Down List in following function i.e. <strong>s.long_description</strong>. What changes shall I make</p><div class="codebox"><pre><code>function sales_items_list($name, $selected_id=null, $all_option=false,
    $submit_on_change=false, $type=&#039;&#039;, $opts=array())
{
    // all sales codes
    $sql = &quot;SELECT i.item_code, i.description, c.description, count(*)&gt;1 as kit,
             i.inactive, if(count(*)&gt;1, &#039;0&#039;, s.editable) as editable
            FROM
            &quot;.TB_PREF.&quot;stock_master s,
            &quot;.TB_PREF.&quot;item_codes i
            LEFT JOIN
            &quot;.TB_PREF.&quot;stock_category c
            ON i.category_id=c.category_id
            WHERE i.stock_id=s.stock_id
      AND mb_flag != &#039;F&#039;&quot;;


    if ($type == &#039;local&#039;)    { // exclude foreign codes
        $sql .=    &quot; AND !i.is_foreign&quot;;
    } elseif ($type == &#039;kits&#039;) { // sales kits
        $sql .=    &quot; AND !i.is_foreign AND i.item_code!=i.stock_id&quot;;
    }
    $sql .= &quot; AND !i.inactive AND !s.inactive AND !s.no_sale&quot;;
    $sql .= &quot; GROUP BY i.item_code&quot;;

    return combo_input($name, $selected_id, $sql, &#039;i.item_code&#039;, &#039;c.description&#039;,
        array_merge(
          array(
            &#039;format&#039; =&gt; &#039;_format_stock_items&#039;,
            &#039;spec_option&#039; =&gt; $all_option===true ?  _(&quot;All Items&quot;) : $all_option,
            &#039;spec_id&#039; =&gt; ALL_TEXT,
            &#039;search_box&#039; =&gt; true,
            &#039;search&#039; =&gt; array(&quot;i.item_code&quot;, &quot;c.description&quot;, &quot;i.description&quot;),
            &#039;search_submit&#039; =&gt; get_company_pref(&#039;no_item_list&#039;)!=0,
            &#039;size&#039;=&gt;15,
            &#039;select_submit&#039;=&gt; $submit_on_change,
            &#039;category&#039; =&gt; 2,
            &#039;order&#039; =&gt; array(&#039;c.description&#039;,&#039;i.item_code&#039;),
            &#039;editable&#039; =&gt; 30,
            &#039;max&#039; =&gt; 255
          ), $opts), $type == &#039;kits&#039; ? $type : &quot;stock_sales&quot; );
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[boxygen]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=20175</uri>
			</author>
			<updated>2018-07-11T03:03:50Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32161#p32161</id>
		</entry>
</feed>
