Javascript recalcAccount superseded by 'combo' class behaviour binding
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Thu, 27 Mar 2008 10:49:25 +0000 (10:49 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Thu, 27 Mar 2008 10:49:25 +0000 (10:49 +0000)
gl/gl_deposit.php
gl/gl_payment.php
gl/includes/ui/gl_deposit_ui.inc
gl/includes/ui/gl_journal_ui.inc
gl/includes/ui/gl_payment_ui.inc
purchasing/includes/ui/po_ui.inc
purchasing/po_entry_items.php
sales/includes/ui/sales_credit_ui.inc
sales/includes/ui/sales_order_ui.inc
sales/sales_order_entry.php

index a4b5f1734f38cf97f0234b11f83a6d7123459376..a64a5b455d8a0a5abcbf68035ca3f976e1453c8a 100644 (file)
@@ -12,13 +12,13 @@ include_once($path_to_root . "/gl/includes/ui/gl_deposit_ui.inc");
 include_once($path_to_root . "/gl/includes/gl_db.inc");
 include_once($path_to_root . "/gl/includes/gl_ui.inc");
 
-$js = get_js_form_entry("CodeID2", "code_id", "amount");
+$js = '';
 if ($use_popup_windows)
        $js .= get_js_open_window(800, 500);
 if ($use_date_picker)
        $js .= get_js_date_picker();
-$js .= get_js_set_focus('CodeID2');
-page(_("Bank Account Deposit Entry"), false, false, "setFocus()", $js);
+set_focus('CodeID2');
+page(_("Bank Account Deposit Entry"), false, false, '', $js);
 
 //-----------------------------------------------------------------------------------------------
 
index 696506820f84fc88939acc867b4fa4773f3f886a..24be2b4356e0ebc065a2a5729ae7aa504d25516b 100644 (file)
@@ -12,13 +12,13 @@ include_once($path_to_root . "/gl/includes/ui/gl_payment_ui.inc");
 include_once($path_to_root . "/gl/includes/gl_db.inc");
 include_once($path_to_root . "/gl/includes/gl_ui.inc");
 
-$js = get_js_form_entry("CodeID2", "code_id", "amount");
+$js = '';
 if ($use_popup_windows)
        $js .= get_js_open_window(800, 500);
 if ($use_date_picker)
        $js .= get_js_date_picker();
-$js .= get_js_set_focus('CodeID2');
-page(_("Bank Account Payment Entry"), false, false, "setFocus()", $js);
+set_focus('CodeID2');
+page(_("Bank Account Payment Entry"), false, false, '', $js);
 
 //-----------------------------------------------------------------------------------------------
 
index e1dece6bcaf9e8549b26ea284a2bd3678ba8add4..c84b5ad3eaeba0fdf94ddd984f9205011c839a25 100644 (file)
@@ -203,8 +203,8 @@ function gl_edit_item_controls(&$order, $dim, $Index=null)
                        $_POST['code_id'] = get_company_pref('default_assembly_act');
                else    
                        $_POST['code_id'] = get_company_pref('default_inv_sales_act');
-               text_cells(null, "CodeID2", $_POST['code_id'], 12, 10, "", "", "onkeyup='recalcAccounts();' onblur='return setAccount(0, false);'");    
-               gl_all_accounts_list_cells(null, 'code_id', $_POST['code_id'], true, false, "return setAccount(1, false)");
+               text_cells(null, "CodeID2", $_POST['code_id'], 12, 10, "", "", "class='combo' rel='code_id'");  
+               gl_all_accounts_list_cells(null, 'code_id', $_POST['code_id'], true, false, "class='combo' rel='CodeID2'");
        if ($dim >= 1)
                        dimensions_list_cells(null, 'dimension_id', null, true, " ", false, 1);
        if ($dim > 1)
index 046430caac1516f92eeb5a49fab5922beb53221d..9e3fec28674200885e55517866af42cb000f7291 100644 (file)
@@ -153,9 +153,9 @@ function gl_edit_item_controls(&$order, $dim, $Index=null)
                $_POST['CodeID2'] = "";
                $_POST['code_id'] = "";
                
-               text_cells(null, "CodeID2", "", 12, 10, "", "", "onkeyup='recalcAccounts();' onKeyDown='if(event.keyCode==13) event.keyCode=9;' onblur='return setAccount(0, false)'");
+               text_cells(null, "CodeID2", "", 12, 10, "", "", "class='combo' rel='code_id'");
                $skip_bank = ($_SESSION["wa_current_user"]->access != 2);
-               gl_all_accounts_list_cells(null, 'code_id', null, $skip_bank, false, "return setAccount(1, false)");
+               gl_all_accounts_list_cells(null, 'code_id', null, $skip_bank, false, "class='combo' rel='CodeID2'");
                if ($dim >= 1)
                        dimensions_list_cells(null, 'dimension_id', null, true, " ", false, 1);
                if ($dim > 1)
index c355b92f400ccfa41167ebf509c10338cbde0b98..486862bd30e51285d7998cbed9347130d06b8d97 100644 (file)
@@ -205,8 +205,8 @@ function gl_edit_item_controls(&$order, $dim, $Index=null)
                        $_POST['code_id'] = get_company_pref('default_assembly_act');
                else
                        $_POST['code_id'] = get_company_pref('default_cogs_act');
-               text_cells(null, "CodeID2", $_POST['code_id'], 12, 10, "", "", "onkeyup='recalcAccounts()' onblur='return setAccount(0, false)'");
-               gl_all_accounts_list_cells(null, 'code_id', $_POST['code_id'], true, false, "return setAccount(1, false)");
+               text_cells(null, "CodeID2", $_POST['code_id'], 12, 10, "", "", "class='combo' rel='code_id'");
+               gl_all_accounts_list_cells(null, 'code_id', $_POST['code_id'], true, false, "class='combo' rel='CodeID2'");
                if ($dim >= 1)
                        dimensions_list_cells(null, 'dimension_id', null, true, " ", false, 1);
                if ($dim > 1)
index 1bdac7e4291bf633a3d8e01daf1573f6351de5d6..f5a77a208367b2e0a8519fd2fbbb690a202c0583 100644 (file)
@@ -303,8 +303,8 @@ function po_item_controls(&$order, $stock_id=null)
                }
                else
                {
-                       text_cells(null, "StockID2", "", 12, 10, "", "", "onkeyup='recalcAccounts();' onKeyDown='if(event.keyCode==13) event.keyCode=9;' onblur='return setAccount(0, true);'");
-                       stock_purchasable_items_list_cells(null, 'stock_id', $_POST['stock_id'], false, false, "onchange='return setAccount(1, true)'");
+                       text_cells(null, "StockID2", "", 12, 10, "", "", "class='combo' rel='stock_id' onblur='submit()'");
+                       stock_purchasable_items_list_cells(null, 'stock_id', $_POST['stock_id'], false, false, "class='combo' rel='StockID2'");
                }
        $item_info = get_item_edit_info($_POST['stock_id']);
                $_POST['units'] = $item_info["units"];
