<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Fixed Assets inquiry has not connected with right GRN]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=9800&amp;type=atom" />
	<updated>2022-05-07T14:49:27Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=9800</id>
		<entry>
			<title type="html"><![CDATA[Fixed Assets inquiry has not connected with right GRN]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=41016#p41016" />
			<content type="html"><![CDATA[<p>From fixed assets inquiry page, we have a purchased column with link, thats giving wrong trans_no. </p><p><strong>get_fixed_asset_purchase</strong>&nbsp; function get invoice now, how do we link the invoice trans no in place of&nbsp; GRN&nbsp; trans no. </p><div class="codebox"><pre><code>function purchase_link($row)
{

      if ($row[&#039;purchase_date&#039;] === NULL)
        return &quot;&quot;;

      return get_supplier_trans_view_str(ST_SUPPRECEIVE, $row[&quot;purchase_no&quot;], sql2date($row[&quot;purchase_date&quot;]));
}</code></pre></div><p>Here the $row[&#039;purchase_no&#039;] has not exist.&nbsp; </p><div class="codebox"><pre><code>function purchase_link($row)
{

      if ($row[&#039;purchase_date&#039;] === NULL)
        return &quot;&quot;;
      //my suggestion would be something like this to get GRN now.
       $sql =&quot;SELECT trans_no FROM &quot;.TB_PREF.&quot;stock_moves WHERE 1=1 AND type =&quot;.ST_SUPPRECEIVE.&quot; AND stock_id =&quot;.db_escape($row[&#039;stock_id&#039;]).&quot; AND qty &gt; &#039;0&#039; &quot;;
      $res = db_query($sql, &quot;Can&#039;t get grn no&quot;);
       $row2=db_fetch($res);

     return get_supplier_trans_view_str(ST_SUPPRECEIVE, $rows[&quot;trans_no&quot;], sql2date($row[&quot;purchase_date&quot;]));
}</code></pre></div><p>@Joe, check it.&nbsp; otherwise we need to connect the invoice, instead of the GRN in purchase link.</p><p>and also i see, we can try the depreciation start with the date given from fixed assets input date. i dont know the reason why we are using every month start date.</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2022-05-07T14:49:27Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=41016#p41016</id>
		</entry>
</feed>
