Your import file does not have the data in the correct format - the third ($memo) and last but one ($person_id) fields are missing in your data file's records.
The function get_standard_cost() was available in FA 2.3, being defined in it's includes/db/inventory_db.inc and can be inserted somewhere in the module's file: modules/import_transactions/includes/import_sales_order_entry.inc as:
function get_standard_cost($stock_id)
{
$sql = "SELECT (material_cost + labour_cost + overhead_cost) AS std_cost
FROM ".TB_PREF."stock_master s WHERE stock_id=".db_escape($stock_id);
$result = db_query($sql, "The standard cost cannot be retrieved");
$myrow = db_fetch_row($result);
return $myrow[0];
}
where you can replace the function name with it in the module's file.
If you wish to use the current code base, the above function has now been superseeded (on 2016-02-23 in FA 2.4 RC1) in the same file by:
function get_unit_cost($stock_id)
{
$sql = "SELECT material_cost
FROM ".TB_PREF."stock_master
WHERE stock_id=".db_escape($stock_id);
$result = db_query($sql, "The standard cost cannot be retrieved");
$myrow = db_fetch_row($result);
return $myrow[0];
}
The unit labour cost and unit overhead cost are also used now and hence the unit cost is sought to denote the unit material cost only.
Try the attached one that follows the latter code that leverages the currently available function.
@joe: which method is recommended?