X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_view.inc;h=938f0a33768292029ec17229134f21c74b218268;hb=9a98bb3bc7a94f1a8e47f8dab45a87c8b4212080;hp=14d1eb021347967e630ac58a3d2bc76466563c8e;hpb=9488b2339b9cc8faed99c6fe6f059e59bb88c544;p=fa-stable.git diff --git a/includes/ui/ui_view.inc b/includes/ui/ui_view.inc index 14d1eb02..938f0a33 100644 --- a/includes/ui/ui_view.inc +++ b/includes/ui/ui_view.inc @@ -50,11 +50,11 @@ function get_gl_view_str($type, $trans_no, $label="", $force=false, $class='', $ { $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); } //-------------------------------------------------------------------------------------- @@ -586,9 +586,9 @@ function display_quick_entries(&$cart, $id, $base, $type, $descr='') $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); @@ -597,7 +597,7 @@ function display_quick_entries(&$cart, $id, $base, $type, $descr='') display_error( _("No Quick Entry lines are defined.")); set_focus('totamount'); return 0; - } + } $totrate = 0; while ($row = db_fetch($result)) { @@ -773,16 +773,16 @@ function price_in_words($amount, $document=0) $dec = user_price_dec(); if ($dec > 0) { - $divisor = pow(10, $dec); - $frac = round2($amount - floor($amount), $dec) * $divisor; - $frac = sprintf("%0{$dec}d", $frac); + $divisor = pow(10, $dec); + $frac = round2($amount - floor($amount), $dec) * $divisor; + $frac = sprintf("%0{$dec}d", round2($frac, 0)); $and = _("and"); $frac = " $and $frac/$divisor"; } else $frac = ""; return _number_to_words(intval($amount)) . $frac; -} +} function get_js_open_window($width, $height) { @@ -1344,5 +1344,3 @@ function payment_link($name, $options) return strtr($link, $patterns); } - -?> \ No newline at end of file