diff --git a/modules/bank/view/tabbankaccount.php b/modules/bank/view/tabbankaccount.php index 239d0870..b52863d6 100755 --- a/modules/bank/view/tabbankaccount.php +++ b/modules/bank/view/tabbankaccount.php @@ -66,16 +66,32 @@ function generate_kontoliste($conf) { printf("var data = %s", json_encode($_lib['form3']->accountplan_number_menu3($conf))); echo " - color = ''; - text = 'Velg konto'; + if (selected == 0) { + color = ''; + value_found = true; + text = 'Velg konto'; + } else { + color = 'red'; + value_found = false; + text = 'Konto finnes ikke: ' + selected;; + } for(var i = 0; i < data.length; i++) { if(data[i][0] == selected) { color = data[i][1]; text = data[i][2]; + value_found = true; break; } } + // if value is not found, uncheck the auto checkbox + if (!value_found) { + auto_checkbox_id_array = name.split('.'); + auto_checkbox_id_array[1] = 'AutoResultAccount'; + auto_checkbox_id = auto_checkbox_id_array.join('.'); + auto_checkbox = document.getElementById(auto_checkbox_id); + auto_checkbox.checked = false; + } /* setter inn valgt element */ /* 0: value, 2: color, 3: text */ diff --git a/modules/journal/view/edit.php b/modules/journal/view/edit.php index e4574fe4..1fd968c9 100755 --- a/modules/journal/view/edit.php +++ b/modules/journal/view/edit.php @@ -201,7 +201,16 @@ ?> print exchange::getCurrenciesInJS(); ?> - + +$messages = $_lib['message']->get(); +if (!$voucher_input->new && $messages) { +?> +