From: Janusz Dobrowolski Date: Fri, 14 Mar 2008 20:24:40 +0000 (+0000) Subject: Added numeric fields in native user format. X-Git-Tag: v2.4.2~19^2~2183 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=9ad27981afdaa91591f4e71d19ac59653c524cea;p=fa-stable.git Added numeric fields in native user format. --- diff --git a/includes/ui/ui_input.inc b/includes/ui/ui_input.inc index ab33f649..aab5fd18 100644 --- a/includes/ui/ui_input.inc +++ b/includes/ui/ui_input.inc @@ -1,5 +1,12 @@ ".number_format2($label,user_percent_dec())." %", "nowrap align=right"); + label_cell("".number_format2($label,user_percent_dec())."", "nowrap align=right"); else - label_cell(number_format2($label,user_percent_dec())." %", "nowrap align=right"); + label_cell(number_format2($label,user_percent_dec()), "nowrap align=right"); } function qty_cell($label, $bold=false) @@ -324,14 +331,40 @@ function percent_row($label, $name, $init=null) $_POST[$name] = $init== null ? '' : $init; } - text_row($label, $name, $_POST[$name], 6, 6, "", "%"); + small_amount_row($label, $name, $_POST[$name], null, "%"); } +function amount_cells_ex($label, $name, $size, $max=null, $init=null, $params=null, $post_label=null) +{ + if (!isset($_POST[$name]) || $_POST[$name] == "") + { + if ($init) + $_POST[$name] = $init; + else + $_POST[$name] = ''; + } + if ($label != null) + label_cell($label, $params); + + if (!isset($max)) + $max = $size; + + echo ""; + + echo ""; + + if ($post_label) + echo " " . $post_label; + + echo "\n"; +} + + //----------------------------------------------------------------------------------- function amount_cells($label, $name, $init=null, $params=null, $post_label=null) { - text_cells_ex($label, $name, 15, 15, $init, $params, $post_label); + amount_cells_ex($label, $name, 15, 15, $init, $params, $post_label); } function amount_row($label, $name, $init=null, $params=null, $post_label=null) @@ -341,11 +374,18 @@ function amount_row($label, $name, $init=null, $params=null, $post_label=null) echo "\n"; } +function small_amount_row($label, $name, $init=null, $params=null, $post_label=null) +{ + echo ""; + small_amount_cells($label, $name, $init, $params, $post_label); + echo "\n"; +} + //----------------------------------------------------------------------------------- function small_amount_cells($label, $name, $init=null, $params=null, $post_label=null) { - text_cells_ex($label, $name, 7, 12, $init, $params, $post_label); + amount_cells_ex($label, $name, 7, 12, $init, $params, $post_label); } //-----------------------------------------------------------------------------------