index ea7ae862705e05db4854a95e04a389ecb88c6240..57693a3026b4571e067482d9cb4674eb73c4eb2e 100644 (file)
@@ -9,7 +9,7 @@ include_once($path_to_root . "/includes/session.inc");
 
 include_once($path_to_root . "/purchasing/includes/purchasing_ui.inc");
 
-$js = get_js_form_entry("StockID2", "stock_id", "qty");
+$js = '';
 if ($use_popup_windows)
        $js .= get_js_open_window(900, 500);
 if ($use_date_picker)
index 45ef3b4d1adefb9d20c5f0fd3ea239259715e9c0..556ff8df5146d4b81dfa98ce7a1ff5fb996118fe 100644 (file)
@@ -201,8 +201,8 @@ function credit_edit_item_controls(&$order, $rowcounter, $line_no=-1)
                }
                else
                {
-                 text_cells(null, "StockID2", "", 12, 10, "", "", "onkeyup='recalcAccounts();' onKeyDown='if (event.keyCode==13) event.keyCode=9;' onblur='return setAccount(0, true);'");
-                       stock_items_list_cells(null, 'stock_id', null, false, false, "onchange='return setAccount(1, true)'");
+               text_cells(null, "StockID2", '', 12, 10, "", "", "class='combo' rel='stock_id' onblur='submit();'");
+               stock_items_list_cells(null, 'stock_id', null, false, false, "class='combo' rel='StockID2'");
                }
                $item_info = get_item_edit_info($_POST['stock_id']);
 
index 0e069ad8b358274e2824dcfd50268bf260357f1c..428cc69aa86014ee80994f61e520d6ff3f21f732 100644 (file)
@@ -334,8 +334,8 @@ function sales_order_item_controls(&$order, &$rowcounter, $line_no=-1)
                }
                else
                {
-               text_cells(null, "StockID2", "", 12, 10, "", "", "onkeyup='recalcAccounts();' onKeyDown='if (event.keyCode==13) event.keyCode=9;' onblur='return setAccount(0, true);'");
-                       stock_items_list_cells(null, 'stock_id', null, false, false, "onchange='return setAccount(1, true)'");
+               text_cells(null, "StockID2", '', 12, 10, "", "", "class='combo' rel='stock_id' onblur='submit();'");
+               stock_items_list_cells(null, 'stock_id', null, false, false, "class='combo' rel='StockID2'");
                }
                $item_info = get_item_edit_info($_POST['stock_id']);
                $_POST['units'] = $item_info["units"];
index fe40810de3ed36539212a00b5beeceb5c8be4aed..0524212b0e352aac7c874a254bf33905fc6ff8f4 100644 (file)
@@ -17,7 +17,7 @@ include_once($path_to_root . "/sales/includes/sales_db.inc");
 include_once($path_to_root . "/sales/includes/db/sales_types_db.inc");
 include_once($path_to_root . "/reporting/includes/reporting.inc");
 
-$js = get_js_form_entry("StockID2", "stock_id", "qty");
+$js = '';
 if ($use_popup_windows) {
        $js .= get_js_open_window(900, 500);
 }