X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_view.inc;h=3af7ed4a7ca8eb5583e39e8bae004b2fb04c3024;hb=35859a9eeec414240fe0bb94af128ab84ee4e278;hp=389ea5302d389acb3a17b12996edd409656ade79;hpb=fc449c48a8d4ba23bfb18318dff08746340a440c;p=fa-stable.git diff --git a/includes/ui/ui_view.inc b/includes/ui/ui_view.inc index 389ea530..3af7ed4a 100644 --- a/includes/ui/ui_view.inc +++ b/includes/ui/ui_view.inc @@ -278,7 +278,7 @@ function exchange_rate_display($from_currency, $to_currency, $date_, $force_edit if ($from_currency != $to_currency) { - $rate = get_post('_ex_rate'); + $rate = input_num('_ex_rate'); if (check_ui_refresh() || !$rate) { // readonly or ui context changed $comp_currency = get_company_currency(); if ($from_currency == $comp_currency) @@ -560,8 +560,8 @@ function display_allocations($alloc_result, $total, $title, $show_summary=true) if ($alloc_row['type'] == ST_SUPPAYMENT || $alloc_row['type'] == ST_BANKPAYMENT || $alloc_row['type'] == ST_SUPPCREDIT) $alloc_row['Total'] = -$alloc_row['Total']; amount_cell($alloc_row['Total']); - amount_cell($alloc_row['Total'] - $alloc_row['amt']); amount_cell($alloc_row['amt']); + amount_cell($alloc_row['Total'] - $alloc_row['amt']); end_row(); $total_allocated += $alloc_row['amt']; @@ -832,7 +832,7 @@ function _number_to_words($number) "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"); - $tens = array("", "", "Twenty", "Thirty", "Fourty", "Fifty", "Sixty", + $tens = array("", "", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"); if ($Dn || $n) @@ -908,13 +908,23 @@ function get_js_lookup_window() { function get_js_select_combo_item() { $js = "function selectComboItem(doc, client_id, value){ var element = doc.getElementById(client_id); - var options = element.options; - for (var i = 0, optionsLength = options.length; i < optionsLength; i++) { - if (options[i].value == value) { - element.selectedIndex = i; - element.onchange(); + if (typeof(element) != 'undefined' && element != null && element.tagName === 'SELECT' ){ + var options = element.options; + for (var i = 0, optionsLength = options.length; i < optionsLength; i++) { + if (options[i].value == value) { + element.selectedIndex = i; + element.onchange(); + } } - } + } else { + var stock_element = doc.getElementsByName('stock_id'); + if( stock_element.length > 0) { + stock_element.value = value; + var stock_id = doc.getElementById('_stock_id_edit'); + stock_id.value=value; + stock_id.onblur(); + } + } window.close(); }"; return $js; @@ -923,14 +933,24 @@ function get_js_select_combo_item() { function get_js_set_combo_item() { $js = "function setComboItem(doc, client_id, value, text){ var element = doc.getElementById(client_id); - var options = element.options; - options.length = 0; - var option = doc.createElement('option'); - option.value = value; - option.text = text; - element.add(option, 0); - element.selectedIndex = 0; - element.onchange(); + if(typeof(element) != 'undefined' && element != null && element.tagName === 'SELECT') { + var options = element.options; + options.length = 0; + var option = doc.createElement('option'); + option.value = value; + option.text = text; + element.add(option, 0); + element.selectedIndex = 0; + element.onchange(); + } else { + var stock_element = doc.getElementsByName('stock_id'); + if( stock_element.length > 0) { + stock_element[0].value = value; + var stock_id = doc.getElementById('_stock_id_edit'); + stock_id.value=value; + stock_id.onblur(); + } + } window.close(); }"; return $js;