X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_view.inc;h=938f0a33768292029ec17229134f21c74b218268;hb=9a98bb3bc7a94f1a8e47f8dab45a87c8b4212080;hp=00c0cd0c9d64f3ad4f20d5b80c8beb47621e342d;hpb=94cb33f6b0a043d61b7205db5e44ca986e3be524;p=fa-stable.git diff --git a/includes/ui/ui_view.inc b/includes/ui/ui_view.inc index 00c0cd0c..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)) { @@ -774,21 +774,15 @@ function price_in_words($amount, $document=0) if ($dec > 0) { $divisor = pow(10, $dec); - // algorithm rewritten due to a bug in sprintf (wrong with frac, 29, 57 and more). $frac = round2($amount - floor($amount), $dec) * $divisor; - for ($div = $divisor / 10; $div > 1; $div /= 10) - { - if ($frac < $div) - $frac = "0" . $frac; - } - //$frac = sprintf("%0{$dec}d", $frac); + $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) { @@ -1350,5 +1344,3 @@ function payment_link($name, $options) return strtr($link, $patterns); } - -?> \ No newline at end of file