function get_calculated_price($stock_id, $add_pct)
{
- $avg = get_standard_cost($stock_id);
+ $avg = get_unit_cost($stock_id);
if ($avg == 0)
return 0;
return round2($avg * (1 + $add_pct / 100), user_price_dec());
@$myrow["src_id"]);
}
}
- $cart->prepayments = get_payments_for($trans_no, $doc_type);
+ $cart->prepayments = get_payments_for($trans_no, $doc_type, $myrow["debtor_no"]);
} // !newdoc
// FIXME - credit notes retrieved here should be those linked to invoices containing
// at least one line from related invoice
- if (!count($trans_no))
+ if (!count_array($trans_no))
return false;
$childs = get_sales_child_numbers($trans_type, $trans_no, false);
if (!count($childs))