if ($selected_id != -1)
{
- $myrow = get_dimension($selected_id);
+ $myrow = get_dimension($selected_id, true);
- if (strlen($myrow[0]) == 0)
+ if ($myrow === false)
{
display_error(_("The dimension sent is not valid."));
display_footer_exit();
display_heading($systypes_array[ST_DIMENSION] . " # " . $id);
br(1);
-$myrow = get_dimension($id);
+$myrow = get_dimension($id, true);
-if (strlen($myrow[0]) == 0)
+if ($myrow == false)
{
echo _("The dimension number sent is not valid.");
exit;
AND wo.id=".db_escape($woid)."
GROUP BY wo.id";
- $result = db_query($sql, "The work order issues could not be retrieved");
+ $result = db_query($sql, "The work order could not be retrieved");
if (!$allow_null && db_num_rows($result) == 0)
{
- display_db_error("Could not find work order $woid", $sql);
+ display_db_error("Could not find work order ".(int)$woid, $sql);
return false;
}
{
global $wo_types_array;
- $myrow = get_work_order($woid);
+ $myrow = get_work_order($woid, true);
- if (strlen($myrow[0]) == 0)
+ if ($myrow == false)
{
display_note(_("The work order number sent is not valid."));
exit;
{
global $wo_types_array;
- $myrow = get_work_order($woid);
+ $myrow = get_work_order($woid, true);
- if (strlen($myrow[0]) == 0)
+ if ($myrow === false)
{
display_note(_("The work order number sent is not valid."));
exit;
//--------------------------------------------------------------------------------------------------
-$wo_details = get_work_order($_POST['selected_id']);
+$wo_details = get_work_order($_POST['selected_id'], true);
-if (strlen($wo_details[0]) == 0)
+if ($wo_details === false)
{
display_error(_("The order number sent is not valid."));
exit;
//--------------------------------------------------------------------------------------------------
-$wo_details = get_work_order($_POST['selected_id']);
+$wo_details = get_work_order($_POST['selected_id'], true);
-if (strlen($wo_details[0]) == 0)
+if ($wo_details === false)
{
display_error(_("The order number sent is not valid."));
exit;
$item = get_item($wo_details['stock_id']);
$r = get_default_bank_account(get_company_pref('curr_default'));
-$_POST['cr_acc'] = $r[0];
+$_POST['cr_acc'] = $r['account_code'];
$_POST['costs'] = price_format(get_post('PaymentType')==WO_OVERHEAD ? $item['overhead_cost'] : $item['labour_cost']);
amount_row(_("Additional Costs:"), 'costs');
$dec = 0;
if (isset($selected_id))
{
- $myrow = get_work_order($selected_id);
+ $myrow = get_work_order($selected_id, true);
- if (strlen($myrow[0]) == 0)
+ if ($myrow === false)
{
echo _("The order number sent is not valid.");
safe_exit();
$sql = "SELECT act_price, unit_price FROM ".TB_PREF."purch_order_details WHERE
po_detail_item = ".db_escape($po_detail_item);
$result = db_query($sql, "The old actual price of the purchase order line could not be retrieved");
- $row = db_fetch_row($result);
- $ret = $row[0];
+ $row = db_fetch($result);
+ $ret = $row['act_price'];
- $unit_price = $row[1]; //Added by Rasmus
+ $unit_price = $row['unit_price']; //Added by Rasmus
$sql = "SELECT delivery_date
FROM ".TB_PREF."grn_batch grn,"
WHERE
grn.id = line.grn_batch_id AND line.id=".db_escape($id);
$result = db_query($sql, "The old delivery date from the received record cout not be retrieved");
- $row = db_fetch_row($result);
- $date = $row[0];
+ $row = db_fetch($result);
+ $date = $row['delivery_date'];
}
else
{