<?php
-
+/**********************************************************************
+ Copyright (C) FrontAccounting, LLC.
+ Released under the terms of the GNU Affero General Public License,
+ AGPL, as published by the Free Software Foundation, either version
+ 3 of the License, or (at your option) any later version.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License here <http://www.gnu.org/licenses/agpl-3.0.html>.
+***********************************************************************/
function get_qoh_on_date($stock_id, $location=null, $date_=null, $exclude=0)
{
if ($date_ == null)
function get_item_edit_info($stock_id)
{
- $sql = "SELECT material_cost + labour_cost + overhead_cost AS standard_cost, units
- FROM ".TB_PREF."stock_master WHERE stock_id='$stock_id'";
+ $sql = "SELECT material_cost + labour_cost + overhead_cost AS standard_cost, units, decimals
+ FROM ".TB_PREF."stock_master,".TB_PREF."item_units
+ WHERE stock_id='$stock_id'
+ AND ".TB_PREF."stock_master.units=".TB_PREF."item_units.abbr";
$result = db_query($sql, "The standard cost cannot be retrieved");
return db_fetch($result);