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 @@ ?> - +get(); +if (!$voucher_input->new && $messages) { +?> +
+ +
+
Kunde/Org-nummer hidden(array('name' => 'type' , 'value' => $voucher_input->type)) ?> @@ -431,7 +440,7 @@ ?> -DueDate; ?>" > +DueDate; ?>" > > matched_by == 'invoice') print 'checked' ?> > @@ -647,7 +656,7 @@ } ?> - DueDate; else print $voucher_input->DueDate; ?>" > + DueDate; else print $voucher_input->DueDate; ?>" > > matched_by == 'invoice') print 'checked' ?> > diff --git a/modules/journal/view/record.inc b/modules/journal/view/record.inc index 7126cea1..923c1ec8 100755 --- a/modules/journal/view/record.inc +++ b/modules/journal/view/record.inc @@ -1,4 +1,11 @@ format('Y-m-d') === $date; +} + $db_table = "voucher"; /*$VoucherType = $_REQUEST['VoucherType']; @@ -11,6 +18,11 @@ $voucher_input = new framework_logic_voucherinput($_REQUEST); $voucher_input->KID = trim($voucher_input->KID); $voucher_input->InvoiceID = trim($voucher_input->InvoiceID); +if ((!empty($_REQUEST['voucher_VoucherDate']) && !validDate($_REQUEST['voucher_VoucherDate']))) { + $voucher_input->VoucherDate = ''; + $_lib['message']->add("Ugyldig fakturadato " . $_REQUEST['voucher_VoucherDate'] . "!"); +} + // if the valuta(either currency_id or exchange_rate) has changed for the voucher we are saving, then we update foreign currency for the whole journal global $_lib; $result = $_lib['db']->db_query('SELECT * FROM voucher WHERE JournalID = ' . $voucher_input->JournalID . ' LIMIT 1'); diff --git a/modules/voucher/model/vouchergui.class.php b/modules/voucher/model/vouchergui.class.php index 325c8ae5..f47c102f 100755 --- a/modules/voucher/model/vouchergui.class.php +++ b/modules/voucher/model/vouchergui.class.php @@ -255,7 +255,7 @@ function update_journal_button_line($voucher, $VoucherPeriod, $JournalID, $Vouch $html .= $_lib['form3']->button(array('url' => "$MY_SELF&voucher.VoucherPeriod=$voucher->VoucherPeriod&voucher.VoucherDate=$voucher->VoucherDate&voucher.JournalID=$JournalID&voucher.VoucherID=$voucher->VoucherID&VoucherType=$VoucherType&type=$type&action_voucher_delete=1&view_mvalines=$view_mvalines&view_linedetails=$view_linedetails", 'name'=>'', 'confirm' => 'Vil du virkelig slette linjen?')); } if($button == 'update') { - $html .= ''; + $html .= ''; } } } @@ -293,7 +293,7 @@ function update_journal_button_head($voucherHead, $VoucherPeriod, $VoucherType, if($new) { if($button = 'update') { - $html .= 'VoucherDate&voucher.JournalID=$JournalID&VoucherType=$VoucherType&type=$type&action_voucher_head_delete=1", 'name'=>'', 'confirm' => 'Vil du virkelig slette bilaget?')); } if($button == 'update') { - $html .= '