Przeglądaj źródła

Convert some table calls to table_*

mingodad 9 lat temu
rodzic
commit
f917f0cd58

+ 1 - 1
SquiLu-ourbiz/EvaLayoutManager.nut

@@ -496,7 +496,7 @@ class EvaLayoutManager
 	
 	
 	function indxComponent (compName)
 	function indxComponent (compName)
 	{
 	{
-		return componentArrayIdx.rawget(compName, -1);
+		return table_rawget(componentArrayIdx, compName, -1);
 	};
 	};
 }
 }
 
 

+ 2 - 2
SquiLu-ourbiz/companies-uk.nut

@@ -38,7 +38,7 @@ local function getCompaniesUkDB(){
 
 
 local __stmtCache = {};
 local __stmtCache = {};
 local function getCachedStmt(stmt_key, sql_or_func){
 local function getCachedStmt(stmt_key, sql_or_func){
-	local stmt = __stmtCache.get(stmt_key, false);
+	local stmt = table_get(__stmtCache, stmt_key, false);
 	if (!stmt){
 	if (!stmt){
 		//local db =checkCompaniesUkDB()
 		//local db =checkCompaniesUkDB()
 		local sql;
 		local sql;
@@ -617,7 +617,7 @@ local my_uri_handlers = {
 			"search_around_post_code", "search_sic_code", "sic_street", "page"];
 			"search_around_post_code", "search_sic_code", "sic_street", "page"];
 		if (isPost) {
 		if (isPost) {
 			local post_fields =  get_post_fields(request);
 			local post_fields =  get_post_fields(request);
-			foreach(k in filed_names) data[k] <- post_fields.get(k, null);
+			foreach(k in filed_names) data[k] <- table_get(post_fields, k, null);
 		}
 		}
 		else if (query_string) {
 		else if (query_string) {
 			foreach(k in filed_names) data[k] <-request.get_var(query_string, k);
 			foreach(k in filed_names) data[k] <-request.get_var(query_string, k);

+ 1 - 1
SquiLu-ourbiz/db-updater.nut

@@ -6,7 +6,7 @@
  
  
 local globals = getroottable();
 local globals = getroottable();
 
 
-if(!globals.rawget("HTTPConn", false)) dofile("ourbiz-client.nut");
+if(!table_rawget(globals, "HTTPConn", false)) dofile("ourbiz-client.nut");
 
 
 enum edbAction {e_none, e_insert, e_update, e_delete};
 enum edbAction {e_none, e_insert, e_update, e_delete};
 
 

+ 6 - 6
SquiLu-ourbiz/fluid2SquiLu.nut

@@ -158,7 +158,7 @@ function ParseItem(pos, parent){
 	rc = GetItem(pos, "string", item);
 	rc = GetItem(pos, "string", item);
 	key = rc[0]; pos = rc[1]; 
 	key = rc[0]; pos = rc[1]; 
 	item.key <- key;
 	item.key <- key;
-	local modes = Grammar.get(key, false);
+	local modes = table_get(Grammar, key, false);
 	if (!modes && key.match("Fl_")) modes = Grammar.Fl_;
 	if (!modes && key.match("Fl_")) modes = Grammar.Fl_;
 	assert(modes);
 	assert(modes);
 	foreach(mode in modes){
 	foreach(mode in modes){
@@ -188,7 +188,7 @@ function ParseAttributes(pos, endpos){
 	while (pos < endpos){
 	while (pos < endpos){
 		rc = GetItem(pos, "string");
 		rc = GetItem(pos, "string");
 		key = rc[0]; pos = rc[1]; 
 		key = rc[0]; pos = rc[1]; 
-		local type = Grammar.attr.get(key, false);
+		local type = table_get(Grammar.attr, key, false);
 		if (type){
 		if (type){
 			rc = GetItem(pos, type);
 			rc = GetItem(pos, type);
 			item = rc[0]; pos = rc[1]; 
 			item = rc[0]; pos = rc[1]; 
@@ -245,10 +245,10 @@ Write.Atributes <- function(t, ind, name){
 	//if (klass.match("Fl_Button") t.attr.when = 12;
 	//if (klass.match("Fl_Button") t.attr.when = 12;
 	
 	
 	foreach( k,v in t.attr) {
 	foreach( k,v in t.attr) {
-		if (Grammar.methods.get(k, false) && v){
+		if (table_get(Grammar.methods, k, false) && v){
 			Output(ind, "%s.%s(", lname, k);
 			Output(ind, "%s.%s(", lname, k);
 			if (type(v) == "integer") Output(0, "%d", v);
 			if (type(v) == "integer") Output(0, "%d", v);
-			else if (Grammar.konst.get(v, false)) Output(0, "%d", Grammar.konst[v]);
+			else if (table_get(Grammar.konst, v, false)) Output(0, "%d", Grammar.konst[v]);
 			else if (v.match("^[A-Z_]+$") ) Output(0, "FL_%s", v);
 			else if (v.match("^[A-Z_]+$") ) Output(0, "FL_%s", v);
 			else Output(0, "%s(%q)", configuration.textfilter, v);
 			else Output(0, "%s(%q)", configuration.textfilter, v);
 			Output(0, ");\n");
 			Output(0, ");\n");
@@ -257,8 +257,8 @@ Write.Atributes <- function(t, ind, name){
 }
 }
 
 
 Write.widget <- function(t, ind){
 Write.widget <- function(t, ind){
-	local fgroup = Grammar.groups.get(t.key, false);
-	if (Grammar.composed.get(t.key, false) && t.attr.rawget("type", false)){
+	local fgroup = table_get(Grammar.groups, t.key, false);
+	if (table_get(Grammar.composed, t.key, false) && t.attr.rawget("type", false)){
 		t.key = t.key.slice(0,3) + t.attr.type + t.key.slice(2);
 		t.key = t.key.slice(0,3) + t.attr.type + t.key.slice(2);
 		t.attr.type = null;
 		t.attr.type = null;
 	}
 	}

+ 1 - 1
SquiLu-ourbiz/happyhttp.nut

@@ -330,7 +330,7 @@ class HappyHttpResponse {
 	// retrieve a header (returns null if not present)
 	// retrieve a header (returns null if not present)
 	function getheader( name ){
 	function getheader( name ){
 		local lname = name.tolower();
 		local lname = name.tolower();
-		return m_Headers.get(lname, null);
+		return table_get(m_Headers, lname, null);
 	}
 	}
 	
 	
 	function completed() { return m_State == Response_state.COMPLETE; }
 	function completed() { return m_State == Response_state.COMPLETE; }

+ 7 - 7
SquiLu-ourbiz/ourbiz-client.nut

@@ -168,7 +168,7 @@ class HTTPConnAuthBase extends HTTPConnBase
                 if(body && bodysize) send( body, bodysize );
                 if(body && bodysize) send( body, bodysize );
                 while( outstanding() )
                 while( outstanding() )
                 {
                 {
-                    if(globals.rawget("Fl", false)) Fl.check();//check_idle();
+                    if(table_rawget(globals, "Fl", false)) Fl.check();//check_idle();
                     pump();
                     pump();
 		    //os.sleep(10);
 		    //os.sleep(10);
                 }
                 }
@@ -243,7 +243,7 @@ class HTTPConnBin extends HTTPConnAuthBase
 
 
 enum conn_type_e {e_conn_none, e_conn_http, e_conn_dbfile};
 enum conn_type_e {e_conn_none, e_conn_http, e_conn_dbfile};
 
 
-constants.rawdelete("TimePeriode");
+table_rawdelete(constants, "TimePeriode");
 enum TimePeriode {is_years = 1, is_months = 2, is_weeks = 3, is_days = 4};
 enum TimePeriode {is_years = 1, is_months = 2, is_weeks = 3, is_days = 4};
 
 
 function getStatisticsPeriodeType(speriode){
 function getStatisticsPeriodeType(speriode){
@@ -372,7 +372,7 @@ class AppServer
 
 
     function get_binary_data_from_url(get_url, rec, content_type, throwNotFound=true)
     function get_binary_data_from_url(get_url, rec, content_type, throwNotFound=true)
     {
     {
-        rec.clear();
+        table_clear(rec);
 
 
         if(get_conn_type() == conn_type_e.e_conn_http)
         if(get_conn_type() == conn_type_e.e_conn_http)
         {
         {
@@ -391,7 +391,7 @@ class AppServer
 
 
     function get_binary_data(rec, binary_type, table, aid, extra_url=0, throwNotFound=true)
     function get_binary_data(rec, binary_type, table, aid, extra_url=0, throwNotFound=true)
     {
     {
-        rec.clear();
+        table_clear(rec);
         if(get_conn_type() == conn_type_e.e_conn_http)
         if(get_conn_type() == conn_type_e.e_conn_http)
         {
         {
             local url = format("/DB/GetBin?%s=%d", table, aid);
             local url = format("/DB/GetBin?%s=%d", table, aid);
@@ -516,7 +516,7 @@ class AppServer
             {
             {
                 throw(my_result.tostring());
                 throw(my_result.tostring());
             }
             }
-            rec.clear();
+            table_clear(rec);
             //parse_jsonObject2map(rec, my_result.c_str());
             //parse_jsonObject2map(rec, my_result.c_str());
             sle2map(my_result, rec);
             sle2map(my_result, rec);
         }
         }
@@ -547,7 +547,7 @@ class AppServer
 
 
     function get_record(rec, table, qs, aid, extra_url=0)
     function get_record(rec, table, qs, aid, extra_url=0)
     {
     {
-        rec.clear();
+        table_clear(rec);
         //parse_jsonObject2map(rec, get_str_record(table, qs, aid, extra_url).c_str());
         //parse_jsonObject2map(rec, get_str_record(table, qs, aid, extra_url).c_str());
         local str_sls = get_str_record(table, qs, aid, extra_url);
         local str_sls = get_str_record(table, qs, aid, extra_url);
         sle2map(str_sls, rec);
         sle2map(str_sls, rec);
@@ -555,7 +555,7 @@ class AppServer
 
 
     function get_record_and_array(rec, data, table, qs, aid, extra_url=0)
     function get_record_and_array(rec, data, table, qs, aid, extra_url=0)
     {
     {
-        rec.clear();
+        table_clear(rec);
         data.clear();
         data.clear();
         local jres = get_str_record(table, qs, aid, extra_url);
         local jres = get_str_record(table, qs, aid, extra_url);
         //parse_jsonRecordAndArray(rec, data, jres.c_str());
         //parse_jsonRecordAndArray(rec, data, jres.c_str());

+ 17 - 14
SquiLu-ourbiz/ourbiz-fltk.nut

@@ -2,12 +2,13 @@
  * Copyright (C) 2013 by Domingo Alvarez Duarte <[email protected]>
  * Copyright (C) 2013 by Domingo Alvarez Duarte <[email protected]>
  *
  *
  * Licensed under GPLv3, see http://www.gnu.org/licenses/gpl.html.
  * Licensed under GPLv3, see http://www.gnu.org/licenses/gpl.html.
- */
+*/
 
 
 /*
 /*
 Check if we are on windows os.
 Check if we are on windows os.
 */
 */
-local WIN32 = os.getenv("WINDIR") != null
+
+local WIN32 = os.getenv("WINDIR") != null;
 socket.open();
 socket.open();
 
 
 local app_cmd_parameters = {}
 local app_cmd_parameters = {}
@@ -26,10 +27,12 @@ Command line parameters.
 -user	user to authenticate
 -user	user to authenticate
 -password	password to authenticate
 -password	password to authenticate
 */
 */
-local appServer_host = app_cmd_parameters.get("-host", "localhost");
-local appServer_port = app_cmd_parameters.get("-port", 8855).tointeger() ;
-local appServer_user = app_cmd_parameters.get("-user", "mingote");
-local appServer_password = app_cmd_parameters.get("-password", "tr14pink");
+local appServer_host = table_get(app_cmd_parameters, "-host", "localhost");
+local appServer_port = table_get(app_cmd_parameters, "-port", 8855).tointeger() ;
+//local appServer_host = table_get(app_cmd_parameters, "-host", "ourbiz.dadbiz.es");
+//local appServer_port = table_get(app_cmd_parameters, "-port", 80).tointeger() ;
+local appServer_user = table_get(app_cmd_parameters, "-user", "mingote");
+local appServer_password = table_get(app_cmd_parameters, "-password", "tr14pink");
 
 
 dofile("ourbiz-client.nut");
 dofile("ourbiz-client.nut");
 dofile("db-updater.nut");
 dofile("db-updater.nut");
@@ -395,7 +398,7 @@ class Base_Window extends Fl_Window {
 	}
 	}
 
 
 	function add_input_field_to_map(tbl, fldname, fld){
 	function add_input_field_to_map(tbl, fldname, fld){
-		local tbl_map = _db_map.get(tbl, false);
+		local tbl_map = table_get(_db_map, tbl, false);
 		if(!tbl_map){
 		if(!tbl_map){
 			tbl_map = {};
 			tbl_map = {};
 			_db_map[tbl] <- tbl_map;
 			_db_map[tbl] <- tbl_map;
@@ -403,7 +406,7 @@ class Base_Window extends Fl_Window {
 		tbl_map[fldname] <- fld.weakref();
 		tbl_map[fldname] <- fld.weakref();
 	}
 	}
 
 
-	function get_input_fields(dbname){ return _db_map.get(dbname, null);}
+	function get_input_fields(dbname){ return table_get(_db_map, dbname, null);}
 
 
 	function setup_grid(grid, pcall_this){
 	function setup_grid(grid, pcall_this){
 		grid->callback_when(FLVEcb_ROW_CHANGED | FLVEcb_CLICKED | FLVEcb_ROW_HEADER_CLICKED);
 		grid->callback_when(FLVEcb_ROW_CHANGED | FLVEcb_CLICKED | FLVEcb_ROW_HEADER_CLICKED);
@@ -413,7 +416,7 @@ class Base_Window extends Fl_Window {
 	function grid_cb(sender : Fl_Widget, udata : any){}
 	function grid_cb(sender : Fl_Widget, udata : any){}
 
 
 	function getChildWindow(winName, WindowClass){
 	function getChildWindow(winName, WindowClass){
-		local win = _child_windows.get(winName, false);
+		local win = table_get(_child_windows, winName, false);
 		if(!win){
 		if(!win){
 			win = new WindowClass();
 			win = new WindowClass();
 			//win.label(winName);
 			//win.label(winName);
@@ -573,11 +576,11 @@ class Widget_Fill_By_Map {
 	}
 	}
 
 
 	function getValue(fld_name){
 	function getValue(fld_name){
-		return _map.get(fld_name, "");
+		return table_get(_map, fld_name, "");
 	}
 	}
 
 
 	function getValueInteger(fld_name){
 	function getValueInteger(fld_name){
-		local value = _map.get(fld_name, "");
+		local value = table_get(_map, fld_name, "");
 		return value.len() ? value.tointeger() : 0;
 		return value.len() ? value.tointeger() : 0;
 	}
 	}
 
 
@@ -776,7 +779,7 @@ class Edit_Base_Window extends Base_Window {
 		fill_edit_form(dbUpdater()->edit_id == 0);
 		fill_edit_form(dbUpdater()->edit_id == 0);
 	}
 	}
 	function fill_edit_form(asBlank=false){
 	function fill_edit_form(asBlank=false){
-		if(asBlank) _record.clear();
+		if(asBlank) table_clear(_record);
 		local  wfq = Widget_Fill_By_Map(_record);
 		local  wfq = Widget_Fill_By_Map(_record);
 		local input_fld_map = get_input_fields(dbUpdater()->get_fields_map_name());
 		local input_fld_map = get_input_fields(dbUpdater()->get_fields_map_name());
 		wfq.set_widget_value_by_map(input_fld_map);
 		wfq.set_widget_value_by_map(input_fld_map);
@@ -2439,7 +2442,7 @@ class MyEditProductWindow extends EditProductWindow {
 	{
 	{
 		base.do_edit_delayed(udata);
 		base.do_edit_delayed(udata);
 		delayed_focus(db_products_sell_description);
 		delayed_focus(db_products_sell_description);
-		local image_id = _record.get("image_id", false);
+		local image_id = table_get(_record, "image_id", false);
 		if(image_id && image_id.len()) button_show_db_image(btnImage, image_id.tointeger(), null, false, false);
 		if(image_id && image_id.len()) button_show_db_image(btnImage, image_id.tointeger(), null, false, false);
 		else {
 		else {
 			btnImage->hide();
 			btnImage->hide();
@@ -2815,7 +2818,7 @@ class MyEditOrderWindow extends EditOrderWindow {
 	function do_edit_by_grid(line_id : integer, sender : Fl_Widget){
 	function do_edit_by_grid(line_id : integer, sender : Fl_Widget){
 		//print(pid, sender);
 		//print(pid, sender);
 		if(line_id) 	appServer.get_record(_line_record, "orders", 0, line_id, "&line_calculated=1");
 		if(line_id) 	appServer.get_record(_line_record, "orders", 0, line_id, "&line_calculated=1");
-		else _line_record.clear();
+		else table_clear(_line_record);
 		fill_edit_lines_form(line_id == 0, line_id != 0, false);
 		fill_edit_lines_form(line_id == 0, line_id != 0, false);
 		_line_edit_id = line_id;
 		_line_edit_id = line_id;
 		if(_line_record == 0) {
 		if(_line_record == 0) {

+ 2 - 6
SquiLu-ourbiz/ourbiz-gui.nut

@@ -580,7 +580,6 @@ class BarChartGroup extends Fl_Group {
       o.labeltype(FL_NO_LABEL);
       o.labeltype(FL_NO_LABEL);
       o.labelsize(16);
       o.labelsize(16);
       o.color(7);
       o.color(7);
-      #include "Fl_Bar_Chart.h"
       Fl_Group.current().resizable(o);
       Fl_Group.current().resizable(o);
     }
     }
     end();
     end();
@@ -4688,8 +4687,8 @@ class EditProductWindow extends Edit_Base_Window {
               o.value(1);
               o.value(1);
               o.down_box(FL_DOWN_BOX);
               o.down_box(FL_DOWN_BOX);
               o.callback(function(sender, udata){
               o.callback(function(sender, udata){
-                db_products_sell_notes->wrap_mode(o->value(), 0);
-                db_products_buy_notes->wrap_mode(o->value(), 0);
+                db_products_sell_notes->wrap_mode(o->value(), 0);
+                db_products_buy_notes->wrap_mode(o->value(), 0);
                 db_products_tags->wrap_mode(o->value(), 0);
                 db_products_tags->wrap_mode(o->value(), 0);
               });
               });
             }
             }
@@ -5897,7 +5896,6 @@ class EditOrderWindow extends Edit_Base_Window {
               o.textsize(16);
               o.textsize(16);
               o.align(5);
               o.align(5);
               o.labelsize(16);
               o.labelsize(16);
-              #include <FL/Fl_Text_Editor.H>
               add_input_field_to_map("orders", "notes", db_orders_notes);
               add_input_field_to_map("orders", "notes", db_orders_notes);
               Fl_Group.current().resizable(o);
               Fl_Group.current().resizable(o);
             }
             }
@@ -5988,7 +5986,6 @@ class EditOrderWindow extends Edit_Base_Window {
               o.textsize(16);
               o.textsize(16);
               o.align(5);
               o.align(5);
               o.labelsize(16);
               o.labelsize(16);
-              #include <FL/Fl_Text_Editor.H>
             }
             }
             {
             {
               local o = Fl_Check_Button(200, 330, 125, 25, _tr("Wrap lines"));
               local o = Fl_Check_Button(200, 330, 125, 25, _tr("Wrap lines"));
@@ -6005,7 +6002,6 @@ class EditOrderWindow extends Edit_Base_Window {
               o.textsize(16);
               o.textsize(16);
               o.align(5);
               o.align(5);
               o.labelsize(16);
               o.labelsize(16);
-              #include <FL/Fl_Text_Editor.H>
               Fl_Group.current().resizable(o);
               Fl_Group.current().resizable(o);
             }
             }
             {
             {

+ 14 - 14
SquiLu-ourbiz/ourbiz.nut

@@ -1537,12 +1537,12 @@ local DB_Entities = class extends DB_Manager {
 		else if (qs_tbl.rawget("past_products", false)) return entity_past_products_get_sql(qs_tbl.past_products.tointeger());
 		else if (qs_tbl.rawget("past_products", false)) return entity_past_products_get_sql(qs_tbl.past_products.tointeger());
 		else if ( (entity_id = qs_tbl.rawget("history", 0)) ){
 		else if ( (entity_id = qs_tbl.rawget("history", 0)) ){
 			local htype = qs_tbl.rawget("htype", 0);
 			local htype = qs_tbl.rawget("htype", 0);
-			local query_limit = qs_tbl.get(C_query_limit, 50).tointeger();
+			local query_limit = table_get(qs_tbl, C_query_limit, 50).tointeger();
 			return entity_sales_history_sql(htype, query_limit, entity_id.tointeger());
 			return entity_sales_history_sql(htype, query_limit, entity_id.tointeger());
 		}
 		}
 		else if ( (entity_id = qs_tbl.rawget("statistics", 0)) ){
 		else if ( (entity_id = qs_tbl.rawget("statistics", 0)) ){
-			local periode_count = qs_tbl.get(C_periode_count, 12).tointeger();
-			local periode_type = getStatisticsPeriodeType(qs_tbl.get(C_periode_type, C_months));
+			local periode_count = table_get(qs_tbl, C_periode_count, 12).tointeger();
+			local periode_type = getStatisticsPeriodeType(table_get(qs_tbl, C_periode_type, C_months));
 			local sab = qs_tbl.rawget("sab", "S");
 			local sab = qs_tbl.rawget("sab", "S");
 			return entity_bar_chart_statistics_sql(entity_id.tointeger(), sab, periode_count, periode_type);
 			return entity_bar_chart_statistics_sql(entity_id.tointeger(), sab, periode_count, periode_type);
 		}
 		}
@@ -1575,7 +1575,7 @@ order by name
 	}
 	}
 
 
 	function sql_get_one(tbl_qs){
 	function sql_get_one(tbl_qs){
-		local id = tbl_qs.get(table_name, 0).tointeger();
+		local id = table_get(tbl_qs, table_name, 0).tointeger();
 		if(tbl_qs.rawget("for_order", false))
 		if(tbl_qs.rawget("for_order", false))
 		{
 		{
 			return entity_for_order_get_one(id);
 			return entity_for_order_get_one(id);
@@ -1650,7 +1650,7 @@ where l.lang=? and tk.skey=? and tv.lang_id=l.id and tv.key_id=tk.id]==]);
 	function _tr(str)
 	function _tr(str)
 	{
 	{
 /*
 /*
-		local tr_str = _tr_map.get(str, null);
+		local tr_str = table_get(_tr_map, str, null);
 		if(tr_str) return tr_str;
 		if(tr_str) return tr_str;
 
 
 		_tr_stmt.reset();
 		_tr_stmt.reset();
@@ -1718,12 +1718,12 @@ local CalcOrderLine = class
 			C_line_subtotal, C_sales_tax1_pct, C_sales_tax1_amt,
 			C_line_subtotal, C_sales_tax1_pct, C_sales_tax1_amt,
 			C_sales_tax2_pct, C_sales_tax2_amt, C_line_total
 			C_sales_tax2_pct, C_sales_tax2_amt, C_line_total
 			];
 			];
-		use_sales_tax2 = map.get(C_use_sales_tax2, false) == "1";
-		tax_exempt = map.get(C_tax_exempt, false) == "1";
-		price_decimals = map.get(C_price_decimals, 2).tointeger();
+		use_sales_tax2 = table_get(map, C_use_sales_tax2, false) == "1";
+		tax_exempt = table_get(map, C_tax_exempt, false) == "1";
+		price_decimals = table_get(map, C_price_decimals, 2).tointeger();
 
 
 		foreach(field in fields){
 		foreach(field in fields){
-			this[field] = mytofloat(map.get(field, 0.0));
+			this[field] = mytofloat(table_get(map, field, 0.0));
 		}
 		}
 
 
 		calc();
 		calc();
@@ -2161,7 +2161,7 @@ local DB_Orders = class extends DB_Manager {
 			return orders_sales_history_sql(htype, query_limit, qs_tbl.history);
 			return orders_sales_history_sql(htype, query_limit, qs_tbl.history);
 		}
 		}
 		else if (qs_tbl.rawget("statistics", false)){
 		else if (qs_tbl.rawget("statistics", false)){
-			local periode_count = qs_tbl.get(C_periode_count, 12).tointeger();
+			local periode_count = table_get(qs_tbl, C_periode_count, 12).tointeger();
 			local periode_type = getStatisticsPeriodeType(qs_tbl.rawget("periode_type", "months"));
 			local periode_type = getStatisticsPeriodeType(qs_tbl.rawget("periode_type", "months"));
 			local sab = qs_tbl.rawget("sab", "S");
 			local sab = qs_tbl.rawget("sab", "S");
 			return sql_bar_chart_statistics(sab, periode_count, periode_type);
 			return sql_bar_chart_statistics(sab, periode_count, periode_type);
@@ -2173,13 +2173,13 @@ local DB_Orders = class extends DB_Manager {
 	function calc_order_line_from_map(tbl_qs, rec_map)
 	function calc_order_line_from_map(tbl_qs, rec_map)
 	{
 	{
 		_calc_line.reset();
 		_calc_line.reset();
-		local product_id = tbl_qs.get(C_product_id, 0).tointeger();
+		local product_id = table_get(tbl_qs, C_product_id, 0).tointeger();
 		local order_id = tbl_qs.rawget("__id__", 0).tointeger();
 		local order_id = tbl_qs.rawget("__id__", 0).tointeger();
 		if(product_id  && order_id)
 		if(product_id  && order_id)
 		{
 		{
 			local db = getOurbizDB();
 			local db = getOurbizDB();
 			local stmt;
 			local stmt;
-			local str =  tbl_qs.get(C_trigger, false);
+			local str =  table_get(tbl_qs, C_trigger, false);
 			//printf("%s\n", str.c_str());
 			//printf("%s\n", str.c_str());
 			if(str == C_quantity)
 			if(str == C_quantity)
 			{
 			{
@@ -2191,7 +2191,7 @@ and ot.id = o.order_type_id]==], order_id));
 				if(stmt.next_row()){
 				if(stmt.next_row()){
 					str = stmt.col(0);
 					str = stmt.col(0);
 					if(str != "B"){
 					if(str != "B"){
-						local quanity = rec_map.get(C_quantity, 0);
+						local quanity = table_get(rec_map, C_quantity, 0);
 						if(quantity > 0)
 						if(quantity > 0)
 						{
 						{
 							out_buf.clear();
 							out_buf.clear();
@@ -2263,7 +2263,7 @@ where o.id = %d and p.id = %d]==], order_id, product_id));
 	}
 	}
 	
 	
 	function sql_get_one(tbl_qs) {
 	function sql_get_one(tbl_qs) {
-		local id = tbl_qs.get(table_name, 0).tointeger();
+		local id = table_get(tbl_qs, table_name, 0).tointeger();
 		if(tbl_qs.rawget("line", false))
 		if(tbl_qs.rawget("line", false))
 		{
 		{
 			orders_lines_get_one(id);
 			orders_lines_get_one(id);