{
$label = _("GL");
$icon = ICON_GL;
- }
+ }
+ $url = ($type == ST_WORKORDER && !work_order_is_closed($trans_no)) ? "manufacturing/view/wo_costs_view.php?trans_no=$trans_no"
+ : "gl/view/gl_trans_view.php?type_id=$type&trans_no=$trans_no";
- return viewer_link($label,
- "gl/view/gl_trans_view.php?type_id=$type&trans_no=$trans_no",
- $class, $id, $icon);
+ return viewer_link($label, $url, $class, $id, $icon);
}
//--------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------
-function display_allocations($alloc_result, $total, $payments=false)
+function display_allocations($alloc_result, $total, $title, $show_summary=true)
{
global $systypes_array;
if (!$alloc_result || db_num_rows($alloc_result) == 0)
return;
- display_heading2(($payments ? _("Payments") : _("Allocations")));
+ display_heading2($title);
start_table(TABLESTYLE, "width=80%");
while ($alloc_row = db_fetch($alloc_result))
{
-
alt_table_row_color($k);
label_cell($systypes_array[$alloc_row['type']]);
label_cell(_("Total Allocated:"), "align=right colspan=5");
amount_cell($total_allocated);
end_row();
- start_row();
- label_cell(_("Left to Allocate:"), "align=right colspan=5");
- $total = round2($total, user_price_dec());
- amount_cell($total - $total_allocated);
- end_row();
-
+ if ($show_summary)
+ {
+ start_row();
+ label_cell(_("Left to Allocate:"), "align=right colspan=5");
+ $total = round2($total, user_price_dec());
+ amount_cell($total - $total_allocated);
+ end_row();
+ }
end_table(1);
}
{
case PT_CUSTOMER :
$alloc_result = get_allocatable_to_cust_transactions($person_id, $type_no, $type);
- display_allocations($alloc_result, $total);
+ display_allocations($alloc_result, $total, _("Allocations"));
return;
case PT_SUPPLIER :
$alloc_result = get_allocatable_to_supp_transactions($person_id, $type_no, $type);
- display_allocations($alloc_result, $total);
+ display_allocations($alloc_result, $total, _("Allocations"));
return;
}
}
{
case PT_CUSTOMER :
$alloc_result = get_allocatable_from_cust_transactions($person_id, $type_no, $type);
- display_allocations($alloc_result, $total, true);
+ display_allocations($alloc_result, $total, $type == ST_SALESORDER ? _("Pre-Payments") : _("Payments"), false);
return;
case PT_SUPPLIER :
$alloc_result = get_allocatable_from_supp_transactions($person_id, $type_no, $type);
- display_allocations($alloc_result, $total, true);
+ display_allocations($alloc_result, $total, $type == ST_PURCHORDER ? _("Pre-Payments") : _("Payments"), false);
return;
}
}
$begin = "";
else
$begin = begin_fiscalyear(); // from fiscalyear begin
- }
+ }
$base = get_gl_trans_from_to($begin, $cart->tran_date, $qe['base_desc']);
-
+
}
if ($descr != '') $qe['description'] .= ': '.$descr;
$result = get_quick_entry_lines($id);
display_error( _("No Quick Entry lines are defined."));
set_focus('totamount');
return 0;
- }
+ }
$totrate = 0;
while ($row = db_fetch($result))
{
case "t+": // ditto & increase base amount
case "t-": // ditto & reduce base amount
if (substr($row['action'],0,1) != 'T')
- $totrate += get_tax_type_default_rate($row['dest_id']);
+ $totrate += get_tax_type_rate($row['dest_id']);
}
}
$first = true;
else
$frac = "";
return _number_to_words(intval($amount)) . $frac;
-}
+}
function get_js_open_window($width, $height)
{
return strtr($link, $patterns);
}
-
-?>
\ No newline at end of file