<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Item_units_db.inc file  gives error with this functions]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=9354&amp;type=atom" />
	<updated>2021-07-06T16:15:11Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=9354</id>
		<entry>
			<title type="html"><![CDATA[Re: Item_units_db.inc file  gives error with this functions]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39671#p39671" />
			<content type="html"><![CDATA[<p>I will take a look into the new version.</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2021-07-06T16:15:11Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39671#p39671</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Item_units_db.inc file  gives error with this functions]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39661#p39661" />
			<content type="html"><![CDATA[<p>This mission is now fixed and committed to stable repo. I hope all of them are taken, but please report any remains.</p><p>/Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2021-07-06T07:25:42Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39661#p39661</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Item_units_db.inc file  gives error with this functions]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39660#p39660" />
			<content type="html"><![CDATA[<p>After talking to Janusz, we can<br />change the line:<br /></p><div class="codebox"><pre><code>return $row[0];

to

return is_array($row) ? $row[0] : false;</code></pre></div><p>This fixes the problem. But we don&#039;t have to do it all over the places. Only where there are NO aggregates as SUM, COUNT etc. These aggregates will always deliver at least one row with empty values.</p><p>I will start fixing the needed places tomorrow.</p><p>/Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2021-07-05T21:20:25Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39660#p39660</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Item_units_db.inc file  gives error with this functions]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39651#p39651" />
			<content type="html"><![CDATA[<p>ok Thanks @kvvaradha.</p><p>I will just have a short discussion with Janusz (itronics) about this mysqli issue, before trying to fix it.</p><p>I will fix the qty_cell error.</p><p>/Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2021-07-05T06:17:54Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39651#p39651</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Item_units_db.inc file  gives error with this functions]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39650#p39650" />
			<content type="html"><![CDATA[<p>@Joe both are same conditions, right?</p><p>Though i checked it again, still it passes to the next, db_fetch_row and gives error. </p><p>and also while checking this i found another issue in the sales_kit.php <br />line no 49<br /></p><div class="codebox"><pre><code>qty_cell($myrow[&quot;quantity&quot;], false,     $myrow[&quot;units&quot;] == &#039;&#039; ? 0 : get_qty_dec($myrow[&quot;comp_name&quot;]));</code></pre></div><p>and it has to pass the stock id instead of comp_name <br /></p><div class="codebox"><pre><code>qty_cell($myrow[&quot;quantity&quot;], false,     $myrow[&quot;units&quot;] == &#039;&#039; ? 0 : get_qty_dec($myrow[&quot;stock_id&quot;]));</code></pre></div>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2021-07-05T05:36:33Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39650#p39650</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Item_units_db.inc file  gives error with this functions]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39646#p39646" />
			<content type="html"><![CDATA[<p>Did you also try:<br /></p><div class="codebox"><pre><code>if ($result == false)
    return false;</code></pre></div><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2021-07-04T16:38:34Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39646#p39646</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Item_units_db.inc file  gives error with this functions]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39645#p39645" />
			<content type="html"><![CDATA[<p>I tried this @joe, but the if condition didn&#039;t work. <br />though it goes to the next line and gives error. <br /></p><div class="codebox"><pre><code>Trying to access array offset on value of type bool in </code></pre></div>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2021-07-04T16:30:58Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39645#p39645</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Item_units_db.inc file  gives error with this functions]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39627#p39627" />
			<content type="html"><![CDATA[<p>@kvvaradha</p><p>Couldn&#039;t we just put these two lines after the query result:<br /></p><div class="codebox"><pre><code>if (!$result)
    return false;</code></pre></div><p>Because if there is a $result then db_fetch will always return at least one array.</p><p>/Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2021-07-03T21:09:01Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39627#p39627</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Item_units_db.inc file  gives error with this functions]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39625#p39625" />
			<content type="html"><![CDATA[<p>Ok I will have a look at this.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2021-07-03T18:06:41Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39625#p39625</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Item_units_db.inc file  gives error with this functions]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39624#p39624" />
			<content type="html"><![CDATA[<p>All these <br /></p><div class="codebox"><pre><code>        return $row[0];</code></pre></div><p>should be changed to </p><div class="codebox"><pre><code>if(db_num_rows($result) &gt; 0){
        $row = db_fetch_row($result);
        return $row[0];
    } else 
        return false;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2021-07-03T17:09:00Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39624#p39624</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Item_units_db.inc file  gives error with this functions]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39623#p39623" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>kvvaradha wrote:</cite><blockquote><p>Sure @joe, I will list them and get you the list of&nbsp; changes.</p></blockquote></div><p>Here is the total list of changes @joe. it comes with more files, i put a search list here.</p><div class="codebox"><pre><code>/var/www/FA/2410/admin/db/security_db.inc:
   65:     return $row[0];

/var/www/FA/2410/admin/db/tags_db.inc:
   68:     return $row[0];
  108:     return $row[0];

/var/www/FA/2410/dimensions/includes/dimensions_db.inc:
  185:     return $row[0];

/var/www/FA/2410/fixed_assets/includes/fa_classes_db.inc:
   30:     return $row[0];

/var/www/FA/2410/gl/includes/db/gl_db_account_types.inc:
  101:     return $row[0];
  158:     return $row[0];

/var/www/FA/2410/gl/includes/db/gl_db_accounts.inc:
   88:         return $row[0];

/var/www/FA/2410/gl/includes/db/gl_db_bank_trans.inc:
  137:     return $row[0];

/var/www/FA/2410/gl/includes/db/gl_db_banking.inc:
  138:     return $row[0];

/var/www/FA/2410/gl/includes/db/gl_db_rates.inc:
   35:         return $row[0];

/var/www/FA/2410/gl/includes/db/gl_db_trans.inc:
  368:     return $row[0];
  426:     return $row[0];

/var/www/FA/2410/includes/dashboard.inc:
  851:     return $row[0];
  909:     return $row[0];
 1197:     return $row[0];
 1205:     return $row[0];
 1213:     return $row[0];
 1227:     return $row[0];
 1235:     return $row[0];
 1244:     return $row[0];
 1252:     return $row[0];
 1262:     return $row[0];
 1270:     return $row[0];
 1278:     return $row[0];
 1287:     return $row[0];
 1315:     return $row[0];
 1326:     return $row[0];
 1334:     return $row[0];
 1342:     return $row[0];
 1350:     return $row[0];
 1359:     return $row[0];
 1368:     return $row[0];
 1376:     return $row[0];
 1384:     return $row[0];
 1392:     return $row[0];
 1400:     return $row[0];
 1436:         return $row[0];
 1451:         return $row[0];
 1460:     return $row[0];

/var/www/FA/2410/includes/db/connect_db.inc:
   24:     return $row[0];

/var/www/FA/2410/includes/db/crm_contacts_db.inc:
  245:     return $row[0];

/var/www/FA/2410/includes/db/inventory_db.inc:
  170:     return $row[0];
  348:     return $row[0];
  497:         return $row[0];

/var/www/FA/2410/includes/db_pager.inc:
  352:             $this-&gt;rec_count = $row[0];

/var/www/FA/2410/inventory/includes/db/items_category_db.inc:
  101:     return $row[0];

/var/www/FA/2410/inventory/includes/db/items_units_db.inc:
   51:     return $row[0];
   75:     return $row[0];

/var/www/FA/2410/purchasing/includes/db/grn_db.inc:
  208:     return $row[0];

/var/www/FA/2410/purchasing/includes/db/suppliers_db.inc:
  147:     return $row[0];

/var/www/FA/2410/reporting/rep103.php:
  100:     return $row[0];

/var/www/FA/2410/reporting/rep205.php:
   56:     return $row[0];

/var/www/FA/2410/reporting/rep306.php:
   89:         return $row[0];

/var/www/FA/2410/reporting/rep310.php:
   90:         return $row[0];

/var/www/FA/2410/reporting/rep451.php:
   36:     return $row[0];

/var/www/FA/2410/reporting/rep601.php:
   39:     return $row[0];

/var/www/FA/2410/reporting/rep602.php:
   40:     return $row[0];

/var/www/FA/2410/sales/includes/db/cust_trans_db.inc:
  247:     return $row[0];

/var/www/FA/2410/sales/includes/db/customers_db.inc:
  135:     return $row[0];

/var/www/FA/2410/sales/includes/db/recurrent_invoices_db.inc:
   88:     return !$row[0];

/var/www/FA/2410/sales/includes/db/sales_delivery_db.inc:
  214:       else $freight = $row[0];

/var/www/FA/2410/sales/includes/db/sales_groups_db.inc:
   52:     return $row[0];
   95:     return $row[0];
  154:     return $row[0];

/var/www/FA/2410/sales/includes/db/sales_invoice_db.inc:
  294:     return $row[0];

/var/www/FA/2410/sales/includes/db/sales_order_db.inc:
  647:         return $row == false ? false : $row[0];

/var/www/FA/2410/sales/includes/db/sales_points_db.inc:
   64:     return $row[0];

/var/www/FA/2410/sales/includes/db/sales_types_db.inc:
   53:     return $row[0];

/var/www/FA/2410/sql/alter2.2.php:
   90:         $max_order = $row[0];

/var/www/FA/2410/taxes/db/tax_types_db.inc:
   76:     return $row[0];</code></pre></div>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2021-07-03T17:06:49Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39623#p39623</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Item_units_db.inc file  gives error with this functions]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39602#p39602" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>kvvaradha wrote:</cite><blockquote><p>For straight line method, you need to use the purchase cost. so the purchase cost may be 15000 USD, this is a chance.</p><p>and probably you need to trace it with calculation from the compute_gl_rows_for_depreciation with some display errors placed in between locations i cant understand full concept of straight line method here programmed. it looks they are getting remaining months and process with new one. so in the each line place some display errors to make it readable for you.</p></blockquote></div><p>I am not very good at Ajax, how do I replace the calculation of % to get the exact percent value of and asset after depreciation.</p><p>e.g: if I purchased my asset with 5000 USD, with 5% depreciation rate, I am expecting to get 250 usd depreciation after 1 year. and my book value will be 4750 USD.</p><p>THanks</p>]]></content>
			<author>
				<name><![CDATA[cedricktshiyoyo]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=45118</uri>
			</author>
			<updated>2021-06-28T10:17:37Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39602#p39602</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Item_units_db.inc file  gives error with this functions]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39598#p39598" />
			<content type="html"><![CDATA[<p>For straight line method, you need to use the purchase cost. so the purchase cost may be 15000 USD, this is a chance.</p><p>and probably you need to trace it with calculation from the compute_gl_rows_for_depreciation with some display errors placed in between locations i cant understand full concept of straight line method here programmed. it looks they are getting remaining months and process with new one. so in the each line place some display errors to make it readable for you.</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2021-06-28T02:41:50Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39598#p39598</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Item_units_db.inc file  gives error with this functions]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39596#p39596" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>kvvaradha wrote:</cite><blockquote><p>Hello dude, May be it will be in the calculation issue, you need to describe, what comes and what you exactly need it with this code. describe that. We needs to understand it.</p></blockquote></div><p>Hello, just forget about my code I was trying to use the fixed asset module, to register my assets, but when I process depreciation, the value is not correct according to the depreciation rate, </p><p>for example: when you register an asset with purchase value of 30,000 USD, with Straight Line depreciation rate of 5%. for the first year I am supposed to get 1500 USD and my book value should be 28,500 USD, <br />So instead i am getting depreciation value of 650 USD which is 2.2%,... WHERE DO YOU FIX THIS IN THE CODE for it to get the exact 5%</p>]]></content>
			<author>
				<name><![CDATA[cedricktshiyoyo]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=45118</uri>
			</author>
			<updated>2021-06-27T19:41:42Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39596#p39596</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Item_units_db.inc file  gives error with this functions]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39594#p39594" />
			<content type="html"><![CDATA[<p>Hello dude, May be it will be in the calculation issue, you need to describe, what comes and what you exactly need it with this code. describe that. We needs to understand it.</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2021-06-27T12:02:59Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39594#p39594</id>
		</entry>
</feed>
