Преглед изворни кода

More functionality to the sample ourbiz.

mingodad пре 13 година
родитељ
комит
0f77e5cd49

+ 479 - 238
SquiLu-ourbiz/edit-entity-window.nut

@@ -1,264 +1,274 @@
 class EditEntityWindow extends EditWindow {
 
   // Declaration of class members
-  db_entities_id = null;
-  db_entities_name_ro = null;
-  db_entities_mdate = null;
-  db_entities_cdate = null;
+  db_products_id = null;
+  db_products_description_ro = null;
+  db_products_mdate = null;
+  db_products_cdate = null;
   tabs = null;
   tabMain = null;
-  db_entities_name = null;
-  db_entities_company = null;
-  db_entities_address = null;
-  db_entities_zip = null;
-  db_entities_city = null;
-  db_entities_state = null;
-  db_entities_country = null;
-  db_entities_tax_number = null;
-  db_entities_show_on_sales = null;
-  db_entities_show_on_buys = null;
-  db_entities_is_active = null;
-  db_entities_phone = null;
-  db_entities_fax = null;
-  db_entities_use_sales_tax2 = null;
-  db_entities_email = null;
-  db_entities_sales_tax_exempt = null;
-  db_entities_web = null;
-  db_entities_irpf_pct_retention = null;
-  db_entities_contact = null;
-  db_entities_gps_coordinates = null;
-  btnDbAction = null;
+  db_products_reference_code = null;
+  db_products_supplier_code = null;
+  db_products_bar_code = null;
+  db_products_sell_description = null;
+  db_products_buy_description = null;
+  db_products_sell_price = null;
+  db_products_measure_unit_id = null;
+  db_products_sales_tax_id = null;
+  db_products_warranty_id = null;
+  db_products_sell_quantity_min = null;
+  db_products_units_by_package = null;
+  db_products_weight = null;
+  db_products_sell_without_stock = null;
+  db_products_is_active = null;
+  db_products_show_on_sales = null;
+  db_products_show_on_buys = null;
+  db_products_show_on_web = null;
+  db_products_show_price_on_web = null;
   dbAction = null;
+  btnDbAction = null;
+  tabsMoreData = null;
   tabNotes = null;
-  db_entities_notes = null;
+  db_products_sell_notes = null;
+  tabNotesSupplier = null;
+  db_products_buy_notes = null;
   tabTags = null;
-  db_entities_tags = null;
-  tabGroups = null;
-  db_entities_group_id = null;
-  tabTotals = null;
-  db_entities_credit_allowed = null;
-  db_entities_balance = null;
-  db_entities_sales_quoted = null;
-  db_entities_sales_ordered = null;
-  db_entities_sales_delivered = null;
-  db_entities_sales_invoiced = null;
-  db_entities_sales_discount = null;
-  db_entities_sales_paid = null;
-  db_entities_buys_quoted = null;
-  db_entities_buys_ordered = null;
-  db_entities_buys_received = null;
-  db_entities_buys_invoiced = null;
-  db_entities_buys_paid = null;
-  db_entities_buys_discount = null;
+  db_products_tags = null;
+  db_products_group_id = null;
+  btnImage = null;
+  db_products_quantity_onhand = null;
+  tabPrices = null;
+  db_products_buy_price = null;
+  db_products_buy_discount = null;
+  db_products_buy_other_costs = null;
+  db_products_sell_markup = null;
+  markup_to_discount = null;
+  db_products_sell_price_ro = null;
+  db_products_price_decimals = null;
+  btnSaveProrduct = null;
+  db_products_stock_min = null;
+  db_products_stock_max = null;
+  db_products_buy_quantity_min = null;
+  db_products_price_formula = null;
+  db_products_price_date = null;
+  productPrices = null;
+  tabKit = null;
   tabChartStatistics = null;
   tabHistory = null;
   tabReports = null;
-  btnEntitesListContactReport = null;
-  print_progress = null;
+  grpExportImport = null;
+  btnProductsExport = null;
+  btnProductsImport = null;
+  chkWithoutPrices = null;
+  chkWebOnly = null;
+  boxExportImportCount = null;
+  btnProductGroupsExport = null;
+  btnProductGroupsImport = null;
+  btnUpdateWeb = null;
+  grpPrintPriceList = null;
+  chkPriceListWithVAT = null;
+  chkPriceListSellOnWeb = null;
+  btnPrintPriceList = null;
+  chkPriceListSellSales = null;
+  chkPriceListSellPDF = null;
+  tabTotals = null;
+  db_products_quantity_quoted_sales = null;
+  db_products_quantity_ordered_sales = null;
+  db_products_quantity_delivered = null;
+  db_products_quantity_invoiced_sales = null;
+  db_products_quantity_lost = null;
+  db_products_quantity_quoted_buys = null;
+  db_products_quantity_ordered_buys = null;
+  db_products_quantity_received = null;
+  db_products_quantity_invoiced_buys = null;
   
-  constructor(px=54, py=85, pw=800, ph=560, pl=_tr("Edit Entity")){
+  constructor(px=34, py=28, pw=800, ph=560, pl=_tr("Edit Products")){
     base.constructor(px, py, pw, ph, pl);
     // Create member functions and widgets
     {
       local o = Fl_Output(5, 5, 96, 25);
-      db_entities_id = o;
+      db_products_id = o;
       o.textsize(16);
       o.labelsize(16);
       o.labeltype(FL_NO_LABEL);
-      add_input_field_to_map("entities", "id", db_entities_id);
+      add_input_field_to_map("products", "id", db_products_id);
     }
     {
       local o = Fl_Output(110, 5, 545, 25);
-      db_entities_name_ro = o;
+      db_products_description_ro = o;
       o.textsize(16);
       o.labeltype(FL_NO_LABEL);
       o.labelsize(16);
     }
     {
       local o = Fl_Output(666, 5, 130, 25);
-      db_entities_mdate = o;
+      db_products_mdate = o;
       o.textsize(16);
-      o.labeltype(FL_NO_LABEL);
-      o.tooltip(_tr("This record last update date"));
       o.labelsize(16);
-      add_input_field_to_map("entities", "mdate", db_entities_mdate);
+      o.labeltype(FL_NO_LABEL);
+      add_input_field_to_map("products", "mdate", db_products_mdate);
     }
     {
       local o = Fl_Output(665, 35, 130, 25);
-      db_entities_cdate = o;
+      db_products_cdate = o;
       o.textsize(16);
       o.labeltype(FL_NO_LABEL);
-      o.tooltip(_tr("This record creation date"));
       o.labelsize(16);
-      add_input_field_to_map("entities", "cdate", db_entities_cdate);
+      add_input_field_to_map("products", "cdate", db_products_cdate);
     }
     {
-      local o = Fl_Tabs(5, 35, 790, 521);
+      local o = Fl_Tabs(5, 35, 790, 520);
       tabs = o;
       o.labelcolor(7);
       o.selection_color(4);
       o.labelsize(16);
       {
         {
-          local o = Fl_Group(5, 62, 790, 494, _tr("Main"));
+          local o = Fl_Group(5, 60, 790, 495, _tr("Main"));
           tabMain = o;
           o.labelsize(16);
           o.color(246);
           {
             {
-              local o = Fl_Input(115, 70, 670, 25, _tr("Name"));
-              db_entities_name = o;
+              local o = Fl_Input(115, 70, 165, 25, _tr("Reference"));
+              db_products_reference_code = o;
               o.textsize(16);
               o.labelsize(16);
-              add_input_field_to_map("entities", "name", db_entities_name);
+              add_input_field_to_map("products", "reference_code", db_products_reference_code);
             }
             {
-              local o = Fl_Input(115, 100, 670, 25, _tr("Company"));
-              db_entities_company = o;
+              local o = Fl_Input(380, 70, 165, 25, _tr("Ref. Supp."));
+              db_products_supplier_code = o;
               o.textsize(16);
               o.labelsize(16);
-              add_input_field_to_map("entities", "company", db_entities_company);
+              add_input_field_to_map("products", "supplier_code", db_products_supplier_code);
             }
             {
-              local o = Fl_Input(115, 130, 670, 25, _tr("Address"));
-              db_entities_address = o;
+              local o = Fl_Input(620, 70, 165, 25, _tr("Barcode"));
+              db_products_bar_code = o;
               o.textsize(16);
               o.labelsize(16);
-              add_input_field_to_map("entities", "address", db_entities_address);
+              add_input_field_to_map("products", "bar_code", db_products_bar_code);
             }
             {
-              local o = Fl_Input(115, 160, 95, 25, _tr("ZIP"));
-              db_entities_zip = o;
+              local o = Fl_Input(115, 100, 670, 25, _tr("Description"));
+              db_products_sell_description = o;
               o.textsize(16);
               o.labelsize(16);
-              add_input_field_to_map("entities", "zip", db_entities_zip);
+              add_input_field_to_map("products", "sell_description", db_products_sell_description);
             }
             {
-              local o = Fl_Input(311, 160, 474, 25, _tr("City"));
-              db_entities_city = o;
+              local o = Fl_Input(115, 130, 670, 25, _tr("Desc. Supp."));
+              db_products_buy_description = o;
               o.textsize(16);
               o.labelsize(16);
-              add_input_field_to_map("entities", "city", db_entities_city);
+              add_input_field_to_map("products", "buy_description", db_products_buy_description);
             }
             {
-              local o = Fl_Input(115, 189, 390, 25, _tr("State"));
-              db_entities_state = o;
+              local o = Fl_Float_Input_Fmt(115, 160, 110, 25, _tr("Sales Price"));
+              db_products_sell_price = o;
               o.textsize(16);
               o.labelsize(16);
-              add_input_field_to_map("entities", "state", db_entities_state);
+              add_input_field_to_map("products", "sell_price", db_products_sell_price);
             }
             {
-              local o = Fl_Input(585, 190, 200, 25, _tr("Country"));
-              db_entities_country = o;
+              local o = Fl_Choice_Int(370, 160, 110, 25, _tr("Measure Unit"));
+              db_products_measure_unit_id = o;
               o.textsize(16);
+              o.down_box(FL_BORDER_BOX);
               o.labelsize(16);
-              add_input_field_to_map("entities", "country", db_entities_country);
+              add_input_field_to_map("products", "measure_unit_id", db_products_measure_unit_id);
             }
             {
-              local o = Fl_Input(115, 220, 200, 25, _tr("Tax Num."));
-              db_entities_tax_number = o;
+              local o = Fl_Choice_Int(115, 190, 110, 25, _tr("V.A.T."));
+              db_products_sales_tax_id = o;
               o.textsize(16);
+              o.down_box(FL_BORDER_BOX);
               o.labelsize(16);
-              add_input_field_to_map("entities", "tax_number", db_entities_tax_number);
-            }
-            {
-              local o = Fl_Check_Button(325, 220, 115, 25, _tr("Sales"));
-              db_entities_show_on_sales = o;
-              o.labelsize(16);
-              o.down_box(FL_DOWN_BOX);
-              add_input_field_to_map("entities", "show_on_sales", db_entities_show_on_sales);
+              add_input_field_to_map("products", "sales_tax_id", db_products_sales_tax_id);
             }
             {
-              local o = Fl_Check_Button(445, 220, 125, 25, _tr("Buys"));
-              db_entities_show_on_buys = o;
+              local o = Fl_Choice_Int(370, 190, 110, 25, _tr("Warranty"));
+              db_products_warranty_id = o;
+              o.textsize(16);
+              o.down_box(FL_BORDER_BOX);
               o.labelsize(16);
-              o.down_box(FL_DOWN_BOX);
-              add_input_field_to_map("entities", "show_on_buys", db_entities_show_on_buys);
+              add_input_field_to_map("products", "warranty_id", db_products_warranty_id);
             }
             {
-              local o = Fl_Check_Button(585, 220, 155, 25, _tr("Active"));
-              db_entities_is_active = o;
+              local o = Fl_Float_Input(370, 250, 110, 25, _tr("Sell Min. Qty."));
+              db_products_sell_quantity_min = o;
+              o.textsize(16);
               o.labelsize(16);
-              o.down_box(FL_DOWN_BOX);
-              add_input_field_to_map("entities", "is_active", db_entities_is_active);
+              o->decimal_places(-6);
+              add_input_field_to_map("products", "sell_quantity_min", db_products_sell_quantity_min);
             }
             {
-              local o = Fl_Input(115, 249, 200, 25, _tr("Phone"));
-              db_entities_phone = o;
+              local o = Fl_Float_Input(370, 280, 110, 25, _tr("Units by Pack."));
+              db_products_units_by_package = o;
               o.textsize(16);
               o.labelsize(16);
-              add_input_field_to_map("entities", "phone", db_entities_phone);
+              o->decimal_places(-6);
+              add_input_field_to_map("products", "units_by_package", db_products_units_by_package);
             }
             {
-              local o = Fl_Input(370, 249, 200, 25, _tr("Fax"));
-              db_entities_fax = o;
+              local o = Fl_Float_Input(370, 220, 110, 25, _tr("Weight"));
+              db_products_weight = o;
               o.textsize(16);
               o.labelsize(16);
-              add_input_field_to_map("entities", "fax", db_entities_fax);
+              o->decimal_places(-6);
+              add_input_field_to_map("products", "weight", db_products_weight);
             }
             {
-              local o = Fl_Check_Button(585, 250, 155, 25, _tr("Use Sales Tax II"));
-              db_entities_use_sales_tax2 = o;
+              local o = Fl_Check_Button(10, 250, 215, 25, _tr("Sell without stock"));
+              db_products_sell_without_stock = o;
               o.labelsize(16);
               o.down_box(FL_DOWN_BOX);
-              add_input_field_to_map("entities", "use_sales_tax2", db_entities_use_sales_tax2);
+              add_input_field_to_map("products", "sell_without_stock", db_products_sell_without_stock);
             }
             {
-              local o = Fl_Input(115, 280, 455, 25, _tr("Email"));
-              db_entities_email = o;
-              o.textsize(16);
-              o.labelsize(16);
-              add_input_field_to_map("entities", "email", db_entities_email);
-            }
-            {
-              local o = Fl_Check_Button(585, 280, 155, 25, _tr("Sales Tax Exempt"));
-              db_entities_sales_tax_exempt = o;
+              local o = Fl_Check_Button(10, 280, 110, 25, _tr("Active"));
+              db_products_is_active = o;
               o.labelsize(16);
               o.down_box(FL_DOWN_BOX);
-              add_input_field_to_map("entities", "sales_tax_exempt", db_entities_sales_tax_exempt);
+              add_input_field_to_map("products", "is_active", db_products_is_active);
             }
             {
-              local o = Fl_Input(115, 310, 455, 25, _tr("Web"));
-              db_entities_web = o;
-              o.textsize(16);
+              local o = Fl_Check_Button(10, 310, 105, 25, _tr("Sales"));
+              db_products_show_on_sales = o;
               o.labelsize(16);
-              add_input_field_to_map("entities", "web", db_entities_web);
+              o.down_box(FL_DOWN_BOX);
+              add_input_field_to_map("products", "show_on_sales", db_products_show_on_sales);
             }
             {
-              local o = Fl_Float_Input_Fmt(585, 310, 60, 25, _tr("I.R.P.F. %"));
-              db_entities_irpf_pct_retention = o;
-              o.textsize(16);
-              o.align(8);
+              local o = Fl_Check_Button(10, 340, 95, 25, _tr("Buys"));
+              db_products_show_on_buys = o;
               o.labelsize(16);
-              add_input_field_to_map("entities", "irpf_pct_retention", db_entities_irpf_pct_retention);
+              o.down_box(FL_DOWN_BOX);
+              add_input_field_to_map("products", "show_on_buys", db_products_show_on_buys);
             }
             {
-              local o = Fl_Input(115, 340, 455, 25, _tr("Contact"));
-              db_entities_contact = o;
-              o.textsize(16);
+              local o = Fl_Check_Button(115, 310, 120, 25, _tr("Web"));
+              db_products_show_on_web = o;
               o.labelsize(16);
-              add_input_field_to_map("entities", "contact", db_entities_contact);
+              o.down_box(FL_DOWN_BOX);
+              add_input_field_to_map("products", "show_on_web", db_products_show_on_web);
             }
             {
-              local o = Fl_Input(630, 340, 155, 25, _tr("GPS"));
-              db_entities_gps_coordinates = o;
-              o.textsize(16);
+              local o = Fl_Check_Button(115, 340, 100, 25, _tr("Web price"));
+              db_products_show_price_on_web = o;
               o.labelsize(16);
-              add_input_field_to_map("entities", "gps_coordinates", db_entities_gps_coordinates);
+              o.down_box(FL_DOWN_BOX);
+              add_input_field_to_map("products", "show_price_on_web", db_products_show_price_on_web);
             }
             {
-              local o = Fl_Group(675, 394, 110, 151);
+              local o = Fl_Group(675, 402, 110, 143);
               {
                 {
-                  local o = Fl_Box(675, 394, 110, 73, _tr("Spacer"));
+                  local o = Fl_Box(675, 402, 110, 68, _tr("Spacer"));
                   o.labeltype(FL_NO_LABEL);
                   Fl_Group.current().resizable(o);
                 }
-                {
-                  local o = Fl_Button(675, 470, 110, 25, _tr("Action"));
-                  btnDbAction = o;
-                  o.labelsize(16);
-                }
                 {
                   local o = Fl_Choice_dbAction(675, 520, 110, 25, _tr("Action"));
                   dbAction = o;
@@ -267,211 +277,442 @@ class EditEntityWindow extends EditWindow {
                   o.down_box(FL_BORDER_BOX);
                   o.labelsize(16);
                 }
+                {
+                  local o = Fl_Button(675, 470, 110, 25, _tr("Action"));
+                  btnDbAction = o;
+                  o.labelsize(16);
+                }
               }
               o.end();
             }
             {
-              local o = Fl_Tabs(15, 375, 650, 181);
+              local o = Fl_Tabs(10, 370, 650, 181);
+              tabsMoreData = o;
               o.labelcolor(7);
-              o.selection_color(4);
               o.labelsize(16);
+              o.selection_color(4);
               {
                 {
-                  local o = Fl_Group(15, 405, 650, 150, _tr("Notes"));
+                  local o = Fl_Group(10, 400, 650, 150, _tr("Notes"));
                   tabNotes = o;
                   o.labelsize(16);
                   {
                     {
-                      local o = Fl_Text_Editor_Buffered(15, 405, 650, 150);
-                      db_entities_notes = o;
+                      local o = Fl_Text_Editor_Buffered(10, 400, 650, 150);
+                      db_products_sell_notes = o;
                       o.textsize(16);
                       o.align(5);
                       o.labeltype(FL_NO_LABEL);
                       o.labelsize(16);
-                      add_input_field_to_map("entities", "notes", db_entities_notes);
+                      add_input_field_to_map("products", "sell_notes", db_products_sell_notes);
                       Fl_Group.current().resizable(o);
                     }
                   }
                   o.end();
                 }
                 {
-                  local o = Fl_Group(15, 405, 650, 150, _tr("Tags"));
-                  tabTags = o;
+                  local o = Fl_Group(10, 400, 650, 150, _tr("Notes Supplier"));
+                  tabNotesSupplier = o;
                   o.labelsize(16);
                   {
                     {
-                      local o = Fl_Text_Editor_Buffered(15, 405, 650, 150);
-                      db_entities_tags = o;
+                      local o = Fl_Text_Editor_Buffered(10, 400, 650, 150);
+                      db_products_buy_notes = o;
                       o.textsize(16);
                       o.align(5);
                       o.labeltype(FL_NO_LABEL);
                       o.labelsize(16);
-                      add_input_field_to_map("entities", "tags", db_entities_tags);
+                      add_input_field_to_map("products", "buy_notes", db_products_buy_notes);
                       Fl_Group.current().resizable(o);
                     }
                   }
                   o.end();
                 }
                 {
-                  local o = Fl_Group(15, 400, 650, 156, _tr("Groups"));
-                  tabGroups = o;
+                  local o = Fl_Group(10, 400, 650, 150, _tr("Tags"));
+                  tabTags = o;
+                  o.labelsize(16);
                   {
                     {
-                      local o = Flu_Tree_Browser(15, 405, 650, 150);
-                      db_entities_group_id = o;
+                      local o = Fl_Text_Editor_Buffered(10, 400, 650, 150);
+                      db_products_tags = o;
+                      o.textsize(16);
+                      o.align(5);
+                      o.labeltype(FL_NO_LABEL);
                       o.labelsize(16);
-                      add_input_field_to_map("entities", "group_id", db_entities_group_id);
+                      add_input_field_to_map("products", "tags", db_products_tags);
+                      Fl_Group.current().resizable(o);
                     }
                   }
                   o.end();
                 }
+                {
+                  local o = Flu_Tree_Browser(10, 400, 650, 150, _tr("Groups"));
+                  db_products_group_id = o;
+                  o.selection_color(23);
+                  o.labelsize(16);
+                  add_input_field_to_map("products", "group_id", db_products_group_id);
+                }
               }
               o.end();
             }
             {
-              local o = Fl_Check_Button(375, 380, 102, 25, _tr("Wrap lines"));
+              local o = Fl_Image_Box(485, 158, 300, 232);
+              btnImage = o;
+              o.box(FL_ENGRAVED_BOX);
+              o.align(80);
+              o.color(7);
+            }
+            {
+              local o = Fl_Check_Button(370, 375, 102, 25, _tr("Wrap lines"));
               o.labelsize(16);
               o.value(1);
               o.down_box(FL_DOWN_BOX);
             }
+            {
+              local o = Fl_Float_Input(115, 220, 110, 25, _tr("Onhand"));
+              db_products_quantity_onhand = o;
+              o.textsize(16);
+              o.labelsize(16);
+              o->decimal_places(-6);
+              add_input_field_to_map("products", "quantity_onhand", db_products_quantity_onhand);
+            }
           }
           o.end();
           Fl_Group.current().resizable(o);
         }
         {
-          local o = Fl_Group(5, 62, 790, 493, _tr("Totals"));
-          tabTotals = o;
+          local o = Fl_Group(5, 60, 790, 495, _tr("Prices"));
+          tabPrices = o;
           o.labelsize(16);
           o.color(246);
           {
             {
-              local o = Fl_Float_Input_Fmt(140, 75, 110, 25, _tr("Credit"));
-              db_entities_credit_allowed = o;
-              o.textsize(16);
+              local o = Fl_Group(15, 88, 770, 201, _tr("Sales Price"));
               o.labelsize(16);
-              add_input_field_to_map("entities", "credit_allowed", db_entities_credit_allowed);
+              o.color(166);
+              o.box(FL_UP_BOX);
+              {
+                {
+                  local o = Fl_Float_Input_Fmt(25, 115, 115, 25, _tr("Buy $"));
+                  db_products_buy_price = o;
+                  o.textsize(16);
+                  o.align(5);
+                  o.labelsize(16);
+                  add_input_field_to_map("products", "buy_price", db_products_buy_price);
+                }
+                {
+                  local o = Fl_Float_Input_Fmt(151, 115, 115, 25, _tr("Buy Disc. %"));
+                  db_products_buy_discount = o;
+                  o.textsize(16);
+                  o.align(5);
+                  o.labelsize(16);
+                  add_input_field_to_map("products", "buy_discount", db_products_buy_discount);
+                  o->decimal_places(-6);
+                }
+                {
+                  local o = Fl_Float_Input_Fmt(278, 115, 115, 25, _tr("Other Costs $"));
+                  db_products_buy_other_costs = o;
+                  o.textsize(16);
+                  o.align(5);
+                  o.labelsize(16);
+                  add_input_field_to_map("products", "buy_other_costs", db_products_buy_other_costs);
+                }
+                {
+                  local o = Fl_Float_Input_Fmt(404, 115, 115, 25, _tr("Markup %"));
+                  db_products_sell_markup = o;
+                  o.textsize(16);
+                  o.align(5);
+                  o.labelsize(16);
+                  add_input_field_to_map("products", "sell_markup", db_products_sell_markup);
+                  //o->decimal_places(-6);
+                }
+                {
+                  local o = Fl_Float_Input_Fmt(531, 115, 115, 25, _tr("Margin %"));
+                  markup_to_discount = o;
+                  o.textsize(16);
+                  o.align(5);
+                  o.labelsize(16);
+                  //o->decimal_places(-6);
+                }
+                {
+                  local o = Fl_Float_Input_Fmt(658, 115, 115, 25, _tr("Sales $"));
+                  db_products_sell_price_ro = o;
+                  o.textsize(16);
+                  o.align(5);
+                  o.labelsize(16);
+                }
+                {
+                  local o = Fl_Int_Input(530, 150, 30, 25, _tr("Decimals for calculation"));
+                  db_products_price_decimals = o;
+                  o.textsize(16);
+                  o.labelfont(1);
+                  o.textfont(1);
+                  o.labelsize(16);
+                  add_input_field_to_map("products", "price_decimals", db_products_price_decimals);
+                  //o->decimal_places(-6);
+                }
+                {
+                  local o = Fl_Button(662, 150, 111, 25, _tr("Save"));
+                  btnSaveProrduct = o;
+                  o.labelsize(16);
+                }
+                {
+                  local o = Fl_Float_Input(665, 195, 110, 25, _tr("Stock Min."));
+                  db_products_stock_min = o;
+                  o.textsize(16);
+                  o.labelsize(16);
+                  add_input_field_to_map("products", "stock_min", db_products_stock_min);
+                  o->decimal_places(-6);
+                }
+                {
+                  local o = Fl_Float_Input(665, 225, 110, 25, _tr("Stock Max."));
+                  db_products_stock_max = o;
+                  o.textsize(16);
+                  o.labelsize(16);
+                  add_input_field_to_map("products", "stock_max", db_products_stock_max);
+                  o->decimal_places(-6);
+                }
+                {
+                  local o = Fl_Float_Input(665, 255, 110, 25, _tr("Buy Min. Qty."));
+                  db_products_buy_quantity_min = o;
+                  o.textsize(16);
+                  o.labelsize(16);
+                  add_input_field_to_map("products", "buy_quantity_min", db_products_buy_quantity_min);
+                  o->decimal_places(-6);
+                }
+                {
+                  local o = Fl_Multiline_Input(25, 197, 495, 83, _tr("Price formula"));
+                  db_products_price_formula = o;
+                  o.textsize(16);
+                  o.align(5);
+                  o.labelsize(16);
+                  add_input_field_to_map("products", "price_formula", db_products_price_formula);
+                }
+                {
+                  local o = Fl_Output(25, 150, 130, 25, _tr("Last Update"));
+                  db_products_price_date = o;
+                  o.textsize(16);
+                  o.align(8);
+                  o.labelsize(16);
+                }
+              }
+              o.end();
             }
             {
-              local o = Fl_Float_Input_Fmt(140, 110, 110, 25, _tr("Balance"));
-              db_entities_balance = o;
-              o.textsize(16);
-              o.labelsize(16);
-              add_input_field_to_map("entities", "balance", db_entities_balance);
+              local o = Fl_Box(15, 290, 770, 40, _tr("Spacer"));
+              o.labeltype(FL_NO_LABEL);
+              Fl_Group.current().resizable(o);
             }
             {
-              local o = Fl_Float_Input_Fmt(140, 155, 110, 25, _tr("Sales Quoted"));
-              db_entities_sales_quoted = o;
-              o.textsize(16);
+              local o = Fl_Group(15, 332, 770, 212);
+              productPrices = o;
+              o.box(FL_UP_BOX);
               o.labelsize(16);
-              add_input_field_to_map("entities", "sales_quoted", db_entities_sales_quoted);
+              o.color(166);
+              o.labeltype(FL_NO_LABEL);
+              o.end();
             }
+          }
+          o.end();
+        }
+        {
+          local o = Fl_Group(5, 59, 790, 495, _tr("Kit"));
+          tabKit = o;
+          o.labelsize(16);
+          o.color(246);
+          o.end();
+        }
+        {
+          local o = Fl_Group(5, 60, 790, 495, _tr("Statistics"));
+          tabChartStatistics = o;
+          o.labelsize(16);
+          o.color(246);
+          o.end();
+        }
+        {
+          local o = Fl_Group(5, 60, 790, 495, _tr("History"));
+          tabHistory = o;
+          o.labelsize(16);
+          o.color(246);
+          o.end();
+        }
+        {
+          local o = Fl_Group(5, 60, 790, 495, _tr("Reports"));
+          tabReports = o;
+          o.labelsize(16);
+          o.color(246);
+          o.box(FL_UP_BOX);
+          {
             {
-              local o = Fl_Float_Input_Fmt(140, 190, 110, 25, _tr("Sales Ordered"));
-              db_entities_sales_ordered = o;
-              o.textsize(16);
+              local o = Fl_Group(15, 465, 770, 80, _tr("Export / Import"));
+              grpExportImport = o;
               o.labelsize(16);
-              add_input_field_to_map("entities", "sales_ordered", db_entities_sales_ordered);
+              o.box(FL_ENGRAVED_FRAME);
+              {
+                {
+                  local o = Fl_Button(25, 475, 175, 25, _tr("Products Export"));
+                  btnProductsExport = o;
+                  o.labelsize(16);
+                }
+                {
+                  local o = Fl_Button(25, 510, 175, 25, _tr("Products Import"));
+                  btnProductsImport = o;
+                  o.labelsize(16);
+                }
+                {
+                  local o = Fl_Check_Button(225, 480, 150, 25, _tr("Withouth Prices"));
+                  chkWithoutPrices = o;
+                  o.labelsize(16);
+                  o.down_box(FL_DOWN_BOX);
+                }
+                {
+                  local o = Fl_Check_Button(225, 510, 150, 25, _tr("WEB Only"));
+                  chkWebOnly = o;
+                  o.labelsize(16);
+                  o.down_box(FL_DOWN_BOX);
+                }
+                {
+                  local o = Fl_Box(405, 499, 42, 25, _tr("0"));
+                  boxExportImportCount = o;
+                  o.labelsize(16);
+                }
+                {
+                  local o = Fl_Button(555, 475, 220, 25, _tr("Product Groups Export"));
+                  btnProductGroupsExport = o;
+                  o.labelsize(16);
+                }
+                {
+                  local o = Fl_Button(555, 510, 220, 25, _tr("Product Groups import"));
+                  btnProductGroupsImport = o;
+                  o.labelsize(16);
+                }
+              }
+              o.end();
             }
             {
-              local o = Fl_Float_Input_Fmt(140, 225, 110, 25, _tr("Sales Delivered"));
-              db_entities_sales_delivered = o;
-              o.textsize(16);
+              local o = Fl_Button(610, 70, 175, 25, _tr("Update WEB"));
+              btnUpdateWeb = o;
               o.labelsize(16);
-              add_input_field_to_map("entities", "sales_delivered", db_entities_sales_delivered);
             }
             {
-              local o = Fl_Float_Input_Fmt(140, 260, 110, 25, _tr("Sales Invoiced"));
-              db_entities_sales_invoiced = o;
-              o.textsize(16);
+              local o = Fl_Group(10, 85, 195, 165, _tr("Price List"));
+              grpPrintPriceList = o;
               o.labelsize(16);
-              add_input_field_to_map("entities", "sales_invoiced", db_entities_sales_invoiced);
+              o.box(FL_ENGRAVED_FRAME);
+              {
+                {
+                  local o = Fl_Check_Button(20, 95, 175, 25, _tr("With V.A.T."));
+                  chkPriceListWithVAT = o;
+                  o.labelsize(16);
+                  o.down_box(FL_DOWN_BOX);
+                }
+                {
+                  local o = Fl_Check_Button(20, 125, 170, 25, _tr("Sell on WEB"));
+                  chkPriceListSellOnWeb = o;
+                  o.labelsize(16);
+                  o.down_box(FL_DOWN_BOX);
+                }
+                {
+                  local o = Fl_Button(20, 215, 175, 25, _tr("Print"));
+                  btnPrintPriceList = o;
+                  o.labelsize(16);
+                }
+                {
+                  local o = Fl_Check_Button(20, 155, 175, 25, _tr("Sales"));
+                  chkPriceListSellSales = o;
+                  o.labelsize(16);
+                  o.down_box(FL_DOWN_BOX);
+                }
+                {
+                  local o = Fl_Check_Button(20, 185, 175, 25, _tr("PDF"));
+                  chkPriceListSellPDF = o;
+                  o.labelsize(16);
+                  o.down_box(FL_DOWN_BOX);
+                }
+              }
+              o.end();
             }
+          }
+          o.end();
+        }
+        {
+          local o = Fl_Group(5, 60, 790, 495, _tr("Totals"));
+          tabTotals = o;
+          o.labelsize(16);
+          o.color(246);
+          {
             {
-              local o = Fl_Float_Input_Fmt(140, 295, 110, 25, _tr("Sales Discount"));
-              db_entities_sales_discount = o;
+              local o = Fl_Float_Input(220, 80, 110, 25, _tr("Quantity quoted sales"));
+              db_products_quantity_quoted_sales = o;
               o.textsize(16);
               o.labelsize(16);
-              add_input_field_to_map("entities", "sales_discount", db_entities_sales_discount);
+              o->decimal_places(-6);
+              add_input_field_to_map("products", "quantity_quoted_sales", db_products_quantity_quoted_sales);
             }
             {
-              local o = Fl_Float_Input_Fmt(140, 330, 110, 25, _tr("Sales Paid"));
-              db_entities_sales_paid = o;
+              local o = Fl_Float_Input(220, 115, 110, 25, _tr("Quantity ordered sales"));
+              db_products_quantity_ordered_sales = o;
               o.textsize(16);
               o.labelsize(16);
-              add_input_field_to_map("entities", "sales_paid", db_entities_sales_paid);
+              o->decimal_places(-6);
+              add_input_field_to_map("products", "quantity_ordered_sales", db_products_quantity_ordered_sales);
             }
             {
-              local o = Fl_Float_Input_Fmt(410, 155, 110, 25, _tr("Buys Quoted"));
-              db_entities_buys_quoted = o;
+              local o = Fl_Float_Input(220, 150, 110, 25, _tr("Quantity delivered"));
+              db_products_quantity_delivered = o;
               o.textsize(16);
               o.labelsize(16);
-              add_input_field_to_map("entities", "buys_quoted", db_entities_buys_quoted);
+              o->decimal_places(-6);
+              add_input_field_to_map("products", "quantity_delivered", db_products_quantity_delivered);
             }
             {
-              local o = Fl_Float_Input_Fmt(410, 190, 110, 25, _tr("Buys Ordered"));
-              db_entities_buys_ordered = o;
+              local o = Fl_Float_Input(220, 185, 110, 25, _tr("Quantity invoiced sales"));
+              db_products_quantity_invoiced_sales = o;
               o.textsize(16);
               o.labelsize(16);
-              add_input_field_to_map("entities", "buys_ordered", db_entities_buys_ordered);
+              o->decimal_places(-6);
+              add_input_field_to_map("products", "quantity_invoiced_sales", db_products_quantity_invoiced_sales);
             }
             {
-              local o = Fl_Float_Input_Fmt(410, 225, 110, 25, _tr("Buys Received"));
-              db_entities_buys_received = o;
+              local o = Fl_Float_Input(220, 220, 110, 25, _tr("Quantity lost"));
+              db_products_quantity_lost = o;
               o.textsize(16);
               o.labelsize(16);
-              add_input_field_to_map("entities", "buys_received", db_entities_buys_received);
+              o->decimal_places(-6);
+              add_input_field_to_map("products", "quantity_lost", db_products_quantity_lost);
             }
             {
-              local o = Fl_Float_Input_Fmt(410, 260, 110, 25, _tr("Buys Invoiced"));
-              db_entities_buys_invoiced = o;
+              local o = Fl_Float_Input(665, 85, 110, 25, _tr("Quantity quoted buys"));
+              db_products_quantity_quoted_buys = o;
               o.textsize(16);
               o.labelsize(16);
-              add_input_field_to_map("entities", "buys_invoiced", db_entities_buys_invoiced);
+              o->decimal_places(-6);
+              add_input_field_to_map("products", "quantity_quoted_buys", db_products_quantity_quoted_buys);
             }
             {
-              local o = Fl_Float_Input_Fmt(410, 330, 110, 25, _tr("Buys Paid"));
-              db_entities_buys_paid = o;
+              local o = Fl_Float_Input(665, 120, 110, 25, _tr("Quantity ordered buys"));
+              db_products_quantity_ordered_buys = o;
               o.textsize(16);
               o.labelsize(16);
-              add_input_field_to_map("entities", "buys_paid", db_entities_buys_paid);
+              o->decimal_places(-6);
+              add_input_field_to_map("products", "quantity_ordered_buys", db_products_quantity_ordered_buys);
             }
             {
-              local o = Fl_Float_Input_Fmt(410, 295, 110, 25, _tr("Buys Discount"));
-              db_entities_buys_discount = o;
+              local o = Fl_Float_Input(665, 155, 110, 25, _tr("Quantity received"));
+              db_products_quantity_received = o;
               o.textsize(16);
               o.labelsize(16);
-              add_input_field_to_map("entities", "buys_discount", db_entities_buys_discount);
-            }
-          }
-          o.end();
-        }
-        {
-          local o = Fl_Group(5, 62, 790, 493, _tr("Statistics"));
-          tabChartStatistics = o;
-          o.labelsize(16);
-          o.color(246);
-          o.end();
-        }
-        {
-          local o = Fl_Group(5, 59, 790, 496, _tr("History"));
-          tabHistory = o;
-          o.labelsize(16);
-          o.color(246);
-          o.end();
-        }
-        {
-          local o = Fl_Group(5, 59, 790, 496, _tr("Reports"));
-          tabReports = o;
-          o.labelsize(16);
-          o.color(246);
-          {
-            {
-              local o = Fl_Button(255, 100, 215, 25, _tr("Entities List Contact Report"));
-              btnEntitesListContactReport = o;
+              o->decimal_places(-6);
+              add_input_field_to_map("products", "quantity_received", db_products_quantity_received);
             }
             {
-              local o = Fl_Progress(255, 140, 215, 25, _tr("Printing Progress"));
-              print_progress = o;
+              local o = Fl_Float_Input(665, 190, 110, 25, _tr("Quantity invoiced buys"));
+              db_products_quantity_invoiced_buys = o;
+              o.textsize(16);
+              o.labelsize(16);
+              o->decimal_places(-6);
+              add_input_field_to_map("products", "quantity_invoiced_buys", db_products_quantity_invoiced_buys);
             }
           }
           o.end();

+ 734 - 693
SquiLu-ourbiz/edit-product-window.nut

@@ -1,696 +1,737 @@
-//class EditProductWindow extends Fl_Group {
 class EditProductWindow extends EditWindow {
-	db_products_id=null;
-	db_products_description_ro=null;
-	db_products_mdate=null;
-	db_products_cdate=null;
-	tabs=null;
-	tabMain=null;
-	db_products_reference_code=null;
-	db_products_supplier_code=null;
-	db_products_bar_code=null;
-	db_products_sell_description=null;
-	db_products_buy_description=null;
-	db_products_sell_price=null;
-	db_products_measure_unit_id=null;
-	db_products_sales_tax_id=null;
-	db_products_warranty_id=null;
-	db_products_sell_quantity_min=null;
-	db_products_units_by_package=null;
-	db_products_weight=null;
-	db_products_sell_without_stock=null;
-	db_products_is_active=null;
-	db_products_show_on_sales=null;
-	db_products_show_on_buys=null;
-	db_products_show_on_web=null;
-	db_products_show_price_on_web=null;
-	tabNotes=null;
-	db_products_sell_notes=null;
-	tabNotesSupplier=null;
-	db_products_buy_notes=null;
-	tabTags=null;
-	db_products_tags=null;
-	tabGroups=null;
-	btnImage=null;
-	db_products_quantity_onhand=null;
-	tabPrices=null;
-	db_products_buy_price=null;
-	db_products_buy_discount=null;
-	db_products_buy_other_costs=null;
-	db_products_sell_markup=null;
-	markup_to_discount=null;
-	db_products_sell_price_ro=null;
-	db_products_price_decimals=null;
-	btnSaveProrduct=null;
-	db_products_stock_min=null;
-	db_products_stock_max=null;
-	db_products_buy_quantity_min=null;
-	db_products_price_formula=null;
-	db_products_price_date=null;
-	productPrices=null;
-	tabKit=null;
-	tabChartStatistics=null;
-	tabHistory=null;
-	tabReports=null;
-	grpExportImport=null;
-	btnProductsExport=null;
-	btnProductsImport=null;
-	chkWithoutPrices=null;
-	chkWebOnly=null;
-	boxExportImportCount=null;
-	btnProductGroupsExport=null;
-	btnProductGroupsImport=null;
-	btnUpdateWeb=null;
-	grpPrintPriceList=null;
-	chkPriceListWithVAT=null;
-	chkPriceListSellOnWeb=null;
-	btnPrintPriceList=null;
-	chkPriceListSellSales=null;
-	chkPriceListSellPDF=null;
-	tabTotals=null;
-	db_products_quantity_quoted_sales=null;
-	db_products_quantity_ordered_sales=null;
-	db_products_quantity_delivered=null;
-	db_products_quantity_invoiced_sales=null;
-	db_products_quantity_lost=null;
-	db_products_quantity_quoted_buys=null;
-	db_products_quantity_ordered_buys=null;
-	db_products_quantity_received=null;
-	db_products_quantity_invoiced_buys=null;
-	dbAction=null;
-	btnDbAction=null;
-	db_products_group_id=null;
-	
-constructor() {
-	base.constructor(10, 50, 800, 560, _tr("Edit Products"));
-begin();
-this->box(FL_FLAT_BOX);
-this->color(FL_BACKGROUND_COLOR);
-this->selection_color(FL_BACKGROUND_COLOR);
-this->labeltype(FL_NO_LABEL);
-this->labelfont(0);
-this->labelsize(14);
-this->labelcolor(FL_FOREGROUND_COLOR);
-this->align((FL_ALIGN_TOP));
-this->when(FL_WHEN_RELEASE);
-{ db_products_id =new Fl_Output(5, 5, 96, 25);
-  db_products_id->labeltype(FL_NO_LABEL);
-  db_products_id->labelsize(16);
-  db_products_id->textsize(16);
-  add_input_field_to_map("products", "id", db_products_id);
-} // Fl_Output* db_products_id
-{ db_products_description_ro =new Fl_Output(110, 5, 545, 25);
-  db_products_description_ro->labeltype(FL_NO_LABEL);
-  db_products_description_ro->labelsize(16);
-  db_products_description_ro->textsize(16);
-} // Fl_Output* db_products_description_ro
-{ db_products_mdate =new Fl_Output(666, 5, 130, 25);
-  db_products_mdate->labeltype(FL_NO_LABEL);
-  db_products_mdate->labelsize(16);
-  db_products_mdate->textsize(16);
-  add_input_field_to_map("products", "mdate", db_products_mdate);
-} // Fl_Output* db_products_mdate
-{ db_products_cdate =new Fl_Output(665, 35, 130, 25);
-  db_products_cdate->labeltype(FL_NO_LABEL);
-  db_products_cdate->labelsize(16);
-  db_products_cdate->textsize(16);
-  add_input_field_to_map("products", "cdate", db_products_cdate);
-} // Fl_Output* db_products_cdate
-{ tabs =new Fl_Tabs(5, 35, 790, 520);
-  tabs->selection_color(4);
-  tabs->labelsize(16);
-  tabs->labelcolor(FL_BACKGROUND2_COLOR);
-  { tabMain =new Fl_Group(5, 60, 790, 495, _tr("Main"));
-    tabMain->color(246);
-    tabMain->labelsize(16);
-    { db_products_reference_code =new Fl_Input(115, 70, 165, 25, _tr("Reference"));
-      db_products_reference_code->labelsize(16);
-      db_products_reference_code->textsize(16);
-      add_input_field_to_map("products", "reference_code", db_products_reference_code);
-    } // Fl_Input* db_products_reference_code
-    { db_products_supplier_code =new Fl_Input(380, 70, 165, 25, _tr("Ref. Supp."));
-      db_products_supplier_code->labelsize(16);
-      db_products_supplier_code->textsize(16);
-      add_input_field_to_map("products", "supplier_code", db_products_supplier_code);
-    } // Fl_Input* db_products_supplier_code
-    { db_products_bar_code =new Fl_Input(620, 70, 165, 25, _tr("Barcode"));
-      db_products_bar_code->labelsize(16);
-      db_products_bar_code->textsize(16);
-      add_input_field_to_map("products", "bar_code", db_products_bar_code);
-    } // Fl_Input* db_products_bar_code
-    { db_products_sell_description =new Fl_Input(115, 100, 670, 25, _tr("Description"));
-      db_products_sell_description->labelsize(16);
-      db_products_sell_description->textsize(16);
-      add_input_field_to_map("products", "sell_description", db_products_sell_description);
-    } // Fl_Input* db_products_sell_description
-    { db_products_buy_description =new Fl_Input(115, 130, 670, 25, _tr("Desc. Supp."));
-      db_products_buy_description->labelsize(16);
-      db_products_buy_description->textsize(16);
-      add_input_field_to_map("products", "buy_description", db_products_buy_description);
-    } // Fl_Input* db_products_buy_description
-    { db_products_sell_price =new Fl_Float_Input_Fmt(115, 160, 110, 25, _tr("Sales Price"));
-      db_products_sell_price->type(1);
-      db_products_sell_price->box(FL_DOWN_BOX);
-      db_products_sell_price->color(FL_BACKGROUND2_COLOR);
-      db_products_sell_price->selection_color(FL_SELECTION_COLOR);
-      db_products_sell_price->labeltype(FL_NORMAL_LABEL);
-      db_products_sell_price->labelfont(0);
-      db_products_sell_price->labelsize(16);
-      db_products_sell_price->labelcolor(FL_FOREGROUND_COLOR);
-      db_products_sell_price->textsize(16);
-      db_products_sell_price->align((FL_ALIGN_LEFT));
-      db_products_sell_price->when(FL_WHEN_RELEASE);
-      add_input_field_to_map("products", "sell_price", db_products_sell_price);
-    } // Fl_Float_Input_Fmt* db_products_sell_price
-    { db_products_measure_unit_id =new Fl_Choice_Int(370, 160, 110, 25, _tr("Measure Unit"));
-      db_products_measure_unit_id->box(FL_FLAT_BOX);
-      db_products_measure_unit_id->down_box(FL_BORDER_BOX);
-      db_products_measure_unit_id->color(FL_BACKGROUND_COLOR);
-      db_products_measure_unit_id->selection_color(FL_SELECTION_COLOR);
-      db_products_measure_unit_id->labeltype(FL_NORMAL_LABEL);
-      db_products_measure_unit_id->labelfont(0);
-      db_products_measure_unit_id->labelsize(16);
-      db_products_measure_unit_id->labelcolor(FL_FOREGROUND_COLOR);
-      db_products_measure_unit_id->textsize(16);
-      db_products_measure_unit_id->align((FL_ALIGN_LEFT));
-      db_products_measure_unit_id->when(FL_WHEN_RELEASE);
-      add_input_field_to_map("products", "measure_unit_id", db_products_measure_unit_id);
-    } // Fl_Choice_Int* db_products_measure_unit_id
-    { db_products_sales_tax_id =new Fl_Choice_Int(115, 190, 110, 25, _tr("V.A.T."));
-      db_products_sales_tax_id->box(FL_FLAT_BOX);
-      db_products_sales_tax_id->down_box(FL_BORDER_BOX);
-      db_products_sales_tax_id->color(FL_BACKGROUND_COLOR);
-      db_products_sales_tax_id->selection_color(FL_SELECTION_COLOR);
-      db_products_sales_tax_id->labeltype(FL_NORMAL_LABEL);
-      db_products_sales_tax_id->labelfont(0);
-      db_products_sales_tax_id->labelsize(16);
-      db_products_sales_tax_id->labelcolor(FL_FOREGROUND_COLOR);
-      db_products_sales_tax_id->textsize(16);
-      db_products_sales_tax_id->align((FL_ALIGN_LEFT));
-      db_products_sales_tax_id->when(FL_WHEN_RELEASE);
-      add_input_field_to_map("products", "sales_tax_id", db_products_sales_tax_id);
-    } // Fl_Choice_Int* db_products_sales_tax_id
-    { db_products_warranty_id =new Fl_Choice_Int(370, 190, 110, 25, _tr("Warranty"));
-      db_products_warranty_id->box(FL_FLAT_BOX);
-      db_products_warranty_id->down_box(FL_BORDER_BOX);
-      db_products_warranty_id->color(FL_BACKGROUND_COLOR);
-      db_products_warranty_id->selection_color(FL_SELECTION_COLOR);
-      db_products_warranty_id->labeltype(FL_NORMAL_LABEL);
-      db_products_warranty_id->labelfont(0);
-      db_products_warranty_id->labelsize(16);
-      db_products_warranty_id->labelcolor(FL_FOREGROUND_COLOR);
-      db_products_warranty_id->textsize(16);
-      db_products_warranty_id->align((FL_ALIGN_LEFT));
-      db_products_warranty_id->when(FL_WHEN_RELEASE);
-      add_input_field_to_map("products", "warranty_id", db_products_warranty_id);
-    } // Fl_Choice_Int* db_products_warranty_id
-    { local o = db_products_sell_quantity_min =new Fl_Float_Input(370, 250, 110, 25, _tr("Sell Min. Qty."));
-      db_products_sell_quantity_min->type(1);
-      db_products_sell_quantity_min->labelsize(16);
-      db_products_sell_quantity_min->textsize(16);
-      o->decimal_places(-6);
-      add_input_field_to_map("products", "sell_quantity_min", db_products_sell_quantity_min);
-    } // Fl_Float_Input* db_products_sell_quantity_min
-    { local o = db_products_units_by_package =new Fl_Float_Input(370, 280, 110, 25, _tr("Units by Pack."));
-      db_products_units_by_package->type(1);
-      db_products_units_by_package->labelsize(16);
-      db_products_units_by_package->textsize(16);
-      o->decimal_places(-6);
-      add_input_field_to_map("products", "units_by_package", db_products_units_by_package);
-    } // Fl_Float_Input* db_products_units_by_package
-    { local o = db_products_weight =new Fl_Float_Input(370, 220, 110, 25, _tr("Weight"));
-      db_products_weight->type(1);
-      db_products_weight->labelsize(16);
-      db_products_weight->textsize(16);
-      o->decimal_places(-6);
-      add_input_field_to_map("products", "weight", db_products_weight);
-    } // Fl_Float_Input* db_products_weight
-    { db_products_sell_without_stock =new Fl_Check_Button(10, 250, 215, 25, _tr("Sell without stock"));
-      db_products_sell_without_stock->down_box(FL_DOWN_BOX);
-      db_products_sell_without_stock->labelsize(16);
-      add_input_field_to_map("products", "sell_without_stock", db_products_sell_without_stock);
-    } // Fl_Check_Button* db_products_sell_without_stock
-    { db_products_is_active =new Fl_Check_Button(10, 280, 110, 25, _tr("Active"));
-      db_products_is_active->down_box(FL_DOWN_BOX);
-      db_products_is_active->labelsize(16);
-      add_input_field_to_map("products", "is_active", db_products_is_active);
-    } // Fl_Check_Button* db_products_is_active
-    { db_products_show_on_sales =new Fl_Check_Button(10, 310, 105, 25, _tr("Sales"));
-      db_products_show_on_sales->down_box(FL_DOWN_BOX);
-      db_products_show_on_sales->labelsize(16);
-      add_input_field_to_map("products", "show_on_sales", db_products_show_on_sales);
-    } // Fl_Check_Button* db_products_show_on_sales
-    { db_products_show_on_buys =new Fl_Check_Button(10, 340, 95, 25, _tr("Buys"));
-      db_products_show_on_buys->down_box(FL_DOWN_BOX);
-      db_products_show_on_buys->labelsize(16);
-      add_input_field_to_map("products", "show_on_buys", db_products_show_on_buys);
-    } // Fl_Check_Button* db_products_show_on_buys
-    { db_products_show_on_web =new Fl_Check_Button(115, 310, 120, 25, _tr("Web"));
-      db_products_show_on_web->down_box(FL_DOWN_BOX);
-      db_products_show_on_web->labelsize(16);
-      add_input_field_to_map("products", "show_on_web", db_products_show_on_web);
-    } // Fl_Check_Button* db_products_show_on_web
-    { db_products_show_price_on_web =new Fl_Check_Button(115, 340, 100, 25, _tr("Web price"));
-      db_products_show_price_on_web->down_box(FL_DOWN_BOX);
-      db_products_show_price_on_web->labelsize(16);
-      add_input_field_to_map("products", "show_price_on_web", db_products_show_price_on_web);
-    } // Fl_Check_Button* db_products_show_price_on_web
-    { local o =new Fl_Group(675, 402, 110, 143);
-      { local o =new Fl_Box(675, 402, 110, 68, _tr("Spacer"));
-        o->labeltype(FL_NO_LABEL);
-        Fl_Group.current()->resizable(o);
-      } // Fl_Box* o
-      { dbAction = new Fl_Choice_dbAction(675, 520, 110, 25);
-        dbAction->label(_tr("Action"));
-        dbAction->down_box(FL_BORDER_BOX);
-        dbAction->labelsize(16);
-        dbAction->textsize(16);
-        dbAction->align((FL_ALIGN_TOP));
-      } // Fl_Choice* dbAction
-      { btnDbAction = new My_Fl_Return_Button(675, 470, 110, 25, _tr("Action"));
-        btnDbAction->labelsize(16);
-      } // Fl_Button* btnDbAction
-      o->end();
-    } // Fl_Group* o
-    { local o =new Fl_Tabs(10, 370, 650, 181);
-      o->selection_color(4);
-      o->labelsize(16);
-      o->labelcolor(FL_BACKGROUND2_COLOR);
-      { tabNotes =new Fl_Group(10, 400, 650, 150, _tr("Notes"));
-        tabNotes->labelsize(16);
-        { db_products_sell_notes =new Fl_Text_Editor_Buffered(10, 400, 650, 150);
-          db_products_sell_notes->type(4);
-          db_products_sell_notes->box(FL_DOWN_BOX);
-          db_products_sell_notes->color(FL_BACKGROUND2_COLOR);
-          db_products_sell_notes->selection_color(FL_SELECTION_COLOR);
-          db_products_sell_notes->labeltype(FL_NO_LABEL);
-          db_products_sell_notes->labelfont(0);
-          db_products_sell_notes->labelsize(16);
-          db_products_sell_notes->labelcolor(FL_FOREGROUND_COLOR);
-          db_products_sell_notes->textsize(16);
-          db_products_sell_notes->align((FL_ALIGN_TOP_LEFT));
-          db_products_sell_notes->when(FL_WHEN_RELEASE);
-          Fl_Group.current()->resizable(db_products_sell_notes);
-          add_input_field_to_map("products", "sell_notes", db_products_sell_notes);
-        } // Fl_Text_Editor_Buffered* db_products_sell_notes
-        tabNotes->end();
-      } // Fl_Group* tabNotes
-      { tabNotesSupplier =new Fl_Group(10, 400, 650, 150, _tr("Notes Supplier"));
-        tabNotesSupplier->labelsize(16);
-        tabNotesSupplier->hide();
-        { db_products_buy_notes =new Fl_Text_Editor_Buffered(10, 400, 650, 150);
-          db_products_buy_notes->type(4);
-          db_products_buy_notes->box(FL_DOWN_BOX);
-          db_products_buy_notes->color(FL_BACKGROUND2_COLOR);
-          db_products_buy_notes->selection_color(FL_SELECTION_COLOR);
-          db_products_buy_notes->labeltype(FL_NO_LABEL);
-          db_products_buy_notes->labelfont(0);
-          db_products_buy_notes->labelsize(16);
-          db_products_buy_notes->labelcolor(FL_FOREGROUND_COLOR);
-          db_products_buy_notes->textsize(16);
-          db_products_buy_notes->align((FL_ALIGN_TOP_LEFT));
-          db_products_buy_notes->when(FL_WHEN_RELEASE);
-          Fl_Group.current()->resizable(db_products_buy_notes);
-          add_input_field_to_map("products", "buy_notes", db_products_buy_notes);
-        } // Fl_Text_Editor_Buffered* db_products_buy_notes
-        tabNotesSupplier->end();
-      } // Fl_Group* tabNotesSupplier
-      { tabTags =new Fl_Group(10, 400, 650, 150, _tr("Tags"));
-        tabTags->labelsize(16);
-        tabTags->hide();
-        { db_products_tags =new Fl_Text_Editor_Buffered(10, 400, 650, 150);
-          db_products_tags->type(4);
-          db_products_tags->box(FL_DOWN_BOX);
-          db_products_tags->color(FL_BACKGROUND2_COLOR);
-          db_products_tags->selection_color(FL_SELECTION_COLOR);
-          db_products_tags->labeltype(FL_NO_LABEL);
-          db_products_tags->labelfont(0);
-          db_products_tags->labelsize(16);
-          db_products_tags->labelcolor(FL_FOREGROUND_COLOR);
-          db_products_tags->textsize(16);
-          db_products_tags->align((FL_ALIGN_TOP_LEFT));
-          db_products_tags->when(FL_WHEN_RELEASE);
-          Fl_Group.current()->resizable(db_products_tags);
-          add_input_field_to_map("products", "tags", db_products_tags);
-        } // Fl_Text_Editor_Buffered* db_products_tags
-        tabTags->end();
-      } // Fl_Group* tabTags
-      { tabGroups =new Fl_Group(10, 395, 650, 156, _tr("Groups"));
-        tabGroups->hide();
-        { db_products_group_id = new Flu_Tree_Browser(10, 400, 650, 150);
-          db_products_group_id->box(FL_DOWN_BOX);
-          db_products_group_id->color(FL_BACKGROUND2_COLOR);
-          db_products_group_id->selection_color(FL_SELECTION_COLOR);
-          db_products_group_id->labeltype(FL_NORMAL_LABEL);
-          db_products_group_id->labelfont(0);
-          db_products_group_id->labelsize(16);
-          db_products_group_id->labelcolor(FL_FOREGROUND_COLOR);
-          db_products_group_id->align((FL_ALIGN_TOP));
-          db_products_group_id->when(FL_WHEN_CHANGED);
-          add_input_field_to_map("products", "group_id", db_products_group_id);
-        } // Flu_Tree_Browser* db_products_group_id
-        tabGroups->end();
-      } // Fl_Group* tabGroups
-      o->end();
-    } // Fl_Tabs* o
-    { btnImage =new Fl_Image_Box(485, 158, 300, 232);
-      btnImage->box(FL_ENGRAVED_BOX);
-      btnImage->color(FL_BACKGROUND2_COLOR);
-      btnImage->selection_color(FL_BACKGROUND_COLOR);
-      btnImage->labeltype(FL_NORMAL_LABEL);
-      btnImage->labelfont(0);
-      btnImage->labelsize(14);
-      btnImage->labelcolor(FL_FOREGROUND_COLOR);
-      btnImage->align((FL_ALIGN_CLIP|FL_ALIGN_INSIDE));
-      btnImage->when(FL_WHEN_RELEASE);
-    } // Fl_Image_Box* btnImage
-    { local o =new Fl_Check_Button(370, 375, 102, 25, _tr("Wrap lines"));
-      o->down_box(FL_DOWN_BOX);
-      o->value(1);
-      o->labelsize(16);
-      o->callback(cb_Wrap);
-    } // Fl_Check_Button* o
-    { local o = db_products_quantity_onhand =new Fl_Float_Input(115, 220, 110, 25, _tr("Onhand"));
-      db_products_quantity_onhand->type(1);
-      db_products_quantity_onhand->labelsize(16);
-      db_products_quantity_onhand->textsize(16);
-      o->decimal_places(-6);
-      add_input_field_to_map("products", "quantity_onhand", db_products_quantity_onhand);
-    } // Fl_Float_Input* db_products_quantity_onhand
-    tabMain->end();
-    Fl_Group.current()->resizable(tabMain);
-  } // Fl_Group* tabMain
-  { tabPrices =new Fl_Group(5, 60, 790, 495, _tr("Prices"));
-    tabPrices->color(246);
-    tabPrices->labelsize(16);
-    tabPrices->hide();
-    { local o =new Fl_Group(15, 88, 770, 201, _tr("Sales Price"));
-      o->box(FL_UP_BOX);
-      o->color(166);
-      o->labelsize(16);
-      { db_products_buy_price =new Fl_Float_Input_Fmt(25, 115, 115, 25, _tr("Buy $"));
-        db_products_buy_price->type(1);
-        db_products_buy_price->box(FL_DOWN_BOX);
-        db_products_buy_price->color(FL_BACKGROUND2_COLOR);
-        db_products_buy_price->selection_color(FL_SELECTION_COLOR);
-        db_products_buy_price->labeltype(FL_NORMAL_LABEL);
-        db_products_buy_price->labelfont(0);
-        db_products_buy_price->labelsize(16);
-        db_products_buy_price->labelcolor(FL_FOREGROUND_COLOR);
-        db_products_buy_price->textsize(16);
-        db_products_buy_price->align((FL_ALIGN_TOP_LEFT));
-        db_products_buy_price->when(FL_WHEN_RELEASE);
-        add_input_field_to_map("products", "buy_price", db_products_buy_price);
-      } // Fl_Float_Input_Fmt* db_products_buy_price
-      { local o = db_products_buy_discount =new Fl_Float_Input_Fmt(151, 115, 115, 25, _tr("Buy Disc. %"));
-        db_products_buy_discount->type(1);
-        db_products_buy_discount->box(FL_DOWN_BOX);
-        db_products_buy_discount->color(FL_BACKGROUND2_COLOR);
-        db_products_buy_discount->selection_color(FL_SELECTION_COLOR);
-        db_products_buy_discount->labeltype(FL_NORMAL_LABEL);
-        db_products_buy_discount->labelfont(0);
-        db_products_buy_discount->labelsize(16);
-        db_products_buy_discount->labelcolor(FL_FOREGROUND_COLOR);
-        db_products_buy_discount->textsize(16);
-        db_products_buy_discount->align((FL_ALIGN_TOP_LEFT));
-        db_products_buy_discount->when(FL_WHEN_RELEASE);
-        add_input_field_to_map("products", "buy_discount", db_products_buy_discount);
-        o->decimal_places(-6);
-      } // Fl_Float_Input_Fmt* db_products_buy_discount
-      { db_products_buy_other_costs =new Fl_Float_Input_Fmt(278, 115, 115, 25, _tr("Other Costs $"));
-        db_products_buy_other_costs->type(1);
-        db_products_buy_other_costs->box(FL_DOWN_BOX);
-        db_products_buy_other_costs->color(FL_BACKGROUND2_COLOR);
-        db_products_buy_other_costs->selection_color(FL_SELECTION_COLOR);
-        db_products_buy_other_costs->labeltype(FL_NORMAL_LABEL);
-        db_products_buy_other_costs->labelfont(0);
-        db_products_buy_other_costs->labelsize(16);
-        db_products_buy_other_costs->labelcolor(FL_FOREGROUND_COLOR);
-        db_products_buy_other_costs->textsize(16);
-        db_products_buy_other_costs->align((FL_ALIGN_TOP_LEFT));
-        db_products_buy_other_costs->when(FL_WHEN_RELEASE);
-        add_input_field_to_map("products", "buy_other_costs", db_products_buy_other_costs);
-      } // Fl_Float_Input_Fmt* db_products_buy_other_costs
-      { local o = db_products_sell_markup =new Fl_Float_Input_Fmt(404, 115, 115, 25, _tr("Markup %"));
-        db_products_sell_markup->type(1);
-        db_products_sell_markup->box(FL_DOWN_BOX);
-        db_products_sell_markup->color(FL_BACKGROUND2_COLOR);
-        db_products_sell_markup->selection_color(FL_SELECTION_COLOR);
-        db_products_sell_markup->labeltype(FL_NORMAL_LABEL);
-        db_products_sell_markup->labelfont(0);
-        db_products_sell_markup->labelsize(16);
-        db_products_sell_markup->labelcolor(FL_FOREGROUND_COLOR);
-        db_products_sell_markup->textsize(16);
-        db_products_sell_markup->align((FL_ALIGN_TOP_LEFT));
-        db_products_sell_markup->when(FL_WHEN_RELEASE);
-        add_input_field_to_map("products", "sell_markup", db_products_sell_markup);
-        //o->decimal_places(-6);
-      } // Fl_Float_Input_Fmt* db_products_sell_markup
-      { local o = markup_to_discount =new Fl_Float_Input_Fmt(531, 115, 115, 25, _tr("Margin %"));
-        markup_to_discount->type(1);
-        markup_to_discount->box(FL_DOWN_BOX);
-        markup_to_discount->color(FL_BACKGROUND2_COLOR);
-        markup_to_discount->selection_color(FL_SELECTION_COLOR);
-        markup_to_discount->labeltype(FL_NORMAL_LABEL);
-        markup_to_discount->labelfont(0);
-        markup_to_discount->labelsize(16);
-        markup_to_discount->labelcolor(FL_FOREGROUND_COLOR);
-        markup_to_discount->textsize(16);
-        markup_to_discount->align((FL_ALIGN_TOP_LEFT));
-        markup_to_discount->when(FL_WHEN_RELEASE);
-        //o->decimal_places(-6);
-      } // Fl_Float_Input_Fmt* markup_to_discount
-      { db_products_sell_price_ro =new Fl_Float_Input_Fmt(658, 115, 115, 25, _tr("Sales $"));
-        db_products_sell_price_ro->type(1);
-        db_products_sell_price_ro->box(FL_DOWN_BOX);
-        db_products_sell_price_ro->color(FL_BACKGROUND2_COLOR);
-        db_products_sell_price_ro->selection_color(FL_SELECTION_COLOR);
-        db_products_sell_price_ro->labeltype(FL_NORMAL_LABEL);
-        db_products_sell_price_ro->labelfont(0);
-        db_products_sell_price_ro->labelsize(16);
-        db_products_sell_price_ro->labelcolor(FL_FOREGROUND_COLOR);
-        db_products_sell_price_ro->textsize(16);
-        db_products_sell_price_ro->align((FL_ALIGN_TOP_LEFT));
-        db_products_sell_price_ro->when(FL_WHEN_RELEASE);
-      } // Fl_Float_Input_Fmt* db_products_sell_price_ro
-      { local o = db_products_price_decimals =new Fl_Int_Input(530, 150, 30, 25, _tr("Decimals for calculation"));
-        db_products_price_decimals->type(2);
-        db_products_price_decimals->labelfont(1);
-        db_products_price_decimals->labelsize(16);
-        db_products_price_decimals->textfont(1);
-        db_products_price_decimals->textsize(16);
-        add_input_field_to_map("products", "price_decimals", db_products_price_decimals);
-        //o->decimal_places(-6);
-      } // Fl_Int_Input* db_products_price_decimals
-      { btnSaveProrduct =new Fl_Button(662, 150, 111, 25, _tr("Save"));
-        btnSaveProrduct->labelsize(16);
-      } // Fl_Button* btnSaveProrduct
-      { local o = db_products_stock_min =new Fl_Float_Input(665, 195, 110, 25, _tr("Stock Min."));
-        db_products_stock_min->type(1);
-        db_products_stock_min->labelsize(16);
-        db_products_stock_min->textsize(16);
-        add_input_field_to_map("products", "stock_min", db_products_stock_min);
-        o->decimal_places(-6);
-      } // Fl_Float_Input* db_products_stock_min
-      { local o = db_products_stock_max =new Fl_Float_Input(665, 225, 110, 25, _tr("Stock Max."));
-        db_products_stock_max->type(1);
-        db_products_stock_max->labelsize(16);
-        db_products_stock_max->textsize(16);
-        add_input_field_to_map("products", "stock_max", db_products_stock_max);
-        o->decimal_places(-6);
-      } // Fl_Float_Input* db_products_stock_max
-      { local o = db_products_buy_quantity_min =new Fl_Float_Input(665, 255, 110, 25, _tr("Buy Min. Qty."));
-        db_products_buy_quantity_min->type(1);
-        db_products_buy_quantity_min->labelsize(16);
-        db_products_buy_quantity_min->textsize(16);
-        add_input_field_to_map("products", "buy_quantity_min", db_products_buy_quantity_min);
-        o->decimal_places(-6);
-      } // Fl_Float_Input* db_products_buy_quantity_min
-      { db_products_price_formula =new Fl_Input(25, 197, 495, 83, _tr("Price formula"));
-        db_products_price_formula->type(4);
-        db_products_price_formula->labelsize(16);
-        db_products_price_formula->textsize(16);
-        db_products_price_formula->align((FL_ALIGN_TOP_LEFT));
-        add_input_field_to_map("products", "price_formula", db_products_price_formula);
-      } // Fl_Input* db_products_price_formula
-      { db_products_price_date =new Fl_Output(25, 150, 130, 25, _tr("Last Update"));
-        db_products_price_date->labelsize(16);
-        db_products_price_date->textsize(16);
-        db_products_price_date->align((FL_ALIGN_RIGHT));
-      } // Fl_Output* db_products_price_date
-      o->end();
-    } // Fl_Group* o
-    { local o =new Fl_Box(15, 290, 770, 40, _tr("Spacer"));
-      o->labeltype(FL_NO_LABEL);
-      Fl_Group.current()->resizable(o);
-    } // Fl_Box* o
-    { productPrices =new Fl_Group(15, 332, 770, 212);
-      productPrices->box(FL_UP_BOX);
-      productPrices->color(166);
-      productPrices->labeltype(FL_NO_LABEL);
-      productPrices->labelsize(16);
-      productPrices->end();
-    } // Fl_Group* productPrices
-    tabPrices->end();
-  } // Fl_Group* tabPrices
-  { tabKit =new Fl_Group(5, 59, 790, 495, _tr("Kit"));
-    tabKit->color(246);
-    tabKit->labelsize(16);
-    tabKit->hide();
-    tabKit->end();
-  } // Fl_Group* tabKit
-  { tabChartStatistics =new Fl_Group(5, 60, 790, 495, _tr("Statistics"));
-    tabChartStatistics->color(246);
-    tabChartStatistics->labelsize(16);
-    tabChartStatistics->hide();
-    tabChartStatistics->end();
-  } // Fl_Group* tabChartStatistics
-  { tabHistory =new Fl_Group(5, 60, 790, 495, _tr("History"));
-    tabHistory->color(246);
-    tabHistory->labelsize(16);
-    tabHistory->hide();
-    tabHistory->end();
-  } // Fl_Group* tabHistory
-  { tabReports =new Fl_Group(5, 60, 790, 495, _tr("Reports"));
-    tabReports->box(FL_UP_BOX);
-    tabReports->color(246);
-    tabReports->labelsize(16);
-    tabReports->hide();
-    { grpExportImport =new Fl_Group(15, 465, 770, 80, _tr("Export / Import"));
-      grpExportImport->box(FL_ENGRAVED_FRAME);
-      grpExportImport->labelsize(16);
-      { btnProductsExport =new Fl_Button(25, 475, 175, 25, _tr("Products Export"));
-        btnProductsExport->labelsize(16);
-      } // Fl_Button* btnProductsExport
-      { btnProductsImport =new Fl_Button(25, 510, 175, 25, _tr("Products Import"));
-        btnProductsImport->labelsize(16);
-      } // Fl_Button* btnProductsImport
-      { chkWithoutPrices =new Fl_Check_Button(225, 480, 150, 25, _tr("Withouth Prices"));
-        chkWithoutPrices->down_box(FL_DOWN_BOX);
-        chkWithoutPrices->labelsize(16);
-      } // Fl_Check_Button* chkWithoutPrices
-      { chkWebOnly =new Fl_Check_Button(225, 510, 150, 25, _tr("WEB Only"));
-        chkWebOnly->down_box(FL_DOWN_BOX);
-        chkWebOnly->labelsize(16);
-      } // Fl_Check_Button* chkWebOnly
-      { boxExportImportCount =new Fl_Box(405, 499, 42, 25, _tr("0"));
-        boxExportImportCount->labelsize(16);
-      } // Fl_Box* boxExportImportCount
-      { btnProductGroupsExport =new Fl_Button(555, 475, 220, 25, _tr("Product Groups Export"));
-        btnProductGroupsExport->labelsize(16);
-      } // Fl_Button* btnProductGroupsExport
-      { btnProductGroupsImport =new Fl_Button(555, 510, 220, 25, _tr("Product Groups import"));
-        btnProductGroupsImport->labelsize(16);
-      } // Fl_Button* btnProductGroupsImport
-      grpExportImport->end();
-    } // Fl_Group* grpExportImport
-    { btnUpdateWeb =new Fl_Button(610, 70, 175, 25, _tr("Update WEB"));
-      btnUpdateWeb->labelsize(16);
-    } // Fl_Button* btnUpdateWeb
-    { grpPrintPriceList =new Fl_Group(10, 85, 195, 165, _tr("Price List"));
-      grpPrintPriceList->box(FL_ENGRAVED_FRAME);
-      grpPrintPriceList->labelsize(16);
-      { chkPriceListWithVAT =new Fl_Check_Button(20, 95, 175, 25, _tr("With V.A.T."));
-        chkPriceListWithVAT->down_box(FL_DOWN_BOX);
-        chkPriceListWithVAT->labelsize(16);
-      } // Fl_Check_Button* chkPriceListWithVAT
-      { chkPriceListSellOnWeb =new Fl_Check_Button(20, 125, 170, 25, _tr("Sell on WEB"));
-        chkPriceListSellOnWeb->down_box(FL_DOWN_BOX);
-        chkPriceListSellOnWeb->labelsize(16);
-      } // Fl_Check_Button* chkPriceListSellOnWeb
-      { btnPrintPriceList =new Fl_Button(20, 215, 175, 25, _tr("Print"));
-        btnPrintPriceList->labelsize(16);
-      } // Fl_Button* btnPrintPriceList
-      { chkPriceListSellSales =new Fl_Check_Button(20, 155, 175, 25, _tr("Sales"));
-        chkPriceListSellSales->down_box(FL_DOWN_BOX);
-        chkPriceListSellSales->labelsize(16);
-      } // Fl_Check_Button* chkPriceListSellSales
-      { chkPriceListSellPDF =new Fl_Check_Button(20, 185, 175, 25, _tr("PDF"));
-        chkPriceListSellPDF->down_box(FL_DOWN_BOX);
-        chkPriceListSellPDF->labelsize(16);
-      } // Fl_Check_Button* chkPriceListSellPDF
-      grpPrintPriceList->end();
-    } // Fl_Group* grpPrintPriceList
-    tabReports->end();
-  } // Fl_Group* tabReports
-  { tabTotals =new Fl_Group(5, 60, 790, 495, _tr("Totals"));
-    tabTotals->color(246);
-    tabTotals->labelsize(16);
-    tabTotals->hide();
-    { local o = db_products_quantity_quoted_sales =new Fl_Float_Input(220, 80, 110, 25, _tr("Quantity quoted sales"));
-      db_products_quantity_quoted_sales->type(1);
-      db_products_quantity_quoted_sales->labelsize(16);
-      db_products_quantity_quoted_sales->textsize(16);
-      o->decimal_places(-6);
-      add_input_field_to_map("products", "quantity_quoted_sales", db_products_quantity_quoted_sales);
-    } // Fl_Float_Input* db_products_quantity_quoted_sales
-    { local o = db_products_quantity_ordered_sales =new Fl_Float_Input(220, 115, 110, 25, _tr("Quantity ordered sales"));
-      db_products_quantity_ordered_sales->type(1);
-      db_products_quantity_ordered_sales->labelsize(16);
-      db_products_quantity_ordered_sales->textsize(16);
-      o->decimal_places(-6);
-      add_input_field_to_map("products", "quantity_ordered_sales", db_products_quantity_ordered_sales);
-    } // Fl_Float_Input* db_products_quantity_ordered_sales
-    { local o = db_products_quantity_delivered =new Fl_Float_Input(220, 150, 110, 25, _tr("Quantity delivered"));
-      db_products_quantity_delivered->type(1);
-      db_products_quantity_delivered->labelsize(16);
-      db_products_quantity_delivered->textsize(16);
-      o->decimal_places(-6);
-      add_input_field_to_map("products", "quantity_delivered", db_products_quantity_delivered);
-    } // Fl_Float_Input* db_products_quantity_delivered
-    { local o = db_products_quantity_invoiced_sales =new Fl_Float_Input(220, 185, 110, 25, _tr("Quantity invoiced sales"));
-      db_products_quantity_invoiced_sales->type(1);
-      db_products_quantity_invoiced_sales->labelsize(16);
-      db_products_quantity_invoiced_sales->textsize(16);
-      o->decimal_places(-6);
-      add_input_field_to_map("products", "quantity_invoiced_sales", db_products_quantity_invoiced_sales);
-    } // Fl_Float_Input* db_products_quantity_invoiced_sales
-    { local o = db_products_quantity_lost =new Fl_Float_Input(220, 220, 110, 25, _tr("Quantity lost"));
-      db_products_quantity_lost->type(1);
-      db_products_quantity_lost->labelsize(16);
-      db_products_quantity_lost->textsize(16);
-      o->decimal_places(-6);
-      add_input_field_to_map("products", "quantity_lost", db_products_quantity_lost);
-    } // Fl_Float_Input* db_products_quantity_lost
-    { local o = db_products_quantity_quoted_buys =new Fl_Float_Input(665, 85, 110, 25, _tr("Quantity quoted buys"));
-      db_products_quantity_quoted_buys->type(1);
-      db_products_quantity_quoted_buys->labelsize(16);
-      db_products_quantity_quoted_buys->textsize(16);
-      o->decimal_places(-6);
-      add_input_field_to_map("products", "quantity_quoted_buys", db_products_quantity_quoted_buys);
-    } // Fl_Float_Input* db_products_quantity_quoted_buys
-    { local o = db_products_quantity_ordered_buys =new Fl_Float_Input(665, 120, 110, 25, _tr("Quantity ordered buys"));
-      db_products_quantity_ordered_buys->type(1);
-      db_products_quantity_ordered_buys->labelsize(16);
-      db_products_quantity_ordered_buys->textsize(16);
-      o->decimal_places(-6);
-      add_input_field_to_map("products", "quantity_ordered_buys", db_products_quantity_ordered_buys);
-    } // Fl_Float_Input* db_products_quantity_ordered_buys
-    { local o = db_products_quantity_received =new Fl_Float_Input(665, 155, 110, 25, _tr("Quantity received"));
-      db_products_quantity_received->type(1);
-      db_products_quantity_received->labelsize(16);
-      db_products_quantity_received->textsize(16);
-      o->decimal_places(-6);
-      add_input_field_to_map("products", "quantity_received", db_products_quantity_received);
-    } // Fl_Float_Input* db_products_quantity_received
-    { local o = db_products_quantity_invoiced_buys =new Fl_Float_Input(665, 190, 110, 25, _tr("Quantity invoiced buys"));
-      db_products_quantity_invoiced_buys->type(1);
-      db_products_quantity_invoiced_buys->labelsize(16);
-      db_products_quantity_invoiced_buys->textsize(16);
-      o->decimal_places(-6);
-      add_input_field_to_map("products", "quantity_invoiced_buys", db_products_quantity_invoiced_buys);
-    } // Fl_Float_Input* db_products_quantity_invoiced_buys
-    tabTotals->end();
-  } // Fl_Group* tabTotals
-  tabs->end();
-  Fl_Group.current()->resizable(tabs);
-} // Fl_Tabs* tabs
-end();
-}
 
-function cb_Wrap(){}
-function cb_btnSearch(){}
-function cb_btnSelect(){}
-function cb_btnUpdate(){}
-function cb_btnInsert(){}
+  // Declaration of class members
+  db_products_id = null;
+  db_products_description_ro = null;
+  db_products_mdate = null;
+  db_products_cdate = null;
+  tabs = null;
+  tabMain = null;
+  db_products_reference_code = null;
+  db_products_supplier_code = null;
+  db_products_bar_code = null;
+  db_products_sell_description = null;
+  db_products_buy_description = null;
+  db_products_sell_price = null;
+  db_products_measure_unit_id = null;
+  db_products_sales_tax_id = null;
+  db_products_warranty_id = null;
+  db_products_sell_quantity_min = null;
+  db_products_units_by_package = null;
+  db_products_weight = null;
+  db_products_sell_without_stock = null;
+  db_products_is_active = null;
+  db_products_show_on_sales = null;
+  db_products_show_on_buys = null;
+  db_products_show_on_web = null;
+  db_products_show_price_on_web = null;
+  dbAction = null;
+  btnDbAction = null;
+  tabsMoreData = null;
+  tabNotes = null;
+  db_products_sell_notes = null;
+  tabNotesSupplier = null;
+  db_products_buy_notes = null;
+  tabTags = null;
+  db_products_tags = null;
+  tabGroups = null;
+  db_products_group_id = null;
+  btnImage = null;
+  db_products_quantity_onhand = null;
+  tabPrices = null;
+  db_products_buy_price = null;
+  db_products_buy_discount = null;
+  db_products_buy_other_costs = null;
+  db_products_sell_markup = null;
+  markup_to_discount = null;
+  db_products_sell_price_ro = null;
+  db_products_price_decimals = null;
+  btnSaveProrduct = null;
+  db_products_stock_min = null;
+  db_products_stock_max = null;
+  db_products_buy_quantity_min = null;
+  db_products_price_formula = null;
+  db_products_price_date = null;
+  productPrices = null;
+  tabKit = null;
+  tabChartStatistics = null;
+  tabHistory = null;
+  tabReports = null;
+  grpExportImport = null;
+  btnProductsExport = null;
+  btnProductsImport = null;
+  chkWithoutPrices = null;
+  chkWebOnly = null;
+  boxExportImportCount = null;
+  btnProductGroupsExport = null;
+  btnProductGroupsImport = null;
+  btnUpdateWeb = null;
+  grpPrintPriceList = null;
+  chkPriceListWithVAT = null;
+  chkPriceListSellOnWeb = null;
+  btnPrintPriceList = null;
+  chkPriceListSellSales = null;
+  chkPriceListSellPDF = null;
+  tabTotals = null;
+  db_products_quantity_quoted_sales = null;
+  db_products_quantity_ordered_sales = null;
+  db_products_quantity_delivered = null;
+  db_products_quantity_invoiced_sales = null;
+  db_products_quantity_lost = null;
+  db_products_quantity_quoted_buys = null;
+  db_products_quantity_ordered_buys = null;
+  db_products_quantity_received = null;
+  db_products_quantity_invoiced_buys = null;
+  
+  constructor(px=34, py=28, pw=800, ph=560, pl=_tr("Edit Products")){
+    base.constructor(px, py, pw, ph, pl);
+    // Create member functions and widgets
+    {
+      local o = Fl_Output(5, 5, 96, 25);
+      db_products_id = o;
+      o.textsize(16);
+      o.labelsize(16);
+      o.labeltype(FL_NO_LABEL);
+      add_input_field_to_map("products", "id", db_products_id);
+    }
+    {
+      local o = Fl_Output(110, 5, 545, 25);
+      db_products_description_ro = o;
+      o.textsize(16);
+      o.labeltype(FL_NO_LABEL);
+      o.labelsize(16);
+    }
+    {
+      local o = Fl_Output(666, 5, 130, 25);
+      db_products_mdate = o;
+      o.textsize(16);
+      o.labelsize(16);
+      o.labeltype(FL_NO_LABEL);
+      add_input_field_to_map("products", "mdate", db_products_mdate);
+    }
+    {
+      local o = Fl_Output(665, 35, 130, 25);
+      db_products_cdate = o;
+      o.textsize(16);
+      o.labeltype(FL_NO_LABEL);
+      o.labelsize(16);
+      add_input_field_to_map("products", "cdate", db_products_cdate);
+    }
+    {
+      local o = Fl_Tabs(5, 35, 790, 520);
+      tabs = o;
+      o.labelcolor(7);
+      o.selection_color(4);
+      o.labelsize(16);
+      {
+        {
+          local o = Fl_Group(5, 60, 790, 495, _tr("Main"));
+          tabMain = o;
+          o.labelsize(16);
+          o.color(246);
+          {
+            {
+              local o = Fl_Input(115, 70, 165, 25, _tr("Reference"));
+              db_products_reference_code = o;
+              o.textsize(16);
+              o.labelsize(16);
+              add_input_field_to_map("products", "reference_code", db_products_reference_code);
+            }
+            {
+              local o = Fl_Input(380, 70, 165, 25, _tr("Ref. Supp."));
+              db_products_supplier_code = o;
+              o.textsize(16);
+              o.labelsize(16);
+              add_input_field_to_map("products", "supplier_code", db_products_supplier_code);
+            }
+            {
+              local o = Fl_Input(620, 70, 165, 25, _tr("Barcode"));
+              db_products_bar_code = o;
+              o.textsize(16);
+              o.labelsize(16);
+              add_input_field_to_map("products", "bar_code", db_products_bar_code);
+            }
+            {
+              local o = Fl_Input(115, 100, 670, 25, _tr("Description"));
+              db_products_sell_description = o;
+              o.textsize(16);
+              o.labelsize(16);
+              add_input_field_to_map("products", "sell_description", db_products_sell_description);
+            }
+            {
+              local o = Fl_Input(115, 130, 670, 25, _tr("Desc. Supp."));
+              db_products_buy_description = o;
+              o.textsize(16);
+              o.labelsize(16);
+              add_input_field_to_map("products", "buy_description", db_products_buy_description);
+            }
+            {
+              local o = Fl_Float_Input_Fmt(115, 160, 110, 25, _tr("Sales Price"));
+              db_products_sell_price = o;
+              o.textsize(16);
+              o.labelsize(16);
+              add_input_field_to_map("products", "sell_price", db_products_sell_price);
+            }
+            {
+              local o = Fl_Choice_Int(370, 160, 110, 25, _tr("Measure Unit"));
+              db_products_measure_unit_id = o;
+              o.textsize(16);
+              o.down_box(FL_BORDER_BOX);
+              o.labelsize(16);
+              add_input_field_to_map("products", "measure_unit_id", db_products_measure_unit_id);
+            }
+            {
+              local o = Fl_Choice_Int(115, 190, 110, 25, _tr("V.A.T."));
+              db_products_sales_tax_id = o;
+              o.textsize(16);
+              o.down_box(FL_BORDER_BOX);
+              o.labelsize(16);
+              add_input_field_to_map("products", "sales_tax_id", db_products_sales_tax_id);
+            }
+            {
+              local o = Fl_Choice_Int(370, 190, 110, 25, _tr("Warranty"));
+              db_products_warranty_id = o;
+              o.textsize(16);
+              o.down_box(FL_BORDER_BOX);
+              o.labelsize(16);
+              add_input_field_to_map("products", "warranty_id", db_products_warranty_id);
+            }
+            {
+              local o = Fl_Float_Input(370, 250, 110, 25, _tr("Sell Min. Qty."));
+              db_products_sell_quantity_min = o;
+              o.textsize(16);
+              o.labelsize(16);
+              o->decimal_places(-6);
+              add_input_field_to_map("products", "sell_quantity_min", db_products_sell_quantity_min);
+            }
+            {
+              local o = Fl_Float_Input(370, 280, 110, 25, _tr("Units by Pack."));
+              db_products_units_by_package = o;
+              o.textsize(16);
+              o.labelsize(16);
+              o->decimal_places(-6);
+              add_input_field_to_map("products", "units_by_package", db_products_units_by_package);
+            }
+            {
+              local o = Fl_Float_Input(370, 220, 110, 25, _tr("Weight"));
+              db_products_weight = o;
+              o.textsize(16);
+              o.labelsize(16);
+              o->decimal_places(-6);
+              add_input_field_to_map("products", "weight", db_products_weight);
+            }
+            {
+              local o = Fl_Check_Button(10, 250, 215, 25, _tr("Sell without stock"));
+              db_products_sell_without_stock = o;
+              o.labelsize(16);
+              o.down_box(FL_DOWN_BOX);
+              add_input_field_to_map("products", "sell_without_stock", db_products_sell_without_stock);
+            }
+            {
+              local o = Fl_Check_Button(10, 280, 110, 25, _tr("Active"));
+              db_products_is_active = o;
+              o.labelsize(16);
+              o.down_box(FL_DOWN_BOX);
+              add_input_field_to_map("products", "is_active", db_products_is_active);
+            }
+            {
+              local o = Fl_Check_Button(10, 310, 105, 25, _tr("Sales"));
+              db_products_show_on_sales = o;
+              o.labelsize(16);
+              o.down_box(FL_DOWN_BOX);
+              add_input_field_to_map("products", "show_on_sales", db_products_show_on_sales);
+            }
+            {
+              local o = Fl_Check_Button(10, 340, 95, 25, _tr("Buys"));
+              db_products_show_on_buys = o;
+              o.labelsize(16);
+              o.down_box(FL_DOWN_BOX);
+              add_input_field_to_map("products", "show_on_buys", db_products_show_on_buys);
+            }
+            {
+              local o = Fl_Check_Button(115, 310, 120, 25, _tr("Web"));
+              db_products_show_on_web = o;
+              o.labelsize(16);
+              o.down_box(FL_DOWN_BOX);
+              add_input_field_to_map("products", "show_on_web", db_products_show_on_web);
+            }
+            {
+              local o = Fl_Check_Button(115, 340, 100, 25, _tr("Web price"));
+              db_products_show_price_on_web = o;
+              o.labelsize(16);
+              o.down_box(FL_DOWN_BOX);
+              add_input_field_to_map("products", "show_price_on_web", db_products_show_price_on_web);
+            }
+            {
+              local o = Fl_Group(675, 402, 110, 143);
+              {
+                {
+                  local o = Fl_Box(675, 402, 110, 68, _tr("Spacer"));
+                  o.labeltype(FL_NO_LABEL);
+                  Fl_Group.current().resizable(o);
+                }
+                {
+                  local o = Fl_Choice_dbAction(675, 520, 110, 25, _tr("Action"));
+                  dbAction = o;
+                  o.textsize(16);
+                  o.align(1);
+                  o.down_box(FL_BORDER_BOX);
+                  o.labelsize(16);
+                }
+                {
+                  local o = Fl_Button(675, 470, 110, 25, _tr("Action"));
+                  btnDbAction = o;
+                  o.labelsize(16);
+                }
+              }
+              o.end();
+            }
+            {
+              local o = Fl_Tabs(10, 370, 650, 181);
+              tabsMoreData = o;
+              o.labelcolor(7);
+              o.labelsize(16);
+              o.selection_color(4);
+              {
+                {
+                  local o = Fl_Group(10, 400, 650, 150, _tr("Notes"));
+                  tabNotes = o;
+                  o.labelsize(16);
+                  {
+                    {
+                      local o = Fl_Text_Editor_Buffered(10, 400, 650, 150);
+                      db_products_sell_notes = o;
+                      o.textsize(16);
+                      o.align(5);
+                      o.labeltype(FL_NO_LABEL);
+                      o.labelsize(16);
+                      add_input_field_to_map("products", "sell_notes", db_products_sell_notes);
+                      Fl_Group.current().resizable(o);
+                    }
+                  }
+                  o.end();
+                }
+                {
+                  local o = Fl_Group(10, 400, 650, 150, _tr("Notes Supplier"));
+                  tabNotesSupplier = o;
+                  o.labelsize(16);
+                  {
+                    {
+                      local o = Fl_Text_Editor_Buffered(10, 400, 650, 150);
+                      db_products_buy_notes = o;
+                      o.textsize(16);
+                      o.align(5);
+                      o.labeltype(FL_NO_LABEL);
+                      o.labelsize(16);
+                      add_input_field_to_map("products", "buy_notes", db_products_buy_notes);
+                      Fl_Group.current().resizable(o);
+                    }
+                  }
+                  o.end();
+                }
+                {
+                  local o = Fl_Group(10, 400, 650, 150, _tr("Tags"));
+                  tabTags = o;
+                  o.labelsize(16);
+                  {
+                    {
+                      local o = Fl_Text_Editor_Buffered(10, 400, 650, 150);
+                      db_products_tags = o;
+                      o.textsize(16);
+                      o.align(5);
+                      o.labeltype(FL_NO_LABEL);
+                      o.labelsize(16);
+                      add_input_field_to_map("products", "tags", db_products_tags);
+                      Fl_Group.current().resizable(o);
+                    }
+                  }
+                  o.end();
+                }
+                {
+                  local o = Fl_Group(10, 395, 650, 156, _tr("Groups"));
+                  tabGroups = o;
+                  {
+                    {
+                      local o = Flu_Tree_Browser(10, 400, 650, 150);
+                      db_products_group_id = o;
+                      o.labelsize(16);
+                      add_input_field_to_map("products", "group_id", db_products_group_id);
+                    }
+                  }
+                  o.end();
+                }
+              }
+              o.end();
+            }
+            {
+              local o = Fl_Image_Box(485, 158, 300, 232);
+              btnImage = o;
+              o.box(FL_ENGRAVED_BOX);
+              o.align(80);
+              o.color(7);
+            }
+            {
+              local o = Fl_Check_Button(370, 375, 102, 25, _tr("Wrap lines"));
+              o.labelsize(16);
+              o.value(1);
+              o.down_box(FL_DOWN_BOX);
+              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_tags->wrap_mode(o->value(), 0);
+              });
+            }
+            {
+              local o = Fl_Float_Input(115, 220, 110, 25, _tr("Onhand"));
+              db_products_quantity_onhand = o;
+              o.textsize(16);
+              o.labelsize(16);
+              o->decimal_places(-6);
+              add_input_field_to_map("products", "quantity_onhand", db_products_quantity_onhand);
+            }
+          }
+          o.end();
+          Fl_Group.current().resizable(o);
+        }
+        {
+          local o = Fl_Group(5, 60, 790, 495, _tr("Prices"));
+          tabPrices = o;
+          o.labelsize(16);
+          o.color(246);
+          {
+            {
+              local o = Fl_Group(15, 88, 770, 201, _tr("Sales Price"));
+              o.labelsize(16);
+              o.color(166);
+              o.box(FL_UP_BOX);
+              {
+                {
+                  local o = Fl_Float_Input_Fmt(25, 115, 115, 25, _tr("Buy $"));
+                  db_products_buy_price = o;
+                  o.textsize(16);
+                  o.align(5);
+                  o.labelsize(16);
+                  add_input_field_to_map("products", "buy_price", db_products_buy_price);
+                }
+                {
+                  local o = Fl_Float_Input_Fmt(151, 115, 115, 25, _tr("Buy Disc. %"));
+                  db_products_buy_discount = o;
+                  o.textsize(16);
+                  o.align(5);
+                  o.labelsize(16);
+                  add_input_field_to_map("products", "buy_discount", db_products_buy_discount);
+                  o->decimal_places(-6);
+                }
+                {
+                  local o = Fl_Float_Input_Fmt(278, 115, 115, 25, _tr("Other Costs $"));
+                  db_products_buy_other_costs = o;
+                  o.textsize(16);
+                  o.align(5);
+                  o.labelsize(16);
+                  add_input_field_to_map("products", "buy_other_costs", db_products_buy_other_costs);
+                }
+                {
+                  local o = Fl_Float_Input_Fmt(404, 115, 115, 25, _tr("Markup %"));
+                  db_products_sell_markup = o;
+                  o.textsize(16);
+                  o.align(5);
+                  o.labelsize(16);
+                  add_input_field_to_map("products", "sell_markup", db_products_sell_markup);
+                  //o->decimal_places(-6);
+                }
+                {
+                  local o = Fl_Float_Input_Fmt(531, 115, 115, 25, _tr("Margin %"));
+                  markup_to_discount = o;
+                  o.textsize(16);
+                  o.align(5);
+                  o.labelsize(16);
+                  //o->decimal_places(-6);
+                }
+                {
+                  local o = Fl_Float_Input_Fmt(658, 115, 115, 25, _tr("Sales $"));
+                  db_products_sell_price_ro = o;
+                  o.textsize(16);
+                  o.align(5);
+                  o.labelsize(16);
+                }
+                {
+                  local o = Fl_Int_Input(530, 150, 30, 25, _tr("Decimals for calculation"));
+                  db_products_price_decimals = o;
+                  o.textsize(16);
+                  o.labelfont(1);
+                  o.textfont(1);
+                  o.labelsize(16);
+                  add_input_field_to_map("products", "price_decimals", db_products_price_decimals);
+                  //o->decimal_places(-6);
+                }
+                {
+                  local o = Fl_Button(662, 150, 111, 25, _tr("Save"));
+                  btnSaveProrduct = o;
+                  o.labelsize(16);
+                }
+                {
+                  local o = Fl_Float_Input(665, 195, 110, 25, _tr("Stock Min."));
+                  db_products_stock_min = o;
+                  o.textsize(16);
+                  o.labelsize(16);
+                  add_input_field_to_map("products", "stock_min", db_products_stock_min);
+                  o->decimal_places(-6);
+                }
+                {
+                  local o = Fl_Float_Input(665, 225, 110, 25, _tr("Stock Max."));
+                  db_products_stock_max = o;
+                  o.textsize(16);
+                  o.labelsize(16);
+                  add_input_field_to_map("products", "stock_max", db_products_stock_max);
+                  o->decimal_places(-6);
+                }
+                {
+                  local o = Fl_Float_Input(665, 255, 110, 25, _tr("Buy Min. Qty."));
+                  db_products_buy_quantity_min = o;
+                  o.textsize(16);
+                  o.labelsize(16);
+                  add_input_field_to_map("products", "buy_quantity_min", db_products_buy_quantity_min);
+                  o->decimal_places(-6);
+                }
+                {
+                  local o = Fl_Multiline_Input(25, 197, 495, 83, _tr("Price formula"));
+                  db_products_price_formula = o;
+                  o.textsize(16);
+                  o.align(5);
+                  o.labelsize(16);
+                  add_input_field_to_map("products", "price_formula", db_products_price_formula);
+                }
+                {
+                  local o = Fl_Output(25, 150, 130, 25, _tr("Last Update"));
+                  db_products_price_date = o;
+                  o.textsize(16);
+                  o.align(8);
+                  o.labelsize(16);
+                }
+              }
+              o.end();
+            }
+            {
+              local o = Fl_Box(15, 290, 770, 40, _tr("Spacer"));
+              o.labeltype(FL_NO_LABEL);
+              Fl_Group.current().resizable(o);
+            }
+            {
+              local o = Fl_Group(15, 332, 770, 212);
+              productPrices = o;
+              o.box(FL_UP_BOX);
+              o.labelsize(16);
+              o.color(166);
+              o.labeltype(FL_NO_LABEL);
+              o.end();
+            }
+          }
+          o.end();
+        }
+        {
+          local o = Fl_Group(5, 59, 790, 495, _tr("Kit"));
+          tabKit = o;
+          o.labelsize(16);
+          o.color(246);
+          o.end();
+        }
+        {
+          local o = Fl_Group(5, 60, 790, 495, _tr("Statistics"));
+          tabChartStatistics = o;
+          o.labelsize(16);
+          o.color(246);
+          o.end();
+        }
+        {
+          local o = Fl_Group(5, 60, 790, 495, _tr("History"));
+          tabHistory = o;
+          o.labelsize(16);
+          o.color(246);
+          o.end();
+        }
+        {
+          local o = Fl_Group(5, 60, 790, 495, _tr("Reports"));
+          tabReports = o;
+          o.labelsize(16);
+          o.color(246);
+          o.box(FL_UP_BOX);
+          {
+            {
+              local o = Fl_Group(15, 465, 770, 80, _tr("Export / Import"));
+              grpExportImport = o;
+              o.labelsize(16);
+              o.box(FL_ENGRAVED_FRAME);
+              {
+                {
+                  local o = Fl_Button(25, 475, 175, 25, _tr("Products Export"));
+                  btnProductsExport = o;
+                  o.labelsize(16);
+                }
+                {
+                  local o = Fl_Button(25, 510, 175, 25, _tr("Products Import"));
+                  btnProductsImport = o;
+                  o.labelsize(16);
+                }
+                {
+                  local o = Fl_Check_Button(225, 480, 150, 25, _tr("Withouth Prices"));
+                  chkWithoutPrices = o;
+                  o.labelsize(16);
+                  o.down_box(FL_DOWN_BOX);
+                }
+                {
+                  local o = Fl_Check_Button(225, 510, 150, 25, _tr("WEB Only"));
+                  chkWebOnly = o;
+                  o.labelsize(16);
+                  o.down_box(FL_DOWN_BOX);
+                }
+                {
+                  local o = Fl_Box(405, 499, 42, 25, _tr("0"));
+                  boxExportImportCount = o;
+                  o.labelsize(16);
+                }
+                {
+                  local o = Fl_Button(555, 475, 220, 25, _tr("Product Groups Export"));
+                  btnProductGroupsExport = o;
+                  o.labelsize(16);
+                }
+                {
+                  local o = Fl_Button(555, 510, 220, 25, _tr("Product Groups import"));
+                  btnProductGroupsImport = o;
+                  o.labelsize(16);
+                }
+              }
+              o.end();
+            }
+            {
+              local o = Fl_Button(610, 70, 175, 25, _tr("Update WEB"));
+              btnUpdateWeb = o;
+              o.labelsize(16);
+            }
+            {
+              local o = Fl_Group(10, 85, 195, 165, _tr("Price List"));
+              grpPrintPriceList = o;
+              o.labelsize(16);
+              o.box(FL_ENGRAVED_FRAME);
+              {
+                {
+                  local o = Fl_Check_Button(20, 95, 175, 25, _tr("With V.A.T."));
+                  chkPriceListWithVAT = o;
+                  o.labelsize(16);
+                  o.down_box(FL_DOWN_BOX);
+                }
+                {
+                  local o = Fl_Check_Button(20, 125, 170, 25, _tr("Sell on WEB"));
+                  chkPriceListSellOnWeb = o;
+                  o.labelsize(16);
+                  o.down_box(FL_DOWN_BOX);
+                }
+                {
+                  local o = Fl_Button(20, 215, 175, 25, _tr("Print"));
+                  btnPrintPriceList = o;
+                  o.labelsize(16);
+                }
+                {
+                  local o = Fl_Check_Button(20, 155, 175, 25, _tr("Sales"));
+                  chkPriceListSellSales = o;
+                  o.labelsize(16);
+                  o.down_box(FL_DOWN_BOX);
+                }
+                {
+                  local o = Fl_Check_Button(20, 185, 175, 25, _tr("PDF"));
+                  chkPriceListSellPDF = o;
+                  o.labelsize(16);
+                  o.down_box(FL_DOWN_BOX);
+                }
+              }
+              o.end();
+            }
+          }
+          o.end();
+        }
+        {
+          local o = Fl_Group(5, 60, 790, 495, _tr("Totals"));
+          tabTotals = o;
+          o.labelsize(16);
+          o.color(246);
+          {
+            {
+              local o = Fl_Float_Input(220, 80, 110, 25, _tr("Quantity quoted sales"));
+              db_products_quantity_quoted_sales = o;
+              o.textsize(16);
+              o.labelsize(16);
+              o->decimal_places(-6);
+              add_input_field_to_map("products", "quantity_quoted_sales", db_products_quantity_quoted_sales);
+            }
+            {
+              local o = Fl_Float_Input(220, 115, 110, 25, _tr("Quantity ordered sales"));
+              db_products_quantity_ordered_sales = o;
+              o.textsize(16);
+              o.labelsize(16);
+              o->decimal_places(-6);
+              add_input_field_to_map("products", "quantity_ordered_sales", db_products_quantity_ordered_sales);
+            }
+            {
+              local o = Fl_Float_Input(220, 150, 110, 25, _tr("Quantity delivered"));
+              db_products_quantity_delivered = o;
+              o.textsize(16);
+              o.labelsize(16);
+              o->decimal_places(-6);
+              add_input_field_to_map("products", "quantity_delivered", db_products_quantity_delivered);
+            }
+            {
+              local o = Fl_Float_Input(220, 185, 110, 25, _tr("Quantity invoiced sales"));
+              db_products_quantity_invoiced_sales = o;
+              o.textsize(16);
+              o.labelsize(16);
+              o->decimal_places(-6);
+              add_input_field_to_map("products", "quantity_invoiced_sales", db_products_quantity_invoiced_sales);
+            }
+            {
+              local o = Fl_Float_Input(220, 220, 110, 25, _tr("Quantity lost"));
+              db_products_quantity_lost = o;
+              o.textsize(16);
+              o.labelsize(16);
+              o->decimal_places(-6);
+              add_input_field_to_map("products", "quantity_lost", db_products_quantity_lost);
+            }
+            {
+              local o = Fl_Float_Input(665, 85, 110, 25, _tr("Quantity quoted buys"));
+              db_products_quantity_quoted_buys = o;
+              o.textsize(16);
+              o.labelsize(16);
+              o->decimal_places(-6);
+              add_input_field_to_map("products", "quantity_quoted_buys", db_products_quantity_quoted_buys);
+            }
+            {
+              local o = Fl_Float_Input(665, 120, 110, 25, _tr("Quantity ordered buys"));
+              db_products_quantity_ordered_buys = o;
+              o.textsize(16);
+              o.labelsize(16);
+              o->decimal_places(-6);
+              add_input_field_to_map("products", "quantity_ordered_buys", db_products_quantity_ordered_buys);
+            }
+            {
+              local o = Fl_Float_Input(665, 155, 110, 25, _tr("Quantity received"));
+              db_products_quantity_received = o;
+              o.textsize(16);
+              o.labelsize(16);
+              o->decimal_places(-6);
+              add_input_field_to_map("products", "quantity_received", db_products_quantity_received);
+            }
+            {
+              local o = Fl_Float_Input(665, 190, 110, 25, _tr("Quantity invoiced buys"));
+              db_products_quantity_invoiced_buys = o;
+              o.textsize(16);
+              o.labelsize(16);
+              o->decimal_places(-6);
+              add_input_field_to_map("products", "quantity_invoiced_buys", db_products_quantity_invoiced_buys);
+            }
+          }
+          o.end();
+        }
+      }
+      o.end();
+      Fl_Group.current().resizable(o);
+    }
+  }
 }

+ 64 - 0
SquiLu-ourbiz/groups-tree-gui.fl

@@ -0,0 +1,64 @@
+# data file for the Fltk User Interface Designer (fluid)
+version 1.0302 
+i18n_type 1 
+i18n_include i18n_function.h 
+i18n_function _tr 
+header_name {.h} 
+code_name {.cxx}
+widget_class GroupsListEditWindow {
+  label {Groups List / Edit} open
+  xywh {328 91 800 560} type Double labelsize 16 resizable
+  class Edit_Base_Window visible
+} {
+  Fl_Tree tree {
+    dirty_name tree selected
+    xywh {10 10 780 360} labeltype NO_LABEL labelsize 16 resizable
+    code0 {//o->showroot(0);}
+    code1 {//o->select_focus(1);}
+    class MyTree_Browser
+  }
+  Fl_Group bottomGroup {open
+    xywh {0 375 800 185} box ENGRAVED_BOX color 246 labelsize 16
+  } {
+    Fl_Input db_group_description {
+      label Description
+      macro_name {db group description}
+      xywh {98 408 576 28} labelsize 16 align 5 textfont 1 textsize 16
+      code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+    }
+    Fl_Input db_group_parent_id {
+      label Parent
+      macro_name {db group parent_id}
+      xywh {684 408 106 28} type Int labelsize 16 align 5 textfont 1 textsize 16
+      code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+    }
+    Fl_Choice dbAction {
+      dirty_name dbAction open
+      xywh {684 484 106 28} down_box BORDER_BOX labeltype NO_LABEL labelsize 16 textsize 16
+      class Fl_Choice_dbAction
+    } {}
+    Fl_Button btnDbAction {
+      label Action
+      dirty_name btnDbAction
+      xywh {686 522 104 28} labelsize 16
+    }
+    Fl_Output db_group_id {
+      label ID
+      macro_name {db group id}
+      xywh {10 408 78 28} labelsize 16 align 5 textfont 1 textsize 16
+      code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+    }
+    Fl_Check_Button btnWrapNotes {
+      label {Wrap lines}
+      dirty_name btnWrapNotes
+      xywh {95 440 115 25} down_box DOWN_BOX value 1 labelsize 16
+    }
+    Fl_Text_Editor db_group_notes {
+      label Notes
+      macro_name {db group notes}
+      xywh {10 462 660 88} labelsize 16 align 5 textsize 16 resizable
+      code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      class MyFl_Text_Editor
+    }
+  }
+} 

+ 93 - 0
SquiLu-ourbiz/groups-tree-gui.nut

@@ -0,0 +1,93 @@
+class GroupsListEditWindow extends EditWindow {
+  
+// Declaration of class members
+  tree = null;
+  bottomGroup = null;
+  db_group_description = null;
+  db_group_parent_id = null;
+  dbAction = null;
+  btnDbAction = null;
+  db_group_id = null;
+  btnWrapNotes = null;
+  db_group_notes = null;
+  
+  constructor(px=328, py=91, pw=800, ph=560, pl=_tr("Groups List / Edit")){
+    base.constructor(px, py, pw, ph, pl);
+    // Create member functions and widgets
+    {
+      local o = MyTree_Browser(10, 10, 780, 360);
+      tree = o;
+      o.labeltype(FL_NO_LABEL);
+      o.labelsize(16);
+      //o->showroot(0);
+      //o->select_focus(1);
+      Fl_Group.current().resizable(o);
+    }
+    {
+      local o = Fl_Group(0, 375, 800, 185);
+      bottomGroup = o;
+      o.box(FL_ENGRAVED_BOX);
+      o.labelsize(16);
+      o.color(246);
+      {
+        {
+          local o = Fl_Input(98, 408, 576, 28, _tr("Description"));
+          db_group_description = o;
+          o.textsize(16);
+          o.align(5);
+          o.textfont(1);
+          o.labelsize(16);
+          add_input_field_to_map("group", "description", db_group_description);
+        }
+        {
+          local o = Fl_Int_Input(684, 408, 106, 28, _tr("Parent"));
+          db_group_parent_id = o;
+          o.textsize(16);
+          o.align(5);
+          o.textfont(1);
+          o.labelsize(16);
+          add_input_field_to_map("group", "parent_id", db_group_parent_id);
+        }
+        {
+          local o = Fl_Choice_dbAction(684, 484, 106, 28);
+          dbAction = o;
+          o.textsize(16);
+          o.labeltype(FL_NO_LABEL);
+          o.down_box(FL_BORDER_BOX);
+          o.labelsize(16);
+        }
+        {
+          local o = Fl_Button(686, 522, 104, 28, _tr("Action"));
+          btnDbAction = o;
+          o.labelsize(16);
+        }
+        {
+          local o = Fl_Output(10, 408, 78, 28, _tr("ID"));
+          db_group_id = o;
+          o.textsize(16);
+          o.align(5);
+          o.textfont(1);
+          o.labelsize(16);
+          add_input_field_to_map("group", "id", db_group_id);
+        }
+        {
+          local o = Fl_Check_Button(95, 440, 115, 25, _tr("Wrap lines"));
+          btnWrapNotes = o;
+          o.labelsize(16);
+          o.value(1);
+          o.down_box(FL_DOWN_BOX);
+        }
+        {
+          local o = MyFl_Text_Editor(10, 462, 660, 88, _tr("Notes"));
+          db_group_notes = o;
+          o.textsize(16);
+          o.align(5);
+          o.labelsize(16);
+          add_input_field_to_map("group", "notes", db_group_notes);
+          Fl_Group.current().resizable(o);
+        }
+      }
+      o.end();
+    }
+  }
+}

+ 35 - 0
SquiLu-ourbiz/history-gui.fl

@@ -0,0 +1,35 @@
+# data file for the Fltk User Interface Designer (fluid)
+version 1.0302 
+i18n_type 1 
+i18n_include i18n_function.h 
+i18n_function _tr 
+header_name {.h} 
+code_name {.cxx}
+decl {\#include "My_Base_App.h"} {public global
+} 
+
+widget_class HistoryGroup {
+  label History open
+  xywh {13 33 760 465} type Double labelsize 16 resizable visible position_relative
+} {
+  Fl_Pack {} {open
+    xywh {0 0 760 25} type HORIZONTAL labelsize 16
+    code0 {o->spacing(10);}
+  } {
+    Fl_Choice history_choice {open
+      xywh {0 0 564 25} down_box BORDER_BOX labeltype NO_LABEL labelsize 16 textsize 16 resizable
+    } {}
+    Fl_Input history_query_limit {
+      tooltip {Write then number of periodes you want to see} xywh {574 0 80 25} type Int labeltype NO_LABEL labelsize 16 textsize 16
+      code0 {o->value("50");}
+    }
+    Fl_Button btnViewDocHsitory {
+      label {View Doc.}
+      xywh {664 0 96 25} labelsize 16
+    }
+  }
+  Fl_Browser grid_history {selected
+    xywh {0 33 760 432} type Multi labeltype NO_LABEL labelsize 16 textsize 16 resizable
+    class Fl_Data_Table
+  }
+} 

+ 82 - 0
SquiLu-ourbiz/list-search-gui.fl

@@ -0,0 +1,82 @@
+# data file for the Fltk User Interface Designer (fluid)
+version 1.0302 
+i18n_type 1 
+i18n_include i18n_function.h 
+i18n_function _tr 
+header_name {.h} 
+code_name {.cxx}
+decl {\#include "My_Base_App.h"} {public global
+} 
+
+widget_class ListSearchWindow {
+  label {List Search} open
+  xywh {132 118 800 560} type Double labelsize 16 resizable
+  class List_Search_Base_Window visible
+} {
+  Fl_Group topGroup {open
+    xywh {0 0 800 35} labelsize 16
+  } {
+    Fl_Input group_filter {
+      dirty_name group_filter selected
+      xywh {5 5 675 25} labeltype NO_LABEL labelsize 16 textsize 16
+      class Flu_Combo_List
+    }
+    Fl_Input query_limit {
+      xywh {690 6 60 25} type Int labeltype NO_LABEL labelsize 16 textsize 16
+      code0 {o->value("50");}
+    }
+    Fl_Button btnNotes {
+      label {?}
+      xywh {760 6 35 25} labelsize 16
+    }
+  }
+  Fl_Group middleGroup {open
+    xywh {0 41 800 409} labelsize 16 resizable
+  } {
+    Fl_Browser grid {
+      dirty_name grid
+      xywh {5 41 790 389} type Multi labeltype NO_LABEL labelsize 16 textsize 16 resizable
+      class Fl_Data_Table
+    }
+  }
+  Fl_Group bottomGroup {open
+    xywh {4 440 790 115} box ENGRAVED_BOX color 246 labelsize 16
+  } {
+    Fl_Pack pack_search_options {open
+      xywh {14 450 320 25} type HORIZONTAL labelsize 16
+      code0 {o->spacing(10);}
+    } {}
+    Fl_Input search_str {
+      label {@search}
+      dirty_name search_str
+      xywh {35 485 299 25} labelsize 16 when 8 textsize 16
+    }
+    Fl_Button btnSearch {
+      label Search
+      xywh {345 485 100 25} labelsize 16
+    }
+    Fl_Button btnSelect {
+      label Select
+      xywh {14 520 100 25} labelsize 16
+    }
+    Fl_Button btnUpdate {
+      label Update
+      xywh {124 520 100 25} labelsize 16
+    }
+    Fl_Button btnInsert {
+      label Insert
+      xywh {234 520 100 25} labelsize 16
+    }
+    Fl_Button btnThumbImage {
+      xywh {663 445 125 105} box NO_BOX align 80
+      class Fl_Image_Box
+    }
+    Fl_Box {} {
+      xywh {650 445 5 105} labeltype NO_LABEL labelsize 16 align 80 resizable
+    }
+    Fl_Pack pack_search_options2 {open
+      xywh {345 520 300 25} type HORIZONTAL labelsize 16
+      code0 {o->spacing(10);}
+    } {}
+  }
+} 

+ 133 - 147
SquiLu-ourbiz/list-search-window.nut

@@ -1,150 +1,136 @@
-//class BaseReportA4 extends Fl_Group {
 class ListSearch extends MyBaseWindow {
-	topGroup=null;
-	group_filter=null;
-	query_limit=null;
-	btnNotes=null;
-	middleGroup=null;
-	grid=null;
-	bottomGroup=null;
-	pack_search_options=null;
-	search_str=null;
-	btnSearch=null;
-	btnSelect=null;
-	btnUpdate=null;
-	btnInsert=null;
-	btnThumbImage=null;
-	pack_search_options2=null;
 
-constructor() {
-	base.constructor(10, 50, 800, 560, _tr("List Search"));
-begin();
-this->box(FL_FLAT_BOX);
-this->color(FL_BACKGROUND_COLOR);
-this->selection_color(FL_BACKGROUND_COLOR);
-this->labeltype(FL_NO_LABEL);
-this->labelfont(0);
-this->labelsize(16);
-this->labelcolor(FL_FOREGROUND_COLOR);
-this->align((FL_ALIGN_TOP));
-this->when(FL_WHEN_RELEASE);
-{ topGroup = new Fl_Group(0, 0, 800, 35);
-  topGroup->labelsize(16);
-  { group_filter = new Flu_Combo_List(5, 5, 675, 25);
-    group_filter->resize(5, 5, 675, 25);
-    group_filter->box(FL_DOWN_BOX);
-    group_filter->color(FL_BACKGROUND2_COLOR);
-    group_filter->selection_color(FL_SELECTION_COLOR);
-    group_filter->labeltype(FL_NO_LABEL);
-    group_filter->labelfont(0);
-    group_filter->labelsize(16);
-    group_filter->labelcolor(FL_FOREGROUND_COLOR);
-    group_filter->textsize(16);
-    group_filter->align((FL_ALIGN_LEFT));
-    group_filter->when(FL_WHEN_RELEASE);
-  } // Flu_Combo_List* group_filter
-  { local o = query_limit = new Fl_Int_Input(690, 6, 60, 25);
-    query_limit->type(2);
-    query_limit->labeltype(FL_NO_LABEL);
-    query_limit->labelsize(16);
-    query_limit->textsize(16);
-    o->value("50");
-  } // Fl_Int_Input* query_limit
-  { btnNotes = new My_Fl_Return_Button(760, 6, 35, 25, _tr("?"));
-    btnNotes->labelsize(16);
-  } // My_Fl_Return_Button* btnNotes
-  topGroup->end();
-} // Fl_Group* topGroup
-{ middleGroup = new Fl_Group(0, 41, 800, 409);
-  middleGroup->labelsize(16);
-  { grid = new Fl_Data_Table(5, 41, 790, 389);
-    grid->resize(5, 41, 790, 389);
-    grid->type(3);
-    grid->box(FL_NO_BOX);
-    grid->color(FL_BACKGROUND2_COLOR);
-    grid->selection_color(FL_SELECTION_COLOR);
-    grid->labeltype(FL_NO_LABEL);
-    grid->labelfont(0);
-    grid->labelsize(16);
-    grid->labelcolor(FL_FOREGROUND_COLOR);
-    grid->textsize(16);
-    grid->align((FL_ALIGN_BOTTOM));
-    grid->when(FL_WHEN_RELEASE_ALWAYS);
-    Fl_Group.current()->resizable(grid);
-  } // Fl_Data_Table* grid
-  middleGroup->end();
-  Fl_Group.current()->resizable(middleGroup);
-} // Fl_Group* middleGroup
-{ bottomGroup = new Fl_Group(4, 440, 790, 115);
-  bottomGroup->box(FL_ENGRAVED_BOX);
-  bottomGroup->color(246);
-  bottomGroup->labelsize(16);
-  { local o = pack_search_options = new Fl_Pack(14, 450, 320, 25);
-    pack_search_options->type(1);
-    pack_search_options->labelsize(16);
-    o->spacing(10);
-    pack_search_options->end();
-  } // Fl_Pack* pack_search_options
-  { search_str = new Fl_Input(35, 485, 299, 25, _tr("@search"));
-    search_str->resize(35, 485, 299, 25);
-    search_str->label(_tr("@search"));
-    search_str->labelsize(16);
-    search_str->textsize(16);
-    search_str->callback(cb_search_str);
-    search_str->when(FL_WHEN_ENTER_KEY);
-  } // Fl_Input* search_str
-  { btnSearch = new My_Fl_Return_Button(345, 485, 100, 25, _tr("Search"));
-    btnSearch->labelsize(16);
-    btnSearch->callback(cb_btnSearch);
-  } // My_Fl_Return_Button* btnSearch
-  { btnSelect = new My_Fl_Return_Button(14, 520, 100, 25, _tr("Select"));
-    btnSelect->labelsize(16);
-    btnSelect->callback(cb_btnSelect);
-  } // My_Fl_Return_Button* btnSelect
-  { btnUpdate = new My_Fl_Return_Button(124, 520, 100, 25, _tr("Update"));
-    btnUpdate->labelsize(16);
-    btnUpdate->callback(cb_btnUpdate);
-  } // My_Fl_Return_Button* btnUpdate
-  { btnInsert = new My_Fl_Return_Button(234, 520, 100, 25, _tr("Insert"));
-    btnInsert->labelsize(16);
-    btnInsert->callback(cb_btnInsert);
-  } // My_Fl_Return_Button* btnInsert
-  { btnThumbImage = new Fl_Image_Box(663, 445, 125, 105);
-    btnThumbImage->box(FL_NO_BOX);
-    btnThumbImage->color(FL_BACKGROUND_COLOR);
-    btnThumbImage->selection_color(FL_BACKGROUND_COLOR);
-    btnThumbImage->labeltype(FL_NORMAL_LABEL);
-    btnThumbImage->labelfont(0);
-    btnThumbImage->labelsize(14);
-    btnThumbImage->labelcolor(FL_FOREGROUND_COLOR);
-    btnThumbImage->align((FL_ALIGN_CLIP|FL_ALIGN_INSIDE));
-    btnThumbImage->when(FL_WHEN_RELEASE);
-  } // Fl_Image_Box* btnThumbImage
-  { local o = new Fl_Box(650, 445, 5, 105);
-    o->labeltype(FL_NO_LABEL);
-    o->labelsize(16);
-    o->align((FL_ALIGN_CLIP|FL_ALIGN_INSIDE));
-    Fl_Group.current()->resizable(o);
-  } // Fl_Box* o
-  { local o = pack_search_options2 = new Fl_Pack(345, 520, 300, 25);
-    pack_search_options2->type(1);
-    pack_search_options2->labelsize(16);
-    o->spacing(10);
-    pack_search_options2->end();
-  } // Fl_Pack* pack_search_options2
-  bottomGroup->end();
-} // Fl_Group* bottomGroup
-group_filter->textfont(group_filter->labelfont());
-group_filter->textsize(group_filter->labelsize());
-end();
-}
-
-function cb_search_str(){}
-function cb_btnSearch(){}
-function cb_btnSelect(){}
-function cb_btnUpdate(){}
-function cb_btnInsert(sender, udata){
-	local pr = sender.parent_root();
-	local win = pr.showChildWindow("Order Edit", EditOrderWindow);
-}
+  // Declaration of class members
+  topGroup = null;
+  group_filter = null;
+  query_limit = null;
+  btnNotes = null;
+  middleGroup = null;
+  grid = null;
+  bottomGroup = null;
+  pack_search_options = null;
+  search_str = null;
+  btnSearch = null;
+  btnSelect = null;
+  btnUpdate = null;
+  btnInsert = null;
+  btnThumbImage = null;
+  pack_search_options2 = null;
+  
+  constructor(px=132, py=118, pw=800, ph=560, pl=_tr("List Search")){
+    base.constructor(px, py, pw, ph, pl);
+    // Create member functions and widgets
+    {
+      local o = Fl_Group(0, 0, 800, 35);
+      topGroup = o;
+      o.labelsize(16);
+      {
+        {
+          local o = Flu_Combo_List(5, 5, 675, 25);
+          group_filter = o;
+          o.textsize(16);
+          o.labeltype(FL_NO_LABEL);
+          o.labelsize(16);
+        }
+        {
+          local o = Fl_Int_Input(690, 6, 60, 25);
+          query_limit = o;
+          o.textsize(16);
+          o.labeltype(FL_NO_LABEL);
+          o.labelsize(16);
+          o->value("50");
+        }
+        {
+          local o = Fl_Button(760, 6, 35, 25, _tr("?"));
+          btnNotes = o;
+          o.labelsize(16);
+        }
+      }
+      o.end();
+    }
+    {
+      local o = Fl_Group(0, 41, 800, 409);
+      middleGroup = o;
+      o.labelsize(16);
+      {
+        {
+          local o = Fl_Data_Table(5, 41, 790, 389);
+          grid = o;
+          o.textsize(16);
+          o.labeltype(FL_NO_LABEL);
+          o.labelsize(16);
+          o.end();
+          Fl_Group.current().resizable(o);
+        }
+      }
+      o.end();
+      Fl_Group.current().resizable(o);
+    }
+    {
+      local o = Fl_Group(4, 440, 790, 115);
+      bottomGroup = o;
+      o.box(FL_ENGRAVED_BOX);
+      o.labelsize(16);
+      o.color(246);
+      {
+        {
+          local o = Fl_Pack(14, 450, 320, 25);
+          pack_search_options = o;
+          o.type(1);
+          o.labelsize(16);
+          o->spacing(10);
+          o.end();
+        }
+        {
+          local o = Fl_Input(35, 485, 299, 25, _tr("@search"));
+          search_str = o;
+          o.textsize(16);
+          o.when(8);
+          o.labelsize(16);
+        }
+        {
+          local o = Fl_Button(345, 485, 100, 25, _tr("Search"));
+          btnSearch = o;
+          o.labelsize(16);
+        }
+        {
+          local o = Fl_Button(14, 520, 100, 25, _tr("Select"));
+          btnSelect = o;
+          o.labelsize(16);
+        }
+        {
+          local o = Fl_Button(124, 520, 100, 25, _tr("Update"));
+          btnUpdate = o;
+          o.labelsize(16);
+        }
+        {
+          local o = Fl_Button(234, 520, 100, 25, _tr("Insert"));
+          btnInsert = o;
+          o.labelsize(16);
+        }
+        {
+          local o = Fl_Image_Box(663, 445, 125, 105);
+          btnThumbImage = o;
+          o.box(FL_NO_BOX);
+          o.align(80);
+        }
+        {
+          local o = Fl_Box(650, 445, 5, 105);
+          o.align(80);
+          o.labeltype(FL_NO_LABEL);
+          o.labelsize(16);
+          Fl_Group.current().resizable(o);
+        }
+        {
+          local o = Fl_Pack(345, 520, 300, 25);
+          pack_search_options2 = o;
+          o.type(1);
+          o.labelsize(16);
+          o->spacing(10);
+          o.end();
+        }
+      }
+      o.end();
+    }
+  }
 }

+ 8 - 2
SquiLu-ourbiz/main-window.nut

@@ -327,8 +327,14 @@ function cb_btnPaymentTypes(){print(__LINE__);}
 function cb_btnMeasureUnits(){print(__LINE__);}
 function cb_btnWarrantyTypes(){print(__LINE__);}
 function cb_btnImages(){print(__LINE__);}
-function cb_btnProductGroups(){print(__LINE__);}
-function cb_btnEntityGroups(){print(__LINE__);}
+function cb_btnProductGroups(sender, udata){
+	this = sender.window();
+	local win = showChildWindow("Product Groups", OurProductGroups);
+}
+function cb_btnEntityGroups(sender, udata){
+	this = sender.window();
+	local win = showChildWindow("Entity Groups", OurEntityGroups);
+}
 function cb_btnConfig(){print(__LINE__);}
 function cb_btnOpenDB(){print(__LINE__);}
 function cb_btnTranslations(){print(__LINE__);}

+ 302 - 0
SquiLu-ourbiz/order-page-gui.fl

@@ -0,0 +1,302 @@
+# data file for the Fltk User Interface Designer (fluid)
+version 1.0302 
+i18n_type 1 
+i18n_include i18n_function.h 
+i18n_function _tr 
+header_name {.h} 
+code_name {.cxx}
+decl {\#include "My_Base_App.h"} {public global
+} 
+
+widget_class OrderPageGroup {
+  label InvoiceA4 open selected
+  xywh {213 39 630 685} type Double resizable
+  class Fl_Scroll visible position_relative
+} {
+  Fl_Group page {open
+    xywh {0 0 634 686} color 7
+  } {
+    Fl_Group pageDesignGroup {open
+      xywh {2 0 630 686} labeltype NO_LABEL
+    } {
+      Fl_Group logoGroupH {
+        dirty_name logoGroupH open
+        xywh {15 10 316 130} hide
+      } {
+        Fl_Box logoH {
+          label FLTK
+          dirty_name logoH
+          xywh {16 10 310 50} labeltype SHADOW_LABEL labelfont 3 labelsize 40 align 660
+        }
+        Fl_Box companyBoxH {
+          label {FLTK (pronounced "fulltick") is a cross-platform C++ GUI toolkit for UNIX®/Linux® (X11), Microsoft® Windows®, and MacOS® X. FLTK provides modern GUI functionality without the bloat and supports 3D graphics via OpenGL® and its built-in GLUT emulation.}
+          dirty_name companyBoxH
+          xywh {16 65 308 75} labelfont 2 labelsize 10 align 144
+          class Fl_Box_ClearLabel
+        }
+      }
+      Fl_Group logoGroupV {
+        dirty_name logoGroupV open
+        xywh {15 10 316 130} hide
+      } {
+        Fl_Box logoV {
+          label FLTK
+          dirty_name logoV
+          xywh {16 10 100 130} labeltype SHADOW_LABEL labelfont 3 labelsize 40 align 660
+        }
+        Fl_Box companyBoxV {
+          label {FLTK (pronounced "fulltick") is a cross-platform C++ GUI toolkit for UNIX®/Linux® (X11), Microsoft® Windows®, and MacOS® X. FLTK provides modern GUI functionality without the bloat and supports 3D graphics via OpenGL® and its built-in GLUT emulation.}
+          dirty_name companyBoxV
+          xywh {120 10 210 130} labelfont 2 labelsize 10 align 144
+          class Fl_Box_ClearLabel
+        }
+      }
+      Fl_Group logoGroupHV {
+        dirty_name logoGroupHV open
+        xywh {15 10 316 130}
+      } {
+        Fl_Box logoHV1 {
+          label FLTK
+          dirty_name logoHV1
+          xywh {16 10 100 130} labeltype SHADOW_LABEL labelfont 3 labelsize 40 align 660
+        }
+        Fl_Box logoHV2 {
+          label FLTK
+          dirty_name logoHV2
+          xywh {120 10 210 50} labeltype SHADOW_LABEL labelfont 3 labelsize 40 align 660
+        }
+        Fl_Box companyBoxHV {
+          label {FLTK (pronounced "fulltick") is a cross-platform C++ GUI toolkit for UNIX®/Linux® (X11), Microsoft® Windows®, and MacOS® X. FLTK provides modern GUI functionality without the bloat and supports 3D graphics via OpenGL® and its built-in GLUT emulation.}
+          dirty_name companyBoxHV
+          xywh {120 50 210 90} labelfont 2 labelsize 9 align 144
+          class Fl_Box_ClearLabel
+        }
+      }
+      Fl_Group OrderNumber {
+        dirty_name OrderNumber open
+        xywh {336 10 286 40} box FLAT_BOX color 39 labeltype NO_LABEL
+      } {
+        Fl_Box box_header_number_date {
+          xywh {337 11 142 18} box FLAT_BOX color 47 labeltype NO_LABEL labelsize 12
+        }
+        Fl_Box box_data_number_date {
+          xywh {337 30 142 19} box FLAT_BOX color 7 labeltype NO_LABEL labelsize 12
+        }
+        Fl_Box header_date_box {
+          label DATE
+          xywh {480 11 141 18} box FLAT_BOX color 47 labelfont 1 labelsize 12
+        }
+        Fl_Box box_data_date_box {
+          xywh {480 30 141 19} box FLAT_BOX color 7 labeltype NO_LABEL labelfont 1 labelsize 12
+        }
+      }
+      Fl_Box box_to {
+        xywh {336 55 286 85} box BORDER_FRAME color 39 labelfont 1 labelsize 16 align 21
+      }
+      Fl_Group orderLines {
+        dirty_name orderLines open
+        xywh {16 148 606 433} box FLAT_BOX color 39 labeltype NO_LABEL resizable
+      } {
+        Fl_Box header_lines_code_box {
+          label CODE
+          xywh {17 149 46 20} box FLAT_BOX color 47 labelfont 1 labelsize 10
+        }
+        Fl_Box header_lines_description_box {
+          label DESCRIPTION
+          xywh {64 149 300 20} box FLAT_BOX color 47 labelfont 1 labelsize 10
+        }
+        Fl_Box header_lines_quantity_box {
+          label {QTY.}
+          xywh {365 149 40 20} box FLAT_BOX color 47 labelfont 1 labelsize 10
+        }
+        Fl_Box header_lines_price_box {
+          label PRICE
+          xywh {406 149 60 20} box FLAT_BOX color 47 labelfont 1 labelsize 10
+        }
+        Fl_Box header_lines_discount_box {
+          label {DISC. %}
+          xywh {467 149 30 20} box FLAT_BOX color 47 labelfont 1 labelsize 8 align 128
+        }
+        Fl_Box header_lines_sales_tax1_box {
+          label {S.T. I %}
+          dirty_name header_lines_sales_tax1_box
+          xywh {498 149 30 20} box FLAT_BOX color 47 labelfont 1 labelsize 8 align 128
+        }
+        Fl_Box header_lines_sales_tax2_box {
+          label {S.T. II %}
+          dirty_name header_lines_sales_tax2_box
+          xywh {529 149 30 20} box FLAT_BOX color 47 labelfont 1 labelsize 8 align 128
+        }
+        Fl_Box header_lines_subtotal_box {
+          label SUBTOTAL
+          xywh {560 149 61 20} box FLAT_BOX color 47 labelfont 1 labelsize 10
+        }
+        Fl_Group designLinesGroup {open
+          xywh {17 170 604 410} labeltype NO_LABEL resizable
+        } {
+          Fl_Box data_lines_code_box {
+            xywh {17 170 46 410} box FLAT_BOX color 7 labeltype NO_LABEL labelfont 1 labelsize 10
+          }
+          Fl_Box data_lines_description_box {
+            xywh {64 170 300 410} box FLAT_BOX color 7 labeltype NO_LABEL labelfont 1 labelsize 10
+          }
+          Fl_Box data_lines_quantity_box {
+            xywh {365 170 40 410} box FLAT_BOX color 7 labeltype NO_LABEL labelfont 1 labelsize 10
+          }
+          Fl_Box data_tlines_price_box {
+            xywh {406 170 60 410} box FLAT_BOX color 7 labeltype NO_LABEL labelfont 1 labelsize 10
+          }
+          Fl_Box data_lines_discount_box {
+            xywh {467 170 30 410} box FLAT_BOX color 7 labeltype NO_LABEL labelfont 1 labelsize 10
+          }
+          Fl_Box data_lines_sales_tax1_box {
+            dirty_name data_lines_sales_tax1_box
+            xywh {498 170 30 410} box FLAT_BOX color 7 labeltype NO_LABEL labelfont 1 labelsize 10
+          }
+          Fl_Box data_lines_sales_tax2_box {
+            dirty_name data_lines_sales_tax2_box
+            xywh {529 170 30 410} box FLAT_BOX color 7 labeltype NO_LABEL labelfont 1 labelsize 10
+          }
+          Fl_Box data_lines_subtotal_box {
+            xywh {560 170 61 410} box FLAT_BOX color 7 labeltype NO_LABEL labelfont 1 labelsize 10
+          }
+        }
+      }
+      Fl_Group orderTotals {
+        dirty_name orderTotals open
+        xywh {16 585 606 46} box FLAT_BOX color 39 labeltype NO_LABEL
+      } {
+        Fl_Box header_PAGENO_box {
+          label PAGE
+          xywh {17 586 65 20} box FLAT_BOX color 47 labelfont 1 labelsize 12
+        }
+        Fl_Box box_data_pageno_box {
+          xywh {17 607 65 23} box FLAT_BOX color 7 labeltype NO_LABEL labelfont 1 labelsize 12
+        }
+        Fl_Box header_totals_subtotal_box {
+          label SUBTOTAL
+          xywh {83 586 150 20} box FLAT_BOX color 47 labelfont 1 labelsize 12
+        }
+        Fl_Box data_totals_subtotal_box {
+          xywh {83 607 150 23} box FLAT_BOX color 7 labeltype NO_LABEL labelfont 1 labelsize 12
+        }
+        Fl_Box header_totals_total_sales_tax1_box {
+          label {Sales Tax I}
+          dirty_name header_totals_total_sales_tax1_box
+          xywh {234 586 120 20} box FLAT_BOX color 47 labelfont 1 labelsize 12
+        }
+        Fl_Box data_totals_total_sales_tax1_box {
+          dirty_name data_totals_total_sales_tax1_box
+          xywh {234 607 120 23} box FLAT_BOX color 7 labeltype NO_LABEL labelfont 1 labelsize 12
+        }
+        Fl_Box header_totals_total_sales_tax2_box {
+          label {Sales Tax II}
+          dirty_name header_totals_total_sales_tax2_box
+          xywh {355 586 115 20} box FLAT_BOX color 47 labelfont 1 labelsize 12
+        }
+        Fl_Box data_totals_total_sales_tax2_box {
+          dirty_name data_totals_total_sales_tax2_box
+          xywh {355 607 115 23} box FLAT_BOX color 7 labeltype NO_LABEL labelfont 1 labelsize 12
+        }
+        Fl_Box header_totals_total_box {
+          label TOTAL
+          xywh {471 586 150 20} box FLAT_BOX color 47 labelfont 1 labelsize 12
+        }
+        Fl_Box data_totals_total_box {
+          xywh {471 607 150 23} box FLAT_BOX color 7 labeltype NO_LABEL labelfont 1 labelsize 12
+        }
+      }
+      Fl_Box notes_box {
+        label {FLTK is provided under the terms of the GNU Library Public License, Version 2 with exceptions that allow for static linking.}
+        xywh {17 638 606 37} labelfont 2 labelsize 9 align 144
+        class Fl_Box_ClearLabel
+      }
+    }
+    Fl_Group printDataGroup {open
+      xywh {3 0 628 637} labeltype NO_LABEL resizable
+    } {
+      Fl_Box orderTypeBox {
+        dirty_name orderTypeBox
+        xywh {338 10 139 20} labelfont 1 labelsize 12
+      }
+      Fl_Box numberBox {
+        xywh {338 33 139 16} labelfont 5 labelsize 15 align 16
+        class Fl_Box_ClearLabel
+      }
+      Fl_Box dateBox {
+        xywh {484 32 133 16} labelfont 5 labelsize 15 align 16
+        class Fl_Box_ClearLabel
+      }
+      Fl_Box entityBox {
+        xywh {338 57 282 82} labelsize 12 align 85
+        class Fl_Box_ClearLabel
+      }
+      Fl_Group dataLinesGroup {open
+        xywh {16 169 605 412} labeltype NO_LABEL align 16 resizable
+      } {
+        Fl_Box codeBox {
+          xywh {16 174 46 404} labelsize 11 align 25
+          class Fl_Box_ClearLabel
+        }
+        Fl_Box descriptionBox {
+          xywh {64 174 300 404} labelsize 11 align 85
+          class Fl_Box_ClearLabel
+        }
+        Fl_Box quantityBox {
+          xywh {365 174 40 404} labelsize 11 align 25
+          class Fl_Box_ClearLabel
+        }
+        Fl_Box priceBox {
+          xywh {406 174 60 404} labelsize 11 align 25
+          class Fl_Box_ClearLabel
+        }
+        Fl_Box discountBox {
+          xywh {467 174 30 404} labelsize 11 align 25
+          class Fl_Box_ClearLabel
+        }
+        Fl_Box sales_tax1Box {
+          dirty_name sales_tax1Box
+          xywh {498 174 30 404} labelsize 11 align 25
+          class Fl_Box_ClearLabel
+        }
+        Fl_Box sales_tax2Box {
+          dirty_name sales_tax2Box
+          xywh {529 174 30 404} labelsize 11 align 25
+          class Fl_Box_ClearLabel
+        }
+        Fl_Box lineTotalBox {
+          xywh {560 174 61 404} labelsize 11 align 25
+          class Fl_Box_ClearLabel
+        }
+      }
+      Fl_Group bottomTotals {
+        dirty_name bottomTotals open
+        xywh {16 585 605 48} labeltype NO_LABEL
+      } {
+        Fl_Box orderPageBox {
+          dirty_name orderPageBox
+          xywh {16 608 65 25} labelfont 5 labelsize 15
+          class Fl_Box_ClearLabel
+        }
+        Fl_Box fisrtTotalBox {
+          xywh {83 608 150 25} labelfont 5 labelsize 15
+          class Fl_Box_ClearLabel
+        }
+        Fl_Box sales_tax1AmountBox {
+          dirty_name sales_tax1AmountBox
+          xywh {234 608 120 25} labelfont 5 labelsize 15
+          class Fl_Box_ClearLabel
+        }
+        Fl_Box sales_tax2AmountBox {
+          dirty_name sales_tax2AmountBox
+          xywh {355 608 115 25} labelfont 5 labelsize 15
+          class Fl_Box_ClearLabel
+        }
+        Fl_Box totalBox {
+          xywh {500 608 121 25} labelfont 5 labelsize 15
+          class Fl_Box_ClearLabel
+        }
+      }
+    }
+  }
+} 

+ 612 - 0
SquiLu-ourbiz/order-page-gui.nut

@@ -0,0 +1,612 @@
+class OrderPageGroup extends Fl_Scroll {
+  
+  // Declaration of class members
+  page = null;
+  pageDesignGroup = null;
+  logoGroupH = null;
+  logoH = null;
+  companyBoxH = null;
+  logoGroupV = null;
+  logoV = null;
+  companyBoxV = null;
+  logoGroupHV = null;
+  logoHV1 = null;
+  logoHV2 = null;
+  companyBoxHV = null;
+  OrderNumber = null;
+  box_header_number_date = null;
+  box_data_number_date = null;
+  header_date_box = null;
+  box_data_date_box = null;
+  box_to = null;
+  orderLines = null;
+  header_lines_code_box = null;
+  header_lines_description_box = null;
+  header_lines_quantity_box = null;
+  header_lines_price_box = null;
+  header_lines_discount_box = null;
+  header_lines_sales_tax1_box = null;
+  header_lines_sales_tax2_box = null;
+  header_lines_subtotal_box = null;
+  designLinesGroup = null;
+  data_lines_code_box = null;
+  data_lines_description_box = null;
+  data_lines_quantity_box = null;
+  data_tlines_price_box = null;
+  data_lines_discount_box = null;
+  data_lines_sales_tax1_box = null;
+  data_lines_sales_tax2_box = null;
+  data_lines_subtotal_box = null;
+  orderTotals = null;
+  header_PAGENO_box = null;
+  box_data_pageno_box = null;
+  header_totals_subtotal_box = null;
+  data_totals_subtotal_box = null;
+  header_totals_total_sales_tax1_box = null;
+  data_totals_total_sales_tax1_box = null;
+  header_totals_total_sales_tax2_box = null;
+  data_totals_total_sales_tax2_box = null;
+  header_totals_total_box = null;
+  data_totals_total_box = null;
+  notes_box = null;
+  printDataGroup = null;
+  orderTypeBox = null;
+  numberBox = null;
+  dateBox = null;
+  entityBox = null;
+  dataLinesGroup = null;
+  codeBox = null;
+  descriptionBox = null;
+  quantityBox = null;
+  priceBox = null;
+  discountBox = null;
+  sales_tax1Box = null;
+  sales_tax2Box = null;
+  lineTotalBox = null;
+  bottomTotals = null;
+  orderPageBox = null;
+  fisrtTotalBox = null;
+  sales_tax1AmountBox = null;
+  sales_tax2AmountBox = null;
+  totalBox = null;
+  
+  constructor(px=213, py=29, pw=630, ph=685, pl=null){
+    base.constructor(px,py,pw,ph,pl);
+    local _x = 213, _y = 39;
+    // Create member functions and widgets
+    {
+      local o = Fl_Group(_x + 0, _y + 0, 634, 686);
+      page = o;
+      o.color(7);
+      {
+        {
+          local o = Fl_Group(_x + 2, _y + 0, 630, 686);
+          pageDesignGroup = o;
+          o.labeltype(FL_NO_LABEL);
+          {
+            {
+              local o = Fl_Group(_x + 15, _y + 10, 316, 130);
+              logoGroupH = o;
+              {
+                {
+                  local o = Fl_Box(_x + 16, _y + 10, 310, 50, _tr("FLTK"));
+                  logoH = o;
+                  o.align(660);
+                  o.labelfont(3);
+                  o.labeltype(FL_SHADOW_LABEL);
+                  o.labelsize(40);
+                }
+                {
+                  local o = Fl_Box(_x + 16, _y + 65, 308, 75);
+                  companyBoxH = o;
+                  o.labelfont(2);
+                  o.align(144);
+                  o.labelsize(10);
+                }
+              }
+              o.end();
+            }
+            {
+              local o = Fl_Group(_x + 15, _y + 10, 316, 130);
+              logoGroupV = o;
+              {
+                {
+                  local o = Fl_Box(_x + 16, _y + 10, 100, 130, _tr("FLTK"));
+                  logoV = o;
+                  o.align(660);
+                  o.labelfont(3);
+                  o.labeltype(FL_SHADOW_LABEL);
+                  o.labelsize(40);
+                }
+                {
+                  local o = Fl_Box(_x + 120, _y + 10, 210, 130);
+                  companyBoxV = o;
+                  o.labelfont(2);
+                  o.align(144);
+                  o.labelsize(10);
+                }
+              }
+              o.end();
+            }
+            {
+              local o = Fl_Group(_x + 15, _y + 10, 316, 130);
+              logoGroupHV = o;
+              {
+                {
+                  local o = Fl_Box(_x + 16, _y + 10, 100, 130, _tr("FLTK"));
+                  logoHV1 = o;
+                  o.align(660);
+                  o.labelfont(3);
+                  o.labeltype(FL_SHADOW_LABEL);
+                  o.labelsize(40);
+                }
+                {
+                  local o = Fl_Box(_x + 120, _y + 10, 210, 50, _tr("FLTK"));
+                  logoHV2 = o;
+                  o.align(660);
+                  o.labelfont(3);
+                  o.labeltype(FL_SHADOW_LABEL);
+                  o.labelsize(40);
+                }
+                {
+                  local o = Fl_Box(_x + 120, _y + 50, 210, 90);
+                  companyBoxHV = o;
+                  o.labelfont(2);
+                  o.align(144);
+                  o.labelsize(9);
+                }
+              }
+              o.end();
+            }
+            {
+              local o = Fl_Group(_x + 336, _y + 10, 286, 40);
+              OrderNumber = o;
+              o.box(FL_FLAT_BOX);
+              o.color(39);
+              o.labeltype(FL_NO_LABEL);
+              {
+                {
+                  local o = Fl_Box(_x + 337, _y + 11, 142, 18);
+                  box_header_number_date = o;
+                  o.box(FL_FLAT_BOX);
+                  o.labelsize(12);
+                  o.labeltype(FL_NO_LABEL);
+                  o.color(47);
+                }
+                {
+                  local o = Fl_Box(_x + 337, _y + 30, 142, 19);
+                  box_data_number_date = o;
+                  o.box(FL_FLAT_BOX);
+                  o.labelsize(12);
+                  o.labeltype(FL_NO_LABEL);
+                  o.color(7);
+                }
+                {
+                  local o = Fl_Box(_x + 480, _y + 11, 141, 18, _tr("DATE"));
+                  header_date_box = o;
+                  o.labelsize(12);
+                  o.labelfont(1);
+                  o.box(FL_FLAT_BOX);
+                  o.color(47);
+                }
+                {
+                  local o = Fl_Box(_x + 480, _y + 30, 141, 19);
+                  box_data_date_box = o;
+                  o.box(FL_FLAT_BOX);
+                  o.labelsize(12);
+                  o.labelfont(1);
+                  o.labeltype(FL_NO_LABEL);
+                  o.color(7);
+                }
+              }
+              o.end();
+            }
+            {
+              local o = Fl_Box(_x + 336, _y + 55, 286, 85);
+              box_to = o;
+              o.box(FL_BORDER_FRAME);
+              o.align(21);
+              o.labelfont(1);
+              o.labelsize(16);
+              o.color(39);
+            }
+            {
+              local o = Fl_Group(_x + 16, _y + 148, 606, 433);
+              orderLines = o;
+              o.box(FL_FLAT_BOX);
+              o.color(39);
+              o.labeltype(FL_NO_LABEL);
+              {
+                {
+                  local o = Fl_Box(_x + 17, _y + 149, 46, 20, _tr("CODE"));
+                  header_lines_code_box = o;
+                  o.labelsize(10);
+                  o.labelfont(1);
+                  o.box(FL_FLAT_BOX);
+                  o.color(47);
+                }
+                {
+                  local o = Fl_Box(_x + 64, _y + 149, 300, 20, _tr("DESCRIPTION"));
+                  header_lines_description_box = o;
+                  o.labelsize(10);
+                  o.labelfont(1);
+                  o.box(FL_FLAT_BOX);
+                  o.color(47);
+                }
+                {
+                  local o = Fl_Box(_x + 365, _y + 149, 40, 20, _tr("QTY."));
+                  header_lines_quantity_box = o;
+                  o.labelsize(10);
+                  o.labelfont(1);
+                  o.box(FL_FLAT_BOX);
+                  o.color(47);
+                }
+                {
+                  local o = Fl_Box(_x + 406, _y + 149, 60, 20, _tr("PRICE"));
+                  header_lines_price_box = o;
+                  o.labelsize(10);
+                  o.labelfont(1);
+                  o.box(FL_FLAT_BOX);
+                  o.color(47);
+                }
+                {
+                  local o = Fl_Box(_x + 467, _y + 149, 30, 20, _tr("DISC. %"));
+                  header_lines_discount_box = o;
+                  o.align(128);
+                  o.labelsize(8);
+                  o.labelfont(1);
+                  o.box(FL_FLAT_BOX);
+                  o.color(47);
+                }
+                {
+                  local o = Fl_Box(_x + 498, _y + 149, 30, 20, _tr("S.T. I %"));
+                  header_lines_sales_tax1_box = o;
+                  o.align(128);
+                  o.box(FL_FLAT_BOX);
+                  o.labelsize(8);
+                  o.color(47);
+                  o.labelfont(1);
+                }
+                {
+                  local o = Fl_Box(_x + 529, _y + 149, 30, 20, _tr("S.T. II %"));
+                  header_lines_sales_tax2_box = o;
+                  o.align(128);
+                  o.box(FL_FLAT_BOX);
+                  o.labelsize(8);
+                  o.color(47);
+                  o.labelfont(1);
+                }
+                {
+                  local o = Fl_Box(_x + 560, _y + 149, 61, 20, _tr("SUBTOTAL"));
+                  header_lines_subtotal_box = o;
+                  o.labelsize(10);
+                  o.labelfont(1);
+                  o.box(FL_FLAT_BOX);
+                  o.color(47);
+                }
+                {
+                  local o = Fl_Group(_x + 17, _y + 170, 604, 410);
+                  designLinesGroup = o;
+                  o.labeltype(FL_NO_LABEL);
+                  {
+                    {
+                      local o = Fl_Box(_x + 17, _y + 170, 46, 410);
+                      data_lines_code_box = o;
+                      o.box(FL_FLAT_BOX);
+                      o.labelsize(10);
+                      o.labelfont(1);
+                      o.labeltype(FL_NO_LABEL);
+                      o.color(7);
+                    }
+                    {
+                      local o = Fl_Box(_x + 64, _y + 170, 300, 410);
+                      data_lines_description_box = o;
+                      o.box(FL_FLAT_BOX);
+                      o.labelsize(10);
+                      o.labelfont(1);
+                      o.labeltype(FL_NO_LABEL);
+                      o.color(7);
+                    }
+                    {
+                      local o = Fl_Box(_x + 365, _y + 170, 40, 410);
+                      data_lines_quantity_box = o;
+                      o.box(FL_FLAT_BOX);
+                      o.labelsize(10);
+                      o.labelfont(1);
+                      o.labeltype(FL_NO_LABEL);
+                      o.color(7);
+                    }
+                    {
+                      local o = Fl_Box(_x + 406, _y + 170, 60, 410);
+                      data_tlines_price_box = o;
+                      o.box(FL_FLAT_BOX);
+                      o.labelsize(10);
+                      o.labelfont(1);
+                      o.labeltype(FL_NO_LABEL);
+                      o.color(7);
+                    }
+                    {
+                      local o = Fl_Box(_x + 467, _y + 170, 30, 410);
+                      data_lines_discount_box = o;
+                      o.box(FL_FLAT_BOX);
+                      o.labelsize(10);
+                      o.labelfont(1);
+                      o.labeltype(FL_NO_LABEL);
+                      o.color(7);
+                    }
+                    {
+                      local o = Fl_Box(_x + 498, _y + 170, 30, 410);
+                      data_lines_sales_tax1_box = o;
+                      o.box(FL_FLAT_BOX);
+                      o.labelsize(10);
+                      o.labelfont(1);
+                      o.labeltype(FL_NO_LABEL);
+                      o.color(7);
+                    }
+                    {
+                      local o = Fl_Box(_x + 529, _y + 170, 30, 410);
+                      data_lines_sales_tax2_box = o;
+                      o.box(FL_FLAT_BOX);
+                      o.labelsize(10);
+                      o.labelfont(1);
+                      o.labeltype(FL_NO_LABEL);
+                      o.color(7);
+                    }
+                    {
+                      local o = Fl_Box(_x + 560, _y + 170, 61, 410);
+                      data_lines_subtotal_box = o;
+                      o.box(FL_FLAT_BOX);
+                      o.labelsize(10);
+                      o.labelfont(1);
+                      o.labeltype(FL_NO_LABEL);
+                      o.color(7);
+                    }
+                  }
+                  o.end();
+                  Fl_Group.current().resizable(o);
+                }
+              }
+              o.end();
+              Fl_Group.current().resizable(o);
+            }
+            {
+              local o = Fl_Group(_x + 16, _y + 585, 606, 46);
+              orderTotals = o;
+              o.box(FL_FLAT_BOX);
+              o.color(39);
+              o.labeltype(FL_NO_LABEL);
+              {
+                {
+                  local o = Fl_Box(_x + 17, _y + 586, 65, 20, _tr("PAGE"));
+                  header_PAGENO_box = o;
+                  o.labelsize(12);
+                  o.labelfont(1);
+                  o.box(FL_FLAT_BOX);
+                  o.color(47);
+                }
+                {
+                  local o = Fl_Box(_x + 17, _y + 607, 65, 23);
+                  box_data_pageno_box = o;
+                  o.box(FL_FLAT_BOX);
+                  o.labelsize(12);
+                  o.labelfont(1);
+                  o.labeltype(FL_NO_LABEL);
+                  o.color(7);
+                }
+                {
+                  local o = Fl_Box(_x + 83, _y + 586, 150, 20, _tr("SUBTOTAL"));
+                  header_totals_subtotal_box = o;
+                  o.labelsize(12);
+                  o.labelfont(1);
+                  o.box(FL_FLAT_BOX);
+                  o.color(47);
+                }
+                {
+                  local o = Fl_Box(_x + 83, _y + 607, 150, 23);
+                  data_totals_subtotal_box = o;
+                  o.box(FL_FLAT_BOX);
+                  o.labelsize(12);
+                  o.labelfont(1);
+                  o.labeltype(FL_NO_LABEL);
+                  o.color(7);
+                }
+                {
+                  local o = Fl_Box(_x + 234, _y + 586, 120, 20, _tr("Sales Tax I"));
+                  header_totals_total_sales_tax1_box = o;
+                  o.labelsize(12);
+                  o.labelfont(1);
+                  o.color(47);
+                  o.box(FL_FLAT_BOX);
+                }
+                {
+                  local o = Fl_Box(_x + 234, _y + 607, 120, 23);
+                  data_totals_total_sales_tax1_box = o;
+                  o.box(FL_FLAT_BOX);
+                  o.labelsize(12);
+                  o.labelfont(1);
+                  o.labeltype(FL_NO_LABEL);
+                  o.color(7);
+                }
+                {
+                  local o = Fl_Box(_x + 355, _y + 586, 115, 20, _tr("Sales Tax II"));
+                  header_totals_total_sales_tax2_box = o;
+                  o.labelsize(12);
+                  o.labelfont(1);
+                  o.color(47);
+                  o.box(FL_FLAT_BOX);
+                }
+                {
+                  local o = Fl_Box(_x + 355, _y + 607, 115, 23);
+                  data_totals_total_sales_tax2_box = o;
+                  o.box(FL_FLAT_BOX);
+                  o.labelsize(12);
+                  o.labelfont(1);
+                  o.labeltype(FL_NO_LABEL);
+                  o.color(7);
+                }
+                {
+                  local o = Fl_Box(_x + 471, _y + 586, 150, 20, _tr("TOTAL"));
+                  header_totals_total_box = o;
+                  o.labelsize(12);
+                  o.labelfont(1);
+                  o.box(FL_FLAT_BOX);
+                  o.color(47);
+                }
+                {
+                  local o = Fl_Box(_x + 471, _y + 607, 150, 23);
+                  data_totals_total_box = o;
+                  o.box(FL_FLAT_BOX);
+                  o.labelsize(12);
+                  o.labelfont(1);
+                  o.labeltype(FL_NO_LABEL);
+                  o.color(7);
+                }
+              }
+              o.end();
+            }
+            {
+              local o = Fl_Box(_x + 17, _y + 638, 606, 37);
+              notes_box = o;
+              o.labelfont(2);
+              o.align(144);
+              o.labelsize(9);
+            }
+          }
+          o.end();
+        }
+        {
+          local o = Fl_Group(_x + 3, _y + 0, 628, 637);
+          printDataGroup = o;
+          o.labeltype(FL_NO_LABEL);
+          {
+            {
+              local o = Fl_Box(_x + 338, _y + 10, 139, 20);
+              orderTypeBox = o;
+              o.labelfont(1);
+              o.labelsize(12);
+            }
+            {
+              local o = Fl_Box(_x + 338, _y + 33, 139, 16);
+              numberBox = o;
+              o.labelfont(5);
+              o.labelsize(15);
+              o.align(16);
+            }
+            {
+              local o = Fl_Box(_x + 484, _y + 32, 133, 16);
+              dateBox = o;
+              o.labelfont(5);
+              o.labelsize(15);
+              o.align(16);
+            }
+            {
+              local o = Fl_Box(_x + 338, _y + 57, 282, 82);
+              entityBox = o;
+              o.align(85);
+              o.labelsize(12);
+            }
+            {
+              local o = Fl_Group(_x + 16, _y + 169, 605, 412);
+              dataLinesGroup = o;
+              o.align(16);
+              o.labeltype(FL_NO_LABEL);
+              {
+                {
+                  local o = Fl_Box(_x + 16, _y + 174, 46, 404);
+                  codeBox = o;
+                  o.align(25);
+                  o.labelsize(11);
+                }
+                {
+                  local o = Fl_Box(_x + 64, _y + 174, 300, 404);
+                  descriptionBox = o;
+                  o.align(85);
+                  o.labelsize(11);
+                }
+                {
+                  local o = Fl_Box(_x + 365, _y + 174, 40, 404);
+                  quantityBox = o;
+                  o.align(25);
+                  o.labelsize(11);
+                }
+                {
+                  local o = Fl_Box(_x + 406, _y + 174, 60, 404);
+                  priceBox = o;
+                  o.align(25);
+                  o.labelsize(11);
+                }
+                {
+                  local o = Fl_Box(_x + 467, _y + 174, 30, 404);
+                  discountBox = o;
+                  o.align(25);
+                  o.labelsize(11);
+                }
+                {
+                  local o = Fl_Box(_x + 498, _y + 174, 30, 404);
+                  sales_tax1Box = o;
+                  o.align(25);
+                  o.labelsize(11);
+                }
+                {
+                  local o = Fl_Box(_x + 529, _y + 174, 30, 404);
+                  sales_tax2Box = o;
+                  o.align(25);
+                  o.labelsize(11);
+                }
+                {
+                  local o = Fl_Box(_x + 560, _y + 174, 61, 404);
+                  lineTotalBox = o;
+                  o.align(25);
+                  o.labelsize(11);
+                }
+              }
+              o.end();
+              Fl_Group.current().resizable(o);
+            }
+            {
+              local o = Fl_Group(_x + 16, _y + 585, 605, 48);
+              bottomTotals = o;
+              o.labeltype(FL_NO_LABEL);
+              {
+                {
+                  local o = Fl_Box(_x + 16, _y + 608, 65, 25);
+                  orderPageBox = o;
+                  o.labelfont(5);
+                  o.labelsize(15);
+                }
+                {
+                  local o = Fl_Box(_x + 83, _y + 608, 150, 25);
+                  fisrtTotalBox = o;
+                  o.labelfont(5);
+                  o.labelsize(15);
+                }
+                {
+                  local o = Fl_Box(_x + 234, _y + 608, 120, 25);
+                  sales_tax1AmountBox = o;
+                  o.labelfont(5);
+                  o.labelsize(15);
+                }
+                {
+                  local o = Fl_Box(_x + 355, _y + 608, 115, 25);
+                  sales_tax2AmountBox = o;
+                  o.labelfont(5);
+                  o.labelsize(15);
+                }
+                {
+                  local o = Fl_Box(_x + 500, _y + 608, 121, 25);
+                  totalBox = o;
+                  o.labelfont(5);
+                  o.labelsize(15);
+                }
+              }
+              o.end();
+            }
+          }
+          o.end();
+          Fl_Group.current().resizable(o);
+        }
+      }
+      o.end();
+    }
+  }
+}

+ 828 - 0
SquiLu-ourbiz/orders-edit-gui.fl

@@ -0,0 +1,828 @@
+# data file for the Fltk User Interface Designer (fluid)
+version 1.0302 
+i18n_type 1 
+i18n_include i18n_function.h 
+i18n_function _tr 
+header_name {.h} 
+code_name {.cxx}
+decl {\#include "My_Base_App.h"
+\#include "delivery-calc.h"
+\#include "calendar-gui.h"
+\#include "barchart-gui.h"
+\#include "history-gui.h"
+\#include "print-preview-gui.h"
+class EntitiesListSearchWindow;
+class ProductsListSearchWindow;} {public global
+} 
+
+decl {\#include "entities.h"
+\#include "products.h"} {private local
+} 
+
+widget_class EditOrderWindow {
+  label {Edit Order} open
+  xywh {255 97 800 560} type Double labelsize 16 resizable
+  class Lines_Edit_Base_Window visible
+} {
+  decl {OurDeliveryCalc *delivery_calc_window;
+EntitiesListSearchWindow *entities_list_window;
+ProductsListSearchWindow *products_list_window;
+CalendarWindow *calendar_window;} {protected local
+  }
+  Function {~EditOrderWindow()} {open
+  } {
+    code {delete delivery_calc_window;
+delete products_list_window;
+delete entities_list_window;
+delete calendar_window;} {}
+  }
+  code {delivery_calc_window = 0;
+entities_list_window = 0;
+products_list_window = 0;
+calendar_window = 0;} {}
+  Fl_Group {} {open
+    xywh {5 1 792 62}
+  } {
+    Fl_Output db_orders_mdate {
+      macro_name {db orders mdate}
+      dirty_name db_orders_mdate
+      xywh {670 5 125 25} labeltype NO_LABEL labelsize 16 textsize 16
+      code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+    }
+    Fl_Box db_orders_order_type_id {
+      macro_name {db orders order_type_id}
+      dirty_name db_orders_order_type_id
+      tooltip {Selection of the order type} xywh {5 5 655 25} box DOWN_BOX labeltype NO_LABEL labelfont 1 labelsize 16
+      code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      class Flu_Combo_List
+    }
+    Fl_Pack pack_line2 {open
+      xywh {5 35 790 25} type HORIZONTAL labelsize 16
+      code0 {o->spacing(5);}
+      code1 {o->with_label(1);}
+    } {
+      Fl_Input db_orders_series {
+        label Series
+        macro_name {db orders series}
+        dirty_name db_orders_series
+        xywh {55 35 45 25} labelsize 16 textsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Input db_orders_order_number {
+        label Number
+        macro_name {db orders order_number}
+        dirty_name db_orders_order_number
+        xywh {172 35 95 25} type Int labelsize 16 textsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+        code1 {o->use_numeric_format(0);}
+      }
+      Fl_Input db_orders_entity_id {
+        label Entity
+        macro_name {db orders entity_id}
+        dirty_name db_orders_entity_id
+        xywh {319 35 95 25} type Int labelsize 16 textsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Input db_orders_entity_name {
+        macro_name {db orders entity_name}
+        dirty_name db_orders_entity_name
+        tooltip {Type partal description to search on availlable entities} xywh {420 35 335 25} labeltype NO_LABEL labelsize 16 textfont 1 textsize 16 resizable
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Button btnSearchEntity {
+        label {@<->}
+        tooltip {Show entities search window} xywh {765 35 30 25} labelsize 18 labelcolor 22
+      }
+    }
+  }
+  Fl_Input db_orders_entity_order_number {
+    label {Their Nº}
+    macro_name {db orders entity_order_number}
+    dirty_name db_orders_entity_order_number
+    xywh {585 65 210 25} labelsize 16 textsize 16
+    code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+  }
+  Fl_Tabs tabs {open selected
+    xywh {5 68 790 487} selection_color 4 labelsize 16 labelcolor 7 resizable
+  } {
+    Fl_Group tabMain {
+      label Main open
+      xywh {5 95 790 460} color 246 labelfont 2 labelsize 16 resizable
+    } {
+      Fl_Pack pack_line3 {open
+        xywh {11 105 780 25} type HORIZONTAL labelsize 16
+        code0 {o->spacing(5);}
+        code1 {o->with_label(1);}
+      } {
+        Fl_Output out_lines {
+          label Lines
+          dirty_name out_lines
+          xywh {57 105 69 25} labelsize 16 textsize 16
+          code0 {o->right_to_left(1);}
+        }
+        Fl_Output db_orders_weight_total {
+          label Weight
+          dirty_name db_orders_weight_total
+          xywh {189 105 110 25} labelsize 16 textsize 16
+          code0 {o->right_to_left(1);}
+          code1 {o->decimal_places(-2);}
+          code2 {o->use_numeric_format(1);}
+        }
+        Fl_Button btnCalcDelivery {
+          label {@<->}
+          tooltip {Show delivery calc window} xywh {309 105 30 25} labelsize 18 labelcolor 22
+        }
+        Fl_Choice db_orders_payment_type_id {
+          macro_name {db orders payment_type_id}
+          dirty_name db_orders_payment_type_id
+          xywh {345 105 235 25} down_box BORDER_BOX labeltype NO_LABEL labelsize 16 textfont 1 textsize 16 resizable
+          code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+          class Fl_Choice_Int
+        } {}
+        Fl_Button btnSortLines {
+          label {@2}
+          tooltip {Sort lines by description} xywh {590 105 30 25} labelsize 18 labelcolor 22
+        }
+        Fl_Input db_orders_order_date {
+          macro_name {db orders order_date}
+          dirty_name db_orders_order_date
+          xywh {629 105 120 25} labeltype NO_LABEL labelsize 16 textfont 1 textsize 16
+          code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+        }
+        Fl_Button btnShowCalendar {
+          label {@<->}
+          tooltip {Show calendar} xywh {760 105 30 25} labelsize 18 labelcolor 22
+        }
+      }
+      Fl_Browser grid_lines {
+        dirty_name {@grid_lines}
+        xywh {10 135 780 150} labelsize 16 textsize 16 resizable
+        class Fl_Data_Table
+      }
+      Fl_Group {} {
+        xywh {10 290 781 260}
+      } {
+        Fl_Group group_totals {open
+          xywh {600 291 190 259} box UP_BOX color 174
+        } {
+          Fl_Output db_orders_discount_amt {
+            label Discount
+            macro_name {db orders discount_amt}
+            dirty_name db_orders_discount_amt
+            xywh {685 297 100 25} labelsize 16 textsize 16
+            code0 {o->right_to_left(1);}
+            code1 {o->use_numeric_format(1);}
+            code2 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+          }
+          Fl_Output db_orders_subtotal_amt {
+            label Subtotal
+            macro_name {db orders subtotal_amt}
+            dirty_name db_orders_subtotal_amt
+            xywh {684 326 100 25} labelsize 16 textsize 16
+            code0 {o->right_to_left(1);}
+            code1 {o->use_numeric_format(1);}
+            code2 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+          }
+          Fl_Output db_orders_sales_tax1_amt {
+            label {V.A.T.}
+            macro_name {db orders sales_tax1_amt}
+            dirty_name db_orders_sales_tax1_amt
+            xywh {685 356 100 25} labelsize 16 textsize 16
+            code0 {o->right_to_left(1);}
+            code1 {o->use_numeric_format(1);}
+            code2 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+          }
+          Fl_Output db_orders_sales_tax2_amt {
+            label {R.E.}
+            macro_name {db orders sales_tax2_amt}
+            dirty_name db_orders_sales_tax2_amt
+            xywh {684 386 100 25} labelsize 16 textsize 16
+            code0 {o->right_to_left(1);}
+            code1 {o->use_numeric_format(1);}
+            code2 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+          }
+          Fl_Output db_orders_irpf_amt {
+            label {I.R.P.F.}
+            macro_name {db orders irpf_amt}
+            xywh {685 416 100 25} labelsize 16 textsize 16
+            code0 {o->right_to_left(1);}
+            code1 {o->use_numeric_format(1);}
+            code2 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+          }
+          Fl_Output db_orders_total_amt {
+            label Total
+            macro_name {db orders total_amt}
+            dirty_name db_orders_total_amt
+            xywh {610 453 174 33} color 119 labelfont 1 align 5 textfont 1 textsize 30
+            code0 {o->right_to_left(1);}
+            code1 {o->use_numeric_format(1);}
+            code2 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+          }
+          Fl_Input db_orders_cash {
+            label Cash
+            macro_name {db orders cash}
+            dirty_name db_orders_cash
+            xywh {685 490 100 25} type Float labelfont 1 labelsize 16 textfont 1 textsize 16
+            code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+            class Fl_Float_Input_Fmt
+          }
+          Fl_Output cash_return {
+            label Return
+            dirty_name cash_return
+            xywh {685 520 100 25} labelfont 1 labelsize 16 textfont 1 textsize 16
+            code0 {o->right_to_left(1);}
+            code1 {o->use_numeric_format(1);}
+          }
+        }
+        Fl_Button btnPrint {
+          label Print
+          dirty_name btnPrint
+          xywh {485 525 100 25} labelsize 16
+          class My_Fl_Return_Button
+        }
+        Fl_Tabs linesTab {
+          dirty_name linesTab open
+          xywh {10 290 585 230} selection_color 4 labelfont 2 labelsize 16 labelcolor 7
+        } {
+          Fl_Group group_lines {
+            label {Line Edit} open
+            xywh {10 321 585 199} box UP_BOX color 166 labelfont 2 labelsize 16
+          } {
+            Fl_Output db_orders_lines_batch_order_line_quantity {
+              label {Batch Qty.}
+              macro_name {db orders_lines batch_order_line_quantity}
+              xywh {265 330 110 25} labelsize 16 textsize 16
+              code0 {o->right_to_left(1);}
+              code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+            }
+            Fl_Input db_orders_lines_batch_order_line_id {
+              label {Batch \#}
+              macro_name {db orders_lines batch_order_line_id}
+              xywh {435 329 110 25} type Int labelsize 16 textsize 16
+              code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+            }
+            Fl_Button btnSearchBatchOrderLineId {
+              label {@<->}
+              dirty_name btnSearchBatchOrderLineId
+              tooltip {Show products search window} xywh {555 329 30 25} labelsize 18 labelcolor 22
+            }
+            Fl_Output db_orders_lines_xref_order_line_quantity {
+              label {XRef. Qty.}
+              macro_name {db orders_lines xref_order_line_quantity}
+              xywh {265 360 110 25} labelsize 16 textsize 16
+              code0 {o->right_to_left(1);}
+              code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+            }
+            Fl_Input db_orders_lines_xref_order_line_id {
+              label {XRef \#}
+              macro_name {db orders_lines xref_order_line_id}
+              xywh {435 359 110 25} type Int labelsize 16 textsize 16
+              code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+            }
+            Fl_Button btnSearchXrefOrderLineId {
+              label {@<->}
+              dirty_name btnSearchXrefOrderLineId
+              tooltip {Show products search window} xywh {555 359 30 25} labelsize 18 labelcolor 22
+            }
+            Fl_Input db_orders_lines_product_id {
+              label Code
+              macro_name {db orders_lines product_id}
+              dirty_name db_orders_lines_product_id
+              xywh {21 387 70 25} type Int labelsize 16 align 5 textsize 16
+              code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+            }
+            Fl_Input db_orders_lines_description {
+              label Description
+              macro_name {db orders_lines description}
+              dirty_name db_orders_lines_description
+              tooltip {Type partal description to search on availlable products} xywh {101 387 444 25} labelsize 16 align 5 textfont 1 textsize 16
+              code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+            }
+            Fl_Button btnSearchProduct {
+              label {@<->}
+              tooltip {Show products search window} xywh {555 387 30 25} labelsize 18 labelcolor 22
+            }
+            Fl_Input db_orders_lines_quantity {
+              label Quantity
+              macro_name {db orders_lines quantity}
+              dirty_name db_orders_lines_quantity
+              xywh {21 435 84 25} type Float labelfont 1 labelsize 16 align 5 textfont 1 textsize 16
+              code0 {o->decimal_places(-6);}
+              code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+              class My_Fl_Float_Input
+            }
+            Fl_Input db_orders_lines_price {
+              label Price
+              macro_name {db orders_lines price}
+              xywh {115 435 108 25} type Float labelfont 1 labelsize 16 align 5 textfont 1 textsize 16
+              code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+              class My_Fl_Float_Input
+            }
+            Fl_Input db_orders_lines_price_decimals {
+              label {(.)}
+              macro_name {db orders_lines price_decimals}
+              tooltip {Number of decimals to use on calculations} xywh {230 435 20 25} type Int labelsize 16 align 1 textsize 16
+              code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+            }
+            Fl_Input db_orders_lines_weight {
+              label Weight
+              macro_name {db orders_lines weight}
+              xywh {255 435 70 25} type Float labelsize 16 align 5 textsize 16
+              code0 {o->decimal_places(-6);}
+              code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+              class My_Fl_Float_Input
+            }
+            Fl_Input db_orders_lines_first_total {
+              label {1st total}
+              macro_name {db orders_lines first_total}
+              xywh {330 435 100 25} type Float labelsize 16 align 5 textsize 16
+              code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+              class Fl_Float_Input_Fmt
+            }
+            Fl_Input db_orders_lines_discount_pct {
+              label {Disc. %}
+              macro_name {db orders_lines discount_pct}
+              xywh {435 435 60 25} type Float labelsize 16 align 5 textsize 16
+              code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+              class My_Fl_Float_Input
+            }
+            Fl_Input db_orders_lines_discount_amt {
+              label {Disc. $}
+              macro_name {db orders_lines discount_amt}
+              xywh {505 435 80 25} type Float labelsize 16 align 5 textsize 16
+              code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+              class Fl_Float_Input_Fmt
+            }
+            Fl_Input db_orders_lines_line_subtotal {
+              label Subtotal
+              macro_name {db orders_lines line_subtotal}
+              xywh {21 485 108 25} type Float labelsize 16 align 5 textsize 16
+              code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+              class Fl_Float_Input_Fmt
+            }
+            Fl_Input db_orders_lines_sales_tax2_pct {
+              label {R.E. %}
+              macro_name {db orders_lines sales_tax2_pct}
+              xywh {139 485 64 25} type Float labelsize 16 align 5 textsize 16
+              code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+              class Fl_Float_Input_Fmt
+            }
+            Fl_Input db_orders_lines_sales_tax1_pct {
+              label {V.A.T. %}
+              macro_name {db orders_lines sales_tax1_pct}
+              xywh {213 485 64 25} type Float labelsize 16 align 5 textsize 16
+              code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+              class Fl_Float_Input_Fmt
+            }
+            Fl_Input db_orders_lines_sales_tax1_amt {
+              label {V.A.T. $}
+              macro_name {db orders_lines sales_tax1_amt}
+              xywh {287 485 87 25} type Float labelsize 16 align 5 textsize 16
+              code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+              class Fl_Float_Input_Fmt
+            }
+            Fl_Button btnSaveLine {
+              label Save
+              tooltip {Save the line currently edited} xywh {384 485 83 25} labelfont 1 labelsize 16
+              class My_Fl_Return_Button
+            }
+            Fl_Input db_orders_lines_line_total {
+              label Total
+              macro_name {db orders_lines line_total}
+              xywh {477 485 108 25} type Float labelfont 1 labelsize 16 align 5 textfont 1 textsize 16
+              code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+              class Fl_Float_Input_Fmt
+            }
+          }
+          Fl_Group tabLineNotes {
+            label {Line Notes}
+            dirty_name tabLineNotes open
+            xywh {10 320 585 200} labelfont 2 labelsize 16 hide
+          } {
+            Fl_Input db_orders_lines_notes {
+              label Notes
+              macro_name {db orders_lines notes}
+              dirty_name db_orders_lines_description
+              tooltip {Type partial description to search on availlable products} xywh {80 330 505 180} type Multiline labelsize 16 textsize 16
+              code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+            }
+          }
+          Fl_Group tabDues {
+            label Dues
+            dirty_name tabDues open
+            xywh {10 320 585 200} labelfont 2 labelsize 16 hide
+          } {
+            Fl_Browser grid_dues {
+              dirty_name grid_dues
+              xywh {15 330 575 130} labelsize 16 textsize 16
+              class Fl_Data_Table
+            }
+            Fl_Output due_id {
+              label ID
+              dirty_name due_id
+              xywh {15 485 80 25} labelsize 16 align 5 textsize 16
+              code0 {o->right_to_left(1);}
+            }
+            Fl_Input due_date {
+              label Due
+              dirty_name due_date
+              xywh {100 485 125 25} labelsize 16 align 5 textfont 1 textsize 16
+            }
+            Fl_Button btnShowCalendarDueDate {
+              label {@<->}
+              dirty_name btnShowCalendarDueDate
+              tooltip {Show calendar} xywh {230 485 30 25} labelsize 18 labelcolor 22
+            }
+            Fl_Input due_pct {
+              label {Pct. %}
+              dirty_name due_pct
+              xywh {270 485 80 25} type Float labelfont 1 labelsize 16 align 5 textfont 1 textsize 16
+              class Fl_Float_Input_Fmt
+            }
+            Fl_Input due_amount {
+              label Amount
+              dirty_name due_amount
+              xywh {355 485 120 25} type Float labelfont 1 labelsize 16 align 5 textfont 1 textsize 16
+              class Fl_Float_Input_Fmt
+            }
+            Fl_Button btnDueSave {
+              label Save
+              dirty_name btnDueSave
+              xywh {485 485 100 25} labelsize 16
+              class My_Fl_Return_Button
+            }
+          }
+          Fl_Group tabPayments {
+            label Payments
+            dirty_name tabPayments open
+            xywh {10 320 585 200} labelfont 2 labelsize 16 hide
+          } {
+            Fl_Browser grid_payments {
+              dirty_name grid_payments
+              xywh {15 330 575 130} labelsize 16 textsize 16
+              class Fl_Data_Table
+            }
+            Fl_Output payment_id {
+              label ID
+              dirty_name payment_id
+              xywh {15 485 80 25} labelsize 16 align 5 textsize 16
+              code0 {o->right_to_left(1);}
+            }
+            Fl_Input payment_date {
+              label Date
+              dirty_name payment_date
+              xywh {100 485 125 25} labelsize 16 align 5 textfont 1 textsize 16
+            }
+            Fl_Button btnShowCalendarPaymentDate {
+              label {@<->}
+              dirty_name btnShowCalendarPaymentDate
+              tooltip {Show calendar} xywh {230 485 30 25} labelsize 18 labelcolor 22
+            }
+            Fl_Input payemnt_amount {
+              label Amount
+              dirty_name payemnt_amount
+              xywh {270 485 120 25} type Float labelfont 1 labelsize 16 align 5 textfont 1 textsize 16
+              class Fl_Float_Input_Fmt
+            }
+            Fl_Button btnPaymentSave {
+              label Save
+              dirty_name btnPaymentSave
+              xywh {395 485 100 25} labelsize 16
+              class My_Fl_Return_Button
+            }
+          }
+        }
+      }
+      Fl_Button btnNumberOrder {
+        label Number
+        dirty_name btnNumberOrder
+        xywh {230 525 82 25} labelsize 16
+        class My_Fl_Return_Button
+      }
+      Fl_Choice dbAction {
+        dirty_name {@dbAction} open
+        xywh {9 525 119 25} down_box BORDER_BOX labeltype NO_LABEL labelsize 16 textsize 16
+      } {}
+      Fl_Button btnDbAction {
+        label Action
+        dirty_name {@btnDbAction}
+        tooltip {Perform the selected action on this order} xywh {138 525 82 25} labelfont 1 labelsize 16
+        class My_Fl_Return_Button
+      }
+    }
+    Fl_Group tabDelivery {
+      label Delivery
+      xywh {5 95 790 460} color 246 labelfont 2 labelsize 16 hide
+    } {
+      Fl_Input db_orders_entity_address {
+        label Address
+        macro_name {db orders entity_address}
+        dirty_name db_orders_entity_address
+        xywh {91 105 694 25} labelsize 16 textsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Input db_orders_entity_zip {
+        label ZIP
+        macro_name {db orders entity_zip}
+        dirty_name db_orders_entity_zip
+        xywh {91 135 95 25} labelsize 16 textsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Input db_orders_entity_city {
+        label City
+        macro_name {db orders entity_city}
+        dirty_name db_orders_entity_city
+        xywh {288 135 497 25} labelsize 16 textsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Input db_orders_entity_state {
+        label State
+        macro_name {db orders entity_state}
+        dirty_name db_orders_entity_state
+        xywh {91 165 407 25} labelsize 16 textsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Input db_orders_entity_country {
+        label Country
+        macro_name {db orders entity_country}
+        dirty_name db_orders_entity_country
+        xywh {585 165 201 25} labelsize 16 textsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Input db_orders_entity_phone {
+        label Phone
+        macro_name {db orders entity_phone}
+        dirty_name db_orders_entity_phone
+        xywh {91 195 201 25} labelsize 16 textsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Input db_orders_entity_tax_number {
+        label {Tax Num.}
+        macro_name {db orders entity_tax_number}
+        dirty_name db_orders_entity_tax_number
+        xywh {585 195 200 25} labelsize 16 textsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Input db_orders_order_valid_till_date {
+        label {Valid till}
+        macro_name {db orders order_valid_till_date}
+        xywh {90 225 121 25} labelsize 16 textsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Button btnShowCalendarValidTill {
+        label {@<->}
+        dirty_name btnShowCalendarValidTill
+        tooltip {Show calendar} xywh {221 225 30 25} labelsize 18 labelcolor 22
+      }
+      Fl_Check_Button db_orders_entity_use_sales_tax2 {
+        label {Use Sales Tax II}
+        macro_name {db orders entity_use_sales_tax2}
+        dirty_name db_orders_entity_use_sales_tax2
+        xywh {585 225 155 25} down_box DOWN_BOX labelsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Check_Button db_orders_entity_sales_tax_exempt {
+        label {Sales Tax Exempt}
+        macro_name {db orders entity_sales_tax_exempt}
+        dirty_name db_orders_entity_sales_tax_exempt
+        xywh {585 255 155 25} down_box DOWN_BOX labelsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Text_Editor db_orders_notes {
+        label Notes
+        macro_name {db orders notes}
+        dirty_name db_orders_notes
+        xywh {15 395 770 150} labelsize 16 align 5 textsize 16 resizable
+        code0 {\#include <FL/Fl_Text_Editor.H>}
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+        class Fl_Text_Editor_Buffered
+      }
+      Fl_Check_Button {} {
+        label {Wrap lines}
+        callback {db_orders_notes->wrap_mode(o->value(), 0);}
+        xywh {125 375 125 25} down_box DOWN_BOX value 1 labelsize 16
+      }
+      Fl_Input db_orders_irpf_pct_retention {
+        label {I.R.P.F. %}
+        macro_name {db orders irpf_pct_retention}
+        xywh {585 285 70 25} type Float labelsize 16 align 8 textsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+        class Fl_Float_Input_Fmt
+      }
+    }
+    Fl_Group tabOptions {
+      label Options
+      dirty_name tabOptions
+      xywh {5 95 790 460} color 246 labelfont 2 labelsize 16 hide
+    } {
+      Fl_Check_Button opt_ask_for_printer {
+        label {Ask for printer}
+        dirty_name opt_ask_for_printer
+        xywh {20 115 155 25} down_box DOWN_BOX labelsize 16
+      }
+      Fl_Check_Button opt_print_only_data {
+        label {Print only data}
+        dirty_name opt_print_only_data
+        xywh {20 150 155 25} down_box DOWN_BOX labelsize 16
+      }
+      Fl_Check_Button opt_print_to_pdf {
+        label {Print to PDF}
+        dirty_name opt_print_to_pdf
+        xywh {20 180 155 25} down_box DOWN_BOX labelsize 16
+      }
+      Fl_Choice opt_print_page_format {
+        dirty_name opt_print_page_format
+        xywh {20 215 130 25} down_box BORDER_BOX labeltype NO_LABEL labelsize 16 textsize 16
+        class Fl_Choice_Str
+      } {}
+      Fl_Button btnOptPrint {
+        label Print
+        dirty_name btnOptPrint
+        tooltip {Print the current order} xywh {20 250 130 25} labelsize 16
+      }
+      Fl_Input opt_email_program {
+        label {Email program}
+        dirty_name opt_email_program
+        tooltip {Type partal description to search on availlable entities} xywh {260 145 520 25} labelsize 16 align 5 textsize 16
+      }
+      Fl_Input opt_email_program_command {
+        label {Email program parameters}
+        dirty_name opt_email_program_command
+        tooltip {Type partal description to search on availlable entities} xywh {260 210 520 25} labelsize 16 align 5 textsize 16
+      }
+      Fl_Button btnOptSendEmail {
+        label {Send as email}
+        dirty_name btnOptSendEmail
+        tooltip {Print the current order} xywh {260 250 130 25} labelsize 16
+      }
+      Fl_Text_Editor opt_print_order_company_info {
+        label {Company Info}
+        dirty_name opt_print_order_company_info
+        xywh {20 350 375 200} labelsize 16 align 5 textsize 16
+        code0 {\#include <FL/Fl_Text_Editor.H>}
+        class Fl_Text_Editor_Buffered
+      }
+      Fl_Check_Button {} {
+        label {Wrap lines}
+        callback {opt_print_order_company_info->wrap_mode(o->value(), 0);}
+        xywh {200 330 125 25} down_box DOWN_BOX value 1 labelsize 16
+      }
+      Fl_Text_Editor opt_print_order_bottom_info {
+        label {Company Info}
+        dirty_name opt_print_order_bottom_info
+        xywh {405 350 375 200} labelsize 16 align 5 textsize 16 resizable
+        code0 {\#include <FL/Fl_Text_Editor.H>}
+        class Fl_Text_Editor_Buffered
+      }
+      Fl_Check_Button {} {
+        label {Wrap lines}
+        callback {opt_print_order_bottom_info->wrap_mode(o->value(), 0);}
+        xywh {590 330 125 25} down_box DOWN_BOX value 1 labelsize 16
+      }
+    }
+    Fl_Group tabChartStatistics {
+      label Statistics open
+      xywh {5 95 790 460} color 246 labelfont 2 labelsize 16 hide
+    } {}
+    Fl_Group tabHistory {
+      label History open
+      xywh {5 95 790 460} color 246 labelfont 2 labelsize 16 hide
+    } {}
+    Fl_Group tabPrintPreview {
+      label Preview open
+      xywh {5 95 790 460} color 246 labelfont 2 labelsize 16 hide
+    } {}
+    Fl_Group tabTotals {
+      label Totals
+      dirty_name tabTotals
+      xywh {5 95 790 460} color 246 labelfont 2 labelsize 16 hide
+    } {
+      Fl_Input totals_balance {
+        label Balance
+        dirty_name totals_balance
+        xywh {145 155 110 25} type Float labelsize 16 textsize 16
+        class Fl_Float_Input_Fmt
+      }
+      Fl_Input db_totals_overview_sales_quoted {
+        label {Sales Quoted}
+        macro_name {db totals_overview sales_quoted}
+        xywh {145 200 110 25} type Float labelsize 16 textsize 16
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+        class Fl_Float_Input_Fmt
+      }
+      Fl_Input db_totals_overview_sales_ordered {
+        label {Sales Ordered}
+        macro_name {db totals_overview sales_ordered}
+        xywh {145 235 110 25} type Float labelsize 16 textsize 16
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+        class Fl_Float_Input_Fmt
+      }
+      Fl_Input db_totals_overview_sales_delivered {
+        label {Sales Delivered}
+        macro_name {db totals_overview sales_delivered}
+        xywh {145 270 110 25} type Float labelsize 16 textsize 16
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+        class Fl_Float_Input_Fmt
+      }
+      Fl_Input db_totals_overview_sales_invoiced {
+        label {Sales Invoiced}
+        macro_name {db totals_overview sales_invoiced}
+        xywh {145 305 110 25} type Float labelsize 16 textsize 16
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+        class Fl_Float_Input_Fmt
+      }
+      Fl_Input db_totals_overview_sales_discount {
+        label {Sales Discount}
+        macro_name {db totals_overview sales_discount}
+        xywh {145 340 110 25} type Float labelsize 16 textsize 16
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+        class Fl_Float_Input_Fmt
+      }
+      Fl_Input db_totals_overview_sales_tax1 {
+        label {Sales Tax1}
+        macro_name {db totals_overview sales_tax1}
+        xywh {145 375 110 25} type Float labelsize 16 textsize 16
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+        class Fl_Float_Input_Fmt
+      }
+      Fl_Input db_totals_overview_sales_tax2 {
+        label {Sales Tax2}
+        macro_name {db totals_overview sales_tax2}
+        xywh {145 410 110 25} type Float labelsize 16 textsize 16
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+        class Fl_Float_Input_Fmt
+      }
+      Fl_Input db_totals_overview_sales_paid {
+        label {Sales Paid}
+        macro_name {db totals_overview sales_paid}
+        xywh {145 445 110 25} type Float labelsize 16 textsize 16
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+        class Fl_Float_Input_Fmt
+      }
+      Fl_Button btnRefreshTotals {
+        label Refresh
+        dirty_name btnRefreshTotals
+        xywh {415 155 110 25} labelsize 16
+        class My_Fl_Return_Button
+      }
+      Fl_Input db_totals_overview_buys_quoted {
+        label {Buys Quoted}
+        macro_name {db totals_overview buys_quoted}
+        xywh {415 200 110 25} type Float labelsize 16 textsize 16
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+        class Fl_Float_Input_Fmt
+      }
+      Fl_Input db_totals_overview_buys_ordered {
+        label {Buys Ordered}
+        macro_name {db totals_overview buys_ordered}
+        xywh {415 235 110 25} type Float labelsize 16 textsize 16
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+        class Fl_Float_Input_Fmt
+      }
+      Fl_Input db_totals_overview_buys_received {
+        label {Buys Received}
+        macro_name {db totals_overview buys_received}
+        xywh {415 270 110 25} type Float labelsize 16 textsize 16
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+        class Fl_Float_Input_Fmt
+      }
+      Fl_Input db_totals_overview_buys_invoiced {
+        label {Buys Invoiced}
+        macro_name {db totals_overview buys_invoiced}
+        xywh {415 305 110 25} type Float labelsize 16 textsize 16
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+        class Fl_Float_Input_Fmt
+      }
+      Fl_Input db_totals_overview_buys_discount {
+        label {Buys Discount}
+        macro_name {db totals_overview buys_discount}
+        xywh {415 340 110 25} type Float labelsize 16 textsize 16
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+        class Fl_Float_Input_Fmt
+      }
+      Fl_Input db_totals_overview_buys_tax1 {
+        label {Buys Tax1}
+        macro_name {db totals_overview buys_tax1}
+        xywh {415 375 110 25} type Float labelsize 16 textsize 16
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+        class Fl_Float_Input_Fmt
+      }
+      Fl_Input db_totals_overview_buys_tax2 {
+        label {Buys Tax2}
+        macro_name {db totals_overview buys_tax2}
+        xywh {415 410 110 25} type Float labelsize 16 textsize 16
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+        class Fl_Float_Input_Fmt
+      }
+      Fl_Input db_totals_overview_buys_paid {
+        label {Buys Paid}
+        macro_name {db totals_overview buys_paid}
+        xywh {415 445 110 25} type Float labelsize 16 textsize 16
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+        class Fl_Float_Input_Fmt
+      }
+    }
+  }
+  code {db_orders_order_type_id->textfont(db_orders_order_type_id->labelfont());
+db_orders_order_type_id->textsize(db_orders_order_type_id->labelsize());} {}
+} 

+ 200 - 19
SquiLu-ourbiz/ourbiz-fltk.nut

@@ -111,6 +111,69 @@ class Fl_Multiline_Output extends Fl_Output {
 	}
 }
 
+class MyFl_Text_Editor extends Fl_Text_Editor_Buffered
+{
+	constructor(px, py, pw, ph, pl = null){
+		base.constructor(px, py, pw, ph, pl);
+	}
+/*
+	function handle(event){
+		if(event == FL_KEYBOARD){
+			local pos, line;
+			switch(Fl.event_key()){
+				case FL_Up:
+					pos = insert_position();
+					if ( pos == 0 ){
+						if(position_to_line( pos, &line ) && (line == 0)){
+						return Fl_Group::handle(event);
+					}
+				}
+				break;
+			}
+		}
+		return base.handle(event);
+	}
+*/
+};
+
+class MyTree_Browser extends Flu_Tree_Browser {
+
+	constructor(px, py, pw, ph, pl = null){
+		base.constructor(px, py, pw, ph, pl);
+	}
+
+	function handle(event){
+		if(event == FL_PUSH){
+		    if( Fl.event_clicks() > 0 )
+		    {
+			Fl.event_clicks(0);
+			local node = get_hilighted();
+			if(node){
+			    node->do_callback(FLU_DOUBLE_CLICK);
+			    return 1;
+			}
+		    }
+		}
+
+		local result = base.handle(event);
+
+		if(event == FL_KEYBOARD)
+		{
+		    switch(Fl.event_key())
+		    {
+		    case FL_Key_Space:
+		    case FL_Enter:
+		    case FL_KP_Enter:
+			local node = get_hilighted();
+			if(node) node->do_callback(FLU_DOUBLE_CLICK);
+		    break;
+		    }
+		}
+
+		return result;
+	}
+};
+
 class Fl_Box_ClearLabel extends Fl_Box {
 	constructor(px, py, pw, ph, pl=null){
 		base.constructor(px, py, pw, ph, pl);
@@ -398,15 +461,20 @@ class MyBaseWindow extends Fl_Window {
 	}
 	
 	function setup_tree_browser_for_selection (tree) {
+		local node = tree->get_root();
+		if(node) node->always_open(true);
 		tree->show_root(true);
 		tree->auto_branches(true);
 		tree->show_branches(true);
+		tree->show_leaves(true);
 		tree->all_branches_always_open(true);
-		//tree->selection_mode(FLU_MULTI_SELECT);
-		tree->selection_mode(FLU_SINGLE_SELECT);
 		tree->branch_text(tree->labelcolor(), tree->labelfont(), tree->labelsize());
 		tree->leaf_text(tree->labelcolor(), tree->labelfont(), tree->labelsize());
+		//tree->selection_mode(FLU_MULTI_SELECT);
+		tree->selection_mode(FLU_SINGLE_SELECT);
+		tree->selection_drag_mode(FLU_DRAG_TO_SELECT);
 		tree->shaded_entry_colors( FL_WHITE, FL_GRAY );
+		tree->selection_follows_hilight( true );
 	}
 	
 	function treeLoadChilds (tree, node, parent, _table_name)
@@ -687,14 +755,14 @@ class EditWindow extends MyBaseWindow {
 	function do_refresh(){/*fl_alert("do_delete");*/}
 	function do_copy(){/*fl_alert("do_delete");*/}
 	
-	function dbUpdater(dbu){
-		_dbUpdater = dbu;
-	}
-
-	function dbUpdater(){
+	function dbUpdater(dbu=null){
+		if(dbu){
+			_dbUpdater = dbu;
+			return;
+		}
 		if(!_dbUpdater) _dbUpdater = new DBUpdateByWidget();
 		return _dbUpdater;
-	}	
+	}
 }
 
 enum Fl_Data_Table_Events {e_none, e_event, e_select, e_insert, e_update, e_delete};
@@ -1003,6 +1071,7 @@ dofile("base-report-A4.nut");
 dofile("invoice-A4.nut");
 dofile("order-page-gui.nut");
 dofile("print-preview-gui.nut");
+dofile("groups-tree-gui.nut");
 dofile("product-kit-gui.nut");
 dofile("product-prices-gui.nut");
 dofile("edit-product-window.nut");
@@ -1071,6 +1140,11 @@ class MyListSearchWindow extends ListSearch {
 		grid->_call_this = this;
 		btnSelect->deactivate();
 		btnNotes.callback(show_help_window);
+		btnUpdate.callback(cb_btnUpdate);
+		btnInsert.callback(cb_btnInsert);
+		btnSelect.callback(cb_btnSelect);
+		btnSearch.callback(cb_btnSearch);
+		search_str.callback(cb_search_str);
 	}
 
 	function cb_btnUpdate(sender, udata){
@@ -1197,14 +1271,7 @@ class MyListSearchWindow extends ListSearch {
 
 		ctree->textfont(ctree->labelfont());
 		ctree->textsize(ctree->labelsize());
-
-		local tree = ctree->tree();
-		tree.auto_branches(true);
-		tree.show_branches(true);
-		tree.all_branches_always_open(true);
-		tree.branch_text(ctree->labelcolor(), ctree->labelfont(), ctree->labelsize());
-		tree.leaf_text(ctree->labelcolor(), ctree->labelfont(), ctree->labelsize());
-		tree.shaded_entry_colors( FL_WHITE, FL_GRAY );
+		setup_tree_browser_for_selection(ctree->tree());
 		//tree.label("----");
 
 		ctree.callback(on_filter);
@@ -1212,6 +1279,113 @@ class MyListSearchWindow extends ListSearch {
 	}
 }
 
+class OurTreeGroups extends GroupsListEditWindow {
+	static GroupDbUpdater = class extends DBUpdateByWidget {
+		constructor(){
+			base.constructor();
+		}
+		function get_fields_map_name(){
+			return "group";
+		}
+	};
+	_table_name = null;
+	
+	constructor(){
+		base.constructor();
+		setup_tree_browser_for_selection(tree);
+		tree.callback(on_tree_cb);
+		btnWrapNotes.callback(on_wrap_notes_cb);
+		btnWrapNotes->do_callback();
+		setDbActionControls(dbAction, btnDbAction);
+		dbAction->action(DbAction_Enum.e_insert);
+		on_Change_dbAction();
+	}
+	
+	function dbUpdater(dbu=null){
+		if(dbu){
+			_dbUpdater = dbu;
+			return;
+		}
+		if(!_dbUpdater) _dbUpdater = new GroupDbUpdater();
+		return _dbUpdater;
+	}		
+
+	function on_tree_cb(sender, udata)
+	{
+		this = sender->window();
+		local tree = sender;
+		local reason = tree->callback_reason();
+		local node = tree->callback_node();
+		switch(reason)
+		{
+		//case FLU_HILIGHTED:
+		//case FLU_UNHILIGHTED:
+		//case FLU_SELECTED:
+		//case FLU_UNSELECTED:
+		//case FLU_OPENED:
+		//case FLU_CLOSED:
+		case FLU_DOUBLE_CLICK:
+		//case FLU_WIDGET_CALLBACK:
+		//case FLU_MOVED_NODE:
+		//case FLU_NEW_NODE:
+		    //Flu_Tree_Browser::Node *node = tree->get_hilighted();
+		    if(node) do_edit(node->user_data().tointeger());
+		break;
+		}
+	}
+
+	function do_edit(id)
+	{
+		if(!_table_name) return;
+		local cursor_wait = fl_cursor_wait();
+		base.do_edit(id);
+		appServer.get_record(_record, dbUpdater()->table_name, 0, id);
+		fill_edit_form();
+		delayed_focus(db_group_description);
+	}
+
+	function on_btnDbAction()
+	{
+		base.on_btnDbAction();
+		treeLoadChilds(tree, 0, 0, _table_name);
+
+		fill_edit_form(true);
+		dbAction->action(DbAction_Enum.e_insert);
+		on_Change_dbAction();
+		delayed_focus(db_group_description);
+	}
+	
+	function on_wrap_notes_cb(sender, udata)
+	{
+		this = sender->window();
+		db_group_notes->wrap_mode(btnWrapNotes->value(), 0);
+	}
+}
+
+class OurProductGroups extends OurTreeGroups
+{
+	constructor(){
+		base.constructor();
+		label(_tr("Product Groups List/Edit"));
+		_table_name = "product_groups";
+		dbUpdater()->table_name = _table_name;
+		treeLoadChilds(tree, 0, 0, _table_name);
+		//tree->label( _tr("Product Groups") );
+	}
+};
+
+class OurEntityGroups extends OurTreeGroups
+{
+	constructor(){
+		base.constructor();        
+		label(_tr("Entity Groups List/Edit"));
+		_table_name = "entity_groups";
+		dbUpdater()->table_name = _table_name;
+		treeLoadChilds(tree, 0, 0, _table_name);
+		//tree->label( _tr("Entity Groups") );
+	}
+};
+
 
 dofile("sales-tax-window.nut");
 
@@ -1585,6 +1759,8 @@ class MyEditProductWindow extends EditProductWindow {
 
 		_ourProductPrices = new ProductPricesGroup();
 		replace_widget_for(productPrices, _ourProductPrices);
+		
+		tabsMoreData.callback(tabsMoreData_cb);
 
 		load_aux_data();
 	}
@@ -1604,7 +1780,7 @@ class MyEditProductWindow extends EditProductWindow {
 	function load_aux_data(){
 		local tree = db_products_group_id;
 		setup_tree_browser_for_selection(tree);
-		treeLoadChilds(tree, null, 0, "product_groups");
+		treeLoadChilds(tree, 0, 0, "product_groups");
 
 		local sales_tax_data = [], measure_units_data = [], warranty_data = [];
 
@@ -1620,6 +1796,12 @@ class MyEditProductWindow extends EditProductWindow {
 		fill_choice_by_data(db_products_warranty_id, warranty_data);
 	}
 	
+	function tabsMoreData_cb(sender, udata){
+		this = sender->window();
+		if(tabsMoreData->value() == tabGroups){
+			//db_products_group_id.redraw();
+		}
+	}
 	function on_show_chart_cb(sender, udata){
 		this = sender->window();
 		local cursor_wait = fl_cursor_wait();
@@ -1681,13 +1863,12 @@ class ProductsListSearch extends MyListSearchWindow {
 		_search_by_description->setonly();
 		_search_by_active->value(1);
 		if(doInitialSearch) delayed_method_call(this, this.fill_grid, null);
-		delayed_method_call(this, this.fill_group_filter, 0);
 	}
 
 	function fill_group_filter(udata)
 	{
 		local tree = group_filter->tree();
-		treeLoadChilds(tree, null, 0, "product_groups");
+		treeLoadChilds(tree, 0, 0, "product_groups");
 		tree->label("----");
 	}
 

+ 79 - 49
SquiLu-ourbiz/ourbiz.nut

@@ -1402,6 +1402,83 @@ db_ourbiz_tables.sales_tax_rates <- new DB_sales_tax_rates();
 
 db_ourbiz_tables.warranty_types <- new DB_Manager("warranty_types")
 
+class DB_groups_tree extends DB_Manager
+{
+	constructor(){
+		base.constructor("groups_tree", ["description", "parent_id", "notes"]);
+	}
+
+	function dump_group_tree_childs(parent, out_result, parent_map, data_map){
+		for(int_t iter=0, count = parent_map.len(); iter < count; ++iter){
+			if (parent_map[iter][0] == parent){
+				for (local found=iter, parent_count = parent_map.len(); found < parent_count; ++found){
+					local map = parent_map[found];
+					local id = map[1];
+					local myparent = map[0];
+					//debug_print(myparent, "\t", parent, "\n");
+					if (myparent != parent) break;
+					out_result.write("[");
+					add2sle(out_result, id.tostring());
+					add2sle(out_result, myparent.tostring());
+					add2sle(out_result, data_map[id]);
+					out_result.writen(SLE_SLEEND, 'c');
+					out_result.write("]");
+					dump_group_tree_childs(id, out_result, parent_map, data_map);
+				}
+				break;
+			}
+		}
+	}
+
+	function group_dump_data(db, out_result, tbl){
+		out_result.clear();
+		local parent_map = [];
+		local  group_map = {};
+		local id, parent_id;
+		local stmt = db.prepare(format("select id, parent_id, description from %s order by 3", tbl));
+		while (stmt.next_row()) {
+			id = stmt.col(0);
+			parent_id = stmt.col(1);
+			if (type(parent_id) != "integer") parent_id = 0;
+			//debug_print("\n", parent_id, "\t", id);
+			parent_map.push([parent_id, id]);
+			group_map[id] <- stmt.col(2);
+		}
+		parent_map.sort(@(a,b) a[0] <=> b[0] );
+		out_result.write("[[");
+		add2sle(out_result, "id");
+		add2sle(out_result, "parent_id");
+		add2sle(out_result, "description");
+		out_result.writen(SLE_SLEEND, 'c');
+		out_result.write("]");
+		dump_group_tree_childs(0, out_result, parent_map, group_map);
+		out_result.write("]");
+	}
+
+	function get_list(db, mFile)
+	{
+		group_dump_data(db, mFile, table_name);
+	};
+};
+
+class DB_product_groups extends DB_groups_tree
+{
+	constructor(){
+		base.constructor();
+		table_name = "product_groups";
+	}
+};
+db_ourbiz_tables.product_groups <- new DB_product_groups();
+
+class DB_entity_groups  extends DB_groups_tree
+{
+	constructor(){
+		base.constructor();
+		table_name = "entity_groups";
+	}
+};
+db_ourbiz_tables.entity_groups <- new DB_entity_groups();
+
 
 function product_prices_list_sql (product_id){
 	product_id = product_id.tointeger();
@@ -1457,53 +1534,6 @@ function add2sle(out_result, str){
 	out_result.write(get_sle_size(str.len()), str);
 }
 
-function dump_group_tree_childs(parent, out_result, parent_map, data_map){
-	for(int_t iter=0, count = parent_map.len(); iter < count; ++iter){
-		if (parent_map[iter][0] == parent){
-			for (local found=iter, parent_count = parent_map.len(); found < parent_count; ++found){
-				local map = parent_map[found];
-				local id = map[1];
-				local myparent = map[0];
-				//debug_print(myparent, "\t", parent, "\n");
-				if (myparent != parent) break;
-				out_result.write("[");
-				add2sle(out_result, id.tostring());
-				add2sle(out_result, myparent.tostring());
-				add2sle(out_result, data_map[id]);
-				out_result.writen(SLE_SLEEND, 'c');
-				out_result.write("]");
-				dump_group_tree_childs(id, out_result, parent_map, data_map);
-			}
-			break;
-		}
-	}
-}
-
-function group_dump_data(db, out_result, tbl){
-	out_result.clear();
-	local parent_map = [];
-	local  group_map = {};
-	local id, parent_id;
-	local stmt = db.prepare(format("select id, parent_id, description from %s order by 3", tbl));
-	while (stmt.next_row()) {
-		id = stmt.col(0);
-		parent_id = stmt.col(1);
-		if (type(parent_id) != "integer") parent_id = 0;
-		//debug_print("\n", parent_id, "\t", id);
-		parent_map.push([parent_id, id]);
-		group_map[id] <- stmt.col(2);
-	}
-	parent_map.sort(@(a,b) a[0] <=> b[0] );
-	out_result.write("[[");
-	add2sle(out_result, "id");
-	add2sle(out_result, "parent_id");
-	add2sle(out_result, "description");
-	out_result.writen(SLE_SLEEND, 'c');
-	out_result.write("]");
-	dump_group_tree_childs(0, out_result, parent_map, group_map);
-	out_result.write("]");
-}
-
 function ourbizDbMobile(request){
 	local data = {};
 	data.page_name = "list_products";
@@ -1548,8 +1578,8 @@ function ourbizDbGetList(request){
 		if (!post_tbl.get("query_limit", false)) post_tbl.query_limit <- 50;
 		gmFile.clear();
 
-		if (list == "entity_groups") group_dump_data(db, gmFile, "entity_groups");
-		else if (list == "product_groups") group_dump_data(db, gmFile, "product_groups");
+		if (list == "entity_groups") db_ourbiz_tables.entity_groups.get_list(db, gmFile);
+		else if (list == "product_groups") db_ourbiz_tables.product_groups.get_list(db, gmFile);
 		else if (list == "config") sql = "select key,value from config";
 		else if (db_ourbiz_tables.get(list, false)){
 			sql = db_ourbiz_tables[list].sql_list(qs_tbl, post_tbl);

+ 52 - 0
SquiLu-ourbiz/print-preview-gui.fl

@@ -0,0 +1,52 @@
+# data file for the Fltk User Interface Designer (fluid)
+version 1.0302 
+i18n_type 1 
+i18n_include i18n_function.h 
+i18n_function _tr 
+header_name {.h} 
+code_name {.cxx}
+decl {\#include "My_Base_App.h"
+\#include "order-page-gui.h"} {public global
+} 
+
+widget_class PrintPreviewGroup {
+  label {Print Preview} open
+  xywh {181 165 770 440} type Double labelsize 16 hide resizable position_relative
+} {
+  Fl_Group {} {open
+    xywh {0 0 80 440}
+  } {
+    Fl_Button btnRefresh {
+      label Refresh
+      xywh {0 5 80 25} labelsize 16
+    }
+    Fl_Button btnPrinter {
+      label Printer
+      xywh {0 35 80 25} labelsize 16
+    }
+    Fl_Button btnPrint {
+      label Print
+      xywh {0 65 80 25} labelsize 16
+    }
+    Fl_Check_Button chkOnlyData {
+      label {Only Data}
+      xywh {30 118 20 25} down_box DOWN_BOX labelsize 16 align 1
+    }
+    Fl_Check_Button chkA4 {
+      label A4
+      xywh {30 165 20 25} down_box DOWN_BOX labelsize 16 align 1
+    }
+    Fl_Input iNumCopies {
+      label Copies
+      xywh {10 211 56 24} type Int labelsize 16 align 1 textsize 16
+    }
+    Fl_Browser brwPages {
+      label Pages
+      xywh {5 260 70 180} type Hold labelsize 16 align 1 textsize 16 resizable
+    }
+  }
+  Fl_Scroll PreviewScroll {open selected
+    xywh {90 0 680 440} box ENGRAVED_FRAME color 7 resizable
+    class OrderPageGroup
+  } {}
+} 

+ 77 - 0
SquiLu-ourbiz/print-preview-gui.nut

@@ -0,0 +1,77 @@
+class PrintPreviewGroup extends Fl_Group {
+  
+  // Declaration of class members
+  btnRefresh = null;
+  btnPrinter = null;
+  btnPrint = null;
+  chkOnlyData = null;
+  chkA4 = null;
+  iNumCopies = null;
+  brwPages = null;
+  PreviewScroll = null;
+  
+  constructor(){
+    base.constructor(181, 165, 770, 440, _tr("Print Preview"));
+    local _x = 181, _y = 165;
+    // Create member functions and widgets
+    {
+      local o = Fl_Group(_x + 0, _y + 0, 80, 440);
+      {
+        {
+          local o = Fl_Button(_x + 0, _y + 5, 80, 25, _tr("Refresh"));
+          btnRefresh = o;
+          o.labelsize(16);
+        }
+        {
+          local o = Fl_Button(_x + 0, _y + 35, 80, 25, _tr("Printer"));
+          btnPrinter = o;
+          o.labelsize(16);
+        }
+        {
+          local o = Fl_Button(_x + 0, _y + 65, 80, 25, _tr("Print"));
+          btnPrint = o;
+          o.labelsize(16);
+        }
+        {
+          local o = Fl_Check_Button(_x + 30, _y + 118, 20, 25, _tr("Only Data"));
+          chkOnlyData = o;
+          o.align(1);
+          o.labelsize(16);
+          o.down_box(FL_DOWN_BOX);
+        }
+        {
+          local o = Fl_Check_Button(_x + 30, _y + 165, 20, 25, _tr("A4"));
+          chkA4 = o;
+          o.align(1);
+          o.labelsize(16);
+          o.down_box(FL_DOWN_BOX);
+        }
+        {
+          local o = Fl_Int_Input(_x + 10, _y + 211, 56, 24, _tr("Copies"));
+          iNumCopies = o;
+          o.textsize(16);
+          o.align(1);
+          o.labelsize(16);
+        }
+        {
+          local o = Fl_Hold_Browser(_x + 5, _y + 260, 70, 180, _tr("Pages"));
+          brwPages = o;
+          o.textsize(16);
+          o.align(1);
+          o.labelsize(16);
+          o.end();
+          Fl_Group.current().resizable(o);
+        }
+      }
+      o.end();
+    }
+    {
+      local o = OrderPageGroup(_x + 90, _y + 0, 680, 440);
+      PreviewScroll = o;
+      o.box(FL_ENGRAVED_FRAME);
+      o.color(7);
+      o.end();
+      Fl_Group.current().resizable(o);
+    }
+  }
+}

+ 529 - 0
SquiLu-ourbiz/product-edit-gui.fl

@@ -0,0 +1,529 @@
+# data file for the Fltk User Interface Designer (fluid)
+version 1.0302 
+i18n_type 1 
+i18n_include i18n_function.h 
+i18n_function _tr 
+header_name {.h} 
+code_name {.cxx}
+widget_class EditProductsWindow {
+  label {Edit Products} open
+  xywh {34 28 800 560} type Double resizable
+  class Edit_Base_Window visible
+} {
+  Fl_Output db_products_id {
+    macro_name {db products id}
+    dirty_name db_products_id
+    xywh {5 5 96 25} labeltype NO_LABEL labelsize 16 textsize 16
+    code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+  }
+  Fl_Output db_products_description_ro {
+    dirty_name db_products_description_ro
+    xywh {110 5 545 25} labeltype NO_LABEL labelsize 16 textsize 16
+  }
+  Fl_Output db_products_mdate {
+    macro_name {db products mdate}
+    dirty_name db_products_mdate
+    xywh {666 5 130 25} labeltype NO_LABEL labelsize 16 textsize 16
+    code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+  }
+  Fl_Output db_products_cdate {
+    macro_name {db products cdate}
+    xywh {665 35 130 25} labeltype NO_LABEL labelsize 16 textsize 16
+    code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+  }
+  Fl_Tabs tabs {open
+    xywh {5 35 790 520} selection_color 4 labelsize 16 labelcolor 7 resizable
+  } {
+    Fl_Group tabMain {
+      label Main open
+      xywh {5 60 790 495} color 246 labelsize 16 resizable
+    } {
+      Fl_Input db_products_reference_code {
+        label Reference
+        macro_name {db products reference_code}
+        xywh {115 70 165 25} labelsize 16 textsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Input db_products_supplier_code {
+        label {Ref. Supp.}
+        macro_name {db products supplier_code}
+        dirty_name db_products_supplier_code
+        xywh {380 70 165 25} labelsize 16 textsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Input db_products_bar_code {
+        label Barcode
+        macro_name {db products bar_code}
+        dirty_name db_products_bar_code
+        xywh {620 70 165 25} labelsize 16 textsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Input db_products_sell_description {
+        label Description
+        macro_name {db products sell_description}
+        dirty_name db_products_sell_description
+        xywh {115 100 670 25} labelsize 16 textsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Input db_products_buy_description {
+        label {Desc. Supp.}
+        macro_name {db products buy_description}
+        dirty_name db_products_buy_description
+        xywh {115 130 670 25} labelsize 16 textsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Input db_products_sell_price {
+        label {Sales Price}
+        macro_name {db products sell_price}
+        dirty_name db_products_sell_price
+        xywh {115 160 110 25} type Float labelsize 16 textsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+        class Fl_Float_Input_Fmt
+      }
+      Fl_Choice db_products_measure_unit_id {
+        label {Measure Unit}
+        macro_name {db products measure_unit_id}
+        dirty_name db_products_measure_unit_id open
+        xywh {370 160 110 25} down_box BORDER_BOX labelsize 16 textsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+        class Fl_Choice_Int
+      } {}
+      Fl_Choice db_products_sales_tax_id {
+        label {V.A.T.}
+        macro_name {db products sales_tax_id}
+        dirty_name db_products_sales_tax_id open
+        xywh {115 190 110 25} down_box BORDER_BOX labelsize 16 textsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+        class Fl_Choice_Int
+      } {}
+      Fl_Choice db_products_warranty_id {
+        label Warranty
+        macro_name {db products warranty_id}
+        dirty_name db_products_warranty_id open
+        xywh {370 190 110 25} down_box BORDER_BOX labelsize 16 textsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+        class Fl_Choice_Int
+      } {}
+      Fl_Input db_products_sell_quantity_min {
+        label {Sell Min. Qty.}
+        macro_name {db products sell_quantity_min}
+        dirty_name db_products_sell_quantity_min
+        xywh {370 250 110 25} type Float labelsize 16 textsize 16
+        code0 {o->decimal_places(-6);}
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Input db_products_units_by_package {
+        label {Units by Pack.}
+        macro_name {db products units_by_package}
+        dirty_name db_products_units_by_package
+        xywh {370 280 110 25} type Float labelsize 16 textsize 16
+        code0 {o->decimal_places(-6);}
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Input db_products_weight {
+        label Weight
+        macro_name {db products weight}
+        dirty_name db_products_weight
+        xywh {370 220 110 25} type Float labelsize 16 textsize 16
+        code0 {o->decimal_places(-6);}
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Check_Button db_products_sell_without_stock {
+        label {Sell without stock}
+        macro_name {db products sell_without_stock}
+        xywh {10 250 215 25} down_box DOWN_BOX labelsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Check_Button db_products_is_active {
+        label Active
+        macro_name {db products is_active}
+        dirty_name db_products_is_active
+        xywh {10 280 110 25} down_box DOWN_BOX labelsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Check_Button db_products_show_on_sales {
+        label Sales
+        macro_name {db products show_on_sales}
+        dirty_name db_products_show_on_sales
+        xywh {10 310 105 25} down_box DOWN_BOX labelsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Check_Button db_products_show_on_buys {
+        label Buys
+        macro_name {db products show_on_buys}
+        dirty_name db_products_show_on_buys
+        xywh {10 340 95 25} down_box DOWN_BOX labelsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Check_Button db_products_show_on_web {
+        label Web
+        macro_name {db products show_on_web}
+        dirty_name db_products_show_on_web
+        xywh {115 310 120 25} down_box DOWN_BOX labelsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Check_Button db_products_show_price_on_web {
+        label {Web price}
+        macro_name {db products show_price_on_web}
+        dirty_name db_products_show_price_on_web
+        xywh {115 340 100 25} down_box DOWN_BOX labelsize 16
+        code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Group {} {open
+        xywh {675 402 110 143}
+      } {
+        Fl_Box {} {
+          label Spacer
+          xywh {675 402 110 68} labeltype NO_LABEL resizable
+        }
+        Fl_Choice dbAction {
+          label Action
+          dirty_name dbAction open
+          xywh {675 520 110 25} down_box BORDER_BOX labelsize 16 align 1 textsize 16
+          class Fl_Choice_dbAction
+        } {}
+        Fl_Button btnDbAction {
+          label Action
+          dirty_name btnDbAction
+          xywh {675 470 110 25} labelsize 16
+        }
+      }
+      Fl_Tabs tabsMoreData {
+        dirty_name tabsMoreData open selected
+        xywh {10 370 650 181} selection_color 4 labelsize 16 labelcolor 7
+      } {
+        Fl_Group tabNotes {
+          label Notes open
+          xywh {10 400 650 150} labelsize 16
+        } {
+          Fl_Input db_products_sell_notes {
+            macro_name {db products sell_notes}
+            dirty_name db_products_sell_notes
+            xywh {10 400 650 150} type Multiline labeltype NO_LABEL labelsize 16 align 5 textsize 16 resizable
+            code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+            class Fl_Text_Editor_Buffered
+          }
+        }
+        Fl_Group tabNotesSupplier {
+          label {Notes Supplier} open
+          xywh {10 400 650 150} labelsize 16 hide
+        } {
+          Fl_Input db_products_buy_notes {
+            macro_name {db products buy_notes}
+            dirty_name db_products_buy_notes
+            xywh {10 400 650 150} type Multiline labeltype NO_LABEL labelsize 16 align 5 textsize 16 resizable
+            code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+            class Fl_Text_Editor_Buffered
+          }
+        }
+        Fl_Group tabTags {
+          label Tags
+          dirty_name tabTags open
+          xywh {10 400 650 150} labelsize 16 hide
+        } {
+          Fl_Input db_products_tags {
+            macro_name {db products tags}
+            dirty_name db_products_tags
+            xywh {10 400 650 150} type Multiline labeltype NO_LABEL labelsize 16 align 5 textsize 16 resizable
+            code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+            class Fl_Text_Editor_Buffered
+          }
+        }
+        Fl_Group tabGroups {
+          label Groups
+          dirty_name tabGroups open
+          xywh {10 395 650 156} hide
+        } {
+          Fl_Tree db_products_group_id {
+            macro_name {db products group_id}
+            dirty_name db_products_group_id
+            xywh {10 400 650 150} labelsize 16
+            code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+            class Flu_Tree_Browser
+          }
+        }
+      }
+      Fl_Button btnImage {
+        xywh {485 158 300 232} box ENGRAVED_BOX color 7 align 80
+        class Fl_Image_Box
+      }
+      Fl_Check_Button {} {
+        label {Wrap lines}
+        callback {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);}
+        xywh {370 375 102 25} down_box DOWN_BOX value 1 labelsize 16
+      }
+      Fl_Input db_products_quantity_onhand {
+        label Onhand
+        macro_name {db products quantity_onhand}
+        dirty_name db_products_quantity_onhand
+        xywh {115 220 110 25} type Float labelsize 16 textsize 16
+        code0 {o->decimal_places(-6);}
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+    }
+    Fl_Group tabPrices {
+      label Prices open
+      xywh {5 60 790 495} color 246 labelsize 16 hide
+    } {
+      Fl_Group {} {
+        label {Sales Price} open
+        xywh {15 88 770 201} box UP_BOX color 166 labelsize 16
+      } {
+        Fl_Input db_products_buy_price {
+          label {Buy $}
+          macro_name {db products buy_price}
+          dirty_name db_products_buy_price
+          xywh {25 115 115 25} type Float labelsize 16 align 5 textsize 16
+          code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+          class Fl_Float_Input_Fmt
+        }
+        Fl_Input db_products_buy_discount {
+          label {Buy Disc. %}
+          macro_name {db products buy_discount}
+          dirty_name db_products_buy_discount
+          xywh {151 115 115 25} type Float labelsize 16 align 5 textsize 16
+          code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+          code1 {o->decimal_places(-6);}
+          class Fl_Float_Input_Fmt
+        }
+        Fl_Input db_products_buy_other_costs {
+          label {Other Costs $}
+          macro_name {db products buy_other_costs}
+          dirty_name db_products_buy_other_costs
+          xywh {278 115 115 25} type Float labelsize 16 align 5 textsize 16
+          code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+          class Fl_Float_Input_Fmt
+        }
+        Fl_Input db_products_sell_markup {
+          label {Markup %}
+          macro_name {db products sell_markup}
+          dirty_name db_products_sell_markup
+          xywh {404 115 115 25} type Float labelsize 16 align 5 textsize 16
+          code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+          code1 {//o->decimal_places(-6);}
+          class Fl_Float_Input_Fmt
+        }
+        Fl_Input markup_to_discount {
+          label {Margin %}
+          xywh {531 115 115 25} type Float labelsize 16 align 5 textsize 16
+          code0 {//o->decimal_places(-6);}
+          class Fl_Float_Input_Fmt
+        }
+        Fl_Input db_products_sell_price_ro {
+          label {Sales $}
+          dirty_name db_products_sell_price_ro
+          xywh {658 115 115 25} type Float labelsize 16 align 5 textsize 16
+          class Fl_Float_Input_Fmt
+        }
+        Fl_Input db_products_price_decimals {
+          label {Decimals for calculation}
+          macro_name {db products price_decimals}
+          dirty_name db_products_price_decimals
+          xywh {530 150 30 25} type Int labelfont 1 labelsize 16 textfont 1 textsize 16
+          code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+          code1 {//o->decimal_places(-6);}
+        }
+        Fl_Button btnSaveProrduct {
+          label Save
+          xywh {662 150 111 25} labelsize 16
+        }
+        Fl_Input db_products_stock_min {
+          label {Stock Min.}
+          macro_name {db products stock_min}
+          dirty_name db_products_stock_min
+          xywh {665 195 110 25} type Float labelsize 16 textsize 16
+          code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+          code1 {o->decimal_places(-6);}
+        }
+        Fl_Input db_products_stock_max {
+          label {Stock Max.}
+          macro_name {db products stock_max}
+          dirty_name db_products_stock_max
+          xywh {665 225 110 25} type Float labelsize 16 textsize 16
+          code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+          code1 {o->decimal_places(-6);}
+        }
+        Fl_Input db_products_buy_quantity_min {
+          label {Buy Min. Qty.}
+          macro_name {db products buy_quantity_min}
+          dirty_name db_products_buy_quantity_min
+          xywh {665 255 110 25} type Float labelsize 16 textsize 16
+          code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+          code1 {o->decimal_places(-6);}
+        }
+        Fl_Input db_products_price_formula {
+          label {Price formula}
+          macro_name {db products price_formula}
+          dirty_name db_products_price_formula
+          xywh {25 197 495 83} type Multiline labelsize 16 align 5 textsize 16
+          code0 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+        }
+        Fl_Output db_products_price_date {
+          label {Last Update}
+          dirty_name db_products_price_date
+          xywh {25 150 130 25} labelsize 16 align 8 textsize 16
+        }
+      }
+      Fl_Box {} {
+        label Spacer
+        xywh {15 290 770 40} labeltype NO_LABEL resizable
+      }
+      Fl_Group productPrices {
+        dirty_name productPrices open
+        xywh {15 332 770 212} box UP_BOX color 166 labeltype NO_LABEL labelsize 16
+      } {}
+    }
+    Fl_Group tabKit {
+      label Kit
+      dirty_name tabKit open
+      xywh {5 59 790 495} color 246 labelsize 16 hide
+    } {}
+    Fl_Group tabChartStatistics {
+      label Statistics open
+      xywh {5 60 790 495} color 246 labelsize 16 hide
+    } {}
+    Fl_Group tabHistory {
+      label History open
+      xywh {5 60 790 495} color 246 labelsize 16 hide
+    } {}
+    Fl_Group tabReports {
+      label Reports open
+      xywh {5 60 790 495} box UP_BOX color 246 labelsize 16 hide
+    } {
+      Fl_Group grpExportImport {
+        label {Export / Import} open
+        xywh {15 465 770 80} box ENGRAVED_FRAME labelsize 16
+      } {
+        Fl_Button btnProductsExport {
+          label {Products Export}
+          xywh {25 475 175 25} labelsize 16
+        }
+        Fl_Button btnProductsImport {
+          label {Products Import}
+          xywh {25 510 175 25} labelsize 16
+        }
+        Fl_Check_Button chkWithoutPrices {
+          label {Withouth Prices}
+          xywh {225 480 150 25} down_box DOWN_BOX labelsize 16
+        }
+        Fl_Check_Button chkWebOnly {
+          label {WEB Only}
+          xywh {225 510 150 25} down_box DOWN_BOX labelsize 16
+        }
+        Fl_Box boxExportImportCount {
+          label 0
+          xywh {405 499 42 25} labelsize 16
+        }
+        Fl_Button btnProductGroupsExport {
+          label {Product Groups Export}
+          xywh {555 475 220 25} labelsize 16
+        }
+        Fl_Button btnProductGroupsImport {
+          label {Product Groups import}
+          xywh {555 510 220 25} labelsize 16
+        }
+      }
+      Fl_Button btnUpdateWeb {
+        label {Update WEB}
+        xywh {610 70 175 25} labelsize 16
+      }
+      Fl_Group grpPrintPriceList {
+        label {Price List}
+        dirty_name grpPrintPriceList open
+        xywh {10 85 195 165} box ENGRAVED_FRAME labelsize 16
+      } {
+        Fl_Check_Button chkPriceListWithVAT {
+          label {With V.A.T.}
+          xywh {20 95 175 25} down_box DOWN_BOX labelsize 16
+        }
+        Fl_Check_Button chkPriceListSellOnWeb {
+          label {Sell on WEB}
+          xywh {20 125 170 25} down_box DOWN_BOX labelsize 16
+        }
+        Fl_Button btnPrintPriceList {
+          label Print
+          xywh {20 215 175 25} labelsize 16
+        }
+        Fl_Check_Button chkPriceListSellSales {
+          label Sales
+          xywh {20 155 175 25} down_box DOWN_BOX labelsize 16
+        }
+        Fl_Check_Button chkPriceListSellPDF {
+          label PDF
+          xywh {20 185 175 25} down_box DOWN_BOX labelsize 16
+        }
+      }
+    }
+    Fl_Group tabTotals {
+      label Totals
+      dirty_name tabTotals open
+      xywh {5 60 790 495} color 246 labelsize 16 hide
+    } {
+      Fl_Input db_products_quantity_quoted_sales {
+        label {Quantity quoted sales}
+        macro_name {db products quantity_quoted_sales}
+        xywh {220 80 110 25} type Float labelsize 16 textsize 16
+        code0 {o->decimal_places(-6);}
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Input db_products_quantity_ordered_sales {
+        label {Quantity ordered sales}
+        macro_name {db products quantity_ordered_sales}
+        xywh {220 115 110 25} type Float labelsize 16 textsize 16
+        code0 {o->decimal_places(-6);}
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Input db_products_quantity_delivered {
+        label {Quantity delivered}
+        macro_name {db products quantity_delivered}
+        xywh {220 150 110 25} type Float labelsize 16 textsize 16
+        code0 {o->decimal_places(-6);}
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Input db_products_quantity_invoiced_sales {
+        label {Quantity invoiced sales}
+        macro_name {db products quantity_invoiced_sales}
+        xywh {220 185 110 25} type Float labelsize 16 textsize 16
+        code0 {o->decimal_places(-6);}
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Input db_products_quantity_lost {
+        label {Quantity lost}
+        macro_name {db products quantity_lost}
+        xywh {220 220 110 25} type Float labelsize 16 textsize 16
+        code0 {o->decimal_places(-6);}
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Input db_products_quantity_quoted_buys {
+        label {Quantity quoted buys}
+        macro_name {db products quantity_quoted_buys}
+        xywh {665 85 110 25} type Float labelsize 16 textsize 16
+        code0 {o->decimal_places(-6);}
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Input db_products_quantity_ordered_buys {
+        label {Quantity ordered buys}
+        macro_name {db products quantity_ordered_buys}
+        xywh {665 120 110 25} type Float labelsize 16 textsize 16
+        code0 {o->decimal_places(-6);}
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Input db_products_quantity_received {
+        label {Quantity received}
+        macro_name {db products quantity_received}
+        xywh {665 155 110 25} type Float labelsize 16 textsize 16
+        code0 {o->decimal_places(-6);}
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+      Fl_Input db_products_quantity_invoiced_buys {
+        label {Quantity invoiced buys}
+        macro_name {db products quantity_invoiced_buys}
+        xywh {665 190 110 25} type Float labelsize 16 textsize 16
+        code0 {o->decimal_places(-6);}
+        code1 {=add_input_field_to_map("$(1)", "$(2)", $(name));}
+      }
+    }
+  }
+} 

+ 94 - 0
SquiLu-ourbiz/product-kit-gui.fl

@@ -0,0 +1,94 @@
+# data file for the Fltk User Interface Designer (fluid)
+version 1.0302 
+i18n_type 1 
+i18n_include i18n_function.h 
+i18n_function _tr 
+header_name {.h} 
+code_name {.cxx}
+decl {\#include "My_Base_App.h"} {public global
+} 
+
+widget_class ProductKitGroup {
+  label ProductKitGroup open
+  xywh {24 106 775 470} type Double labelsize 16 resizable
+  class Base_Edit_Group visible position_relative
+} {
+  Fl_Browser grid {
+    dirty_name grid
+    xywh {4 1 770 328} labelsize 16 textsize 16 resizable
+    class Fl_Data_Table
+  }
+  Fl_Group kit_group_search_edit {
+    label {Search / Edit} open
+    xywh {0 355 540 115} box UP_BOX color 166 labelsize 16
+  } {
+    Fl_Group grpSearchEdit {
+      dirty_name grpSearchEdit open
+      xywh {10 365 525 93}
+    } {
+      Fl_Input db_product_kits_product_id {
+        label Code
+        dirty_name db_product_kits_product_id
+        xywh {12 382 87 25} type Int labelsize 16 align 5 textsize 16
+      }
+      Fl_Input db_product_kits_sell_description {
+        label Description
+        dirty_name db_product_kits_sell_description
+        xywh {109 382 426 25} labelsize 16 align 5 textsize 16
+      }
+      Fl_Button btnSearchProduct {
+        label Search
+        xywh {445 433 90 25} labelsize 16
+      }
+      Fl_Input db_product_kits_quantity {
+        label Quantity
+        dirty_name db_product_kits_quantity
+        xywh {10 433 89 25} type Float labelsize 16 align 5 textsize 16
+      }
+      Fl_Input db_product_kits_product_price {
+        label Price
+        dirty_name db_product_kits_product_price
+        xywh {109 433 108 25} type Float labelsize 16 align 5 textsize 16
+      }
+      Fl_Button btnDbAction {
+        label Save
+        dirty_name btnDbAction selected
+        xywh {225 433 100 25} labelsize 16
+      }
+      Fl_Choice dbAction {
+        label Action
+        dirty_name dbAction open
+        xywh {335 433 100 25} down_box BORDER_BOX labelsize 16 align 1 textsize 16
+        class Fl_Choice_dbAction
+      } {}
+    }
+    Fl_Check_Button btnKitPartOf {
+      label {Part of}
+      dirty_name btnKitPartOf
+      xywh {430 360 100 25} down_box DOWN_BOX labelsize 16
+    }
+  }
+  Fl_Group kit_group_totals {
+    label Totals open
+    xywh {544 355 230 115} box UP_BOX color 166 labelsize 16
+  } {
+    Fl_Input kit_sales_price {
+      label Price
+      dirty_name kit_sales_price
+      xywh {664 433 100 25} type Float labelsize 16 align 5 textsize 16
+    }
+    Fl_Input kit_prices_sum {
+      label {Prices Sum}
+      xywh {664 380 100 25} type Float labelsize 16 align 5 textsize 16
+    }
+    Fl_Input kit_parts {
+      label Parts
+      xywh {554 380 100 25} type Int labelsize 16 align 5 textsize 16
+    }
+    Fl_Input kit_markup {
+      label {Markup %}
+      dirty_name kit_markup
+      xywh {554 433 100 25} type Float labelsize 16 align 5 textsize 16
+    }
+  }
+} 

+ 141 - 0
SquiLu-ourbiz/product-kit-gui.nut

@@ -0,0 +1,141 @@
+class ProductKitGroup extends Fl_Group {
+  
+// Declaration of class members
+  grid = null;
+  kit_group_search_edit = null;
+  grpSearchEdit = null;
+  db_product_kits_product_id = null;
+  db_product_kits_sell_description = null;
+  btnSearchProduct = null;
+  db_product_kits_quantity = null;
+  db_product_kits_product_price = null;
+  btnDbAction = null;
+  dbAction = null;
+  btnKitPartOf = null;
+  kit_group_totals = null;
+  kit_sales_price = null;
+  kit_prices_sum = null;
+  kit_parts = null;
+  kit_markup = null;
+  
+  constructor(){
+    base.constructor(24, 106, 775, 470, _tr("ProductKitGroup"));
+    local _x = 24, _y = 106;
+    // Create member functions and widgets
+    {
+      local o = Fl_Data_Table(_x + 4, _y + 1, 770, 328);
+      grid = o;
+      o.textsize(16);
+      o.labelsize(16);
+      o.end();
+      Fl_Group.current().resizable(o);
+    }
+    {
+      local o = Fl_Group(_x + 0, _y + 355, 540, 115, _tr("Search / Edit"));
+      kit_group_search_edit = o;
+      o.labelsize(16);
+      o.color(166);
+      o.box(FL_UP_BOX);
+      {
+        {
+          local o = Fl_Group(_x + 10, _y + 365, 525, 93);
+          grpSearchEdit = o;
+          {
+            {
+              local o = Fl_Int_Input(_x + 12, _y + 382, 87, 25, _tr("Code"));
+              db_product_kits_product_id = o;
+              o.textsize(16);
+              o.align(5);
+              o.labelsize(16);
+            }
+            {
+              local o = Fl_Input(_x + 109, _y + 382, 426, 25, _tr("Description"));
+              db_product_kits_sell_description = o;
+              o.textsize(16);
+              o.align(5);
+              o.labelsize(16);
+            }
+            {
+              local o = Fl_Button(_x + 445, _y + 433, 90, 25, _tr("Search"));
+              btnSearchProduct = o;
+              o.labelsize(16);
+            }
+            {
+              local o = Fl_Float_Input(_x + 10, _y + 433, 89, 25, _tr("Quantity"));
+              db_product_kits_quantity = o;
+              o.textsize(16);
+              o.align(5);
+              o.labelsize(16);
+            }
+            {
+              local o = Fl_Float_Input(_x + 109, _y + 433, 108, 25, _tr("Price"));
+              db_product_kits_product_price = o;
+              o.textsize(16);
+              o.align(5);
+              o.labelsize(16);
+            }
+            {
+              local o = Fl_Button(_x + 225, _y + 433, 100, 25, _tr("Save"));
+              btnDbAction = o;
+              o.labelsize(16);
+            }
+            {
+              local o = Fl_Choice_dbAction(_x + 335, _y + 433, 100, 25, _tr("Action"));
+              dbAction = o;
+              o.textsize(16);
+              o.align(1);
+              o.down_box(FL_BORDER_BOX);
+              o.labelsize(16);
+            }
+          }
+          o.end();
+        }
+        {
+          local o = Fl_Check_Button(_x + 430, _y + 360, 100, 25, _tr("Part of"));
+          btnKitPartOf = o;
+          o.labelsize(16);
+          o.down_box(FL_DOWN_BOX);
+        }
+      }
+      o.end();
+    }
+    {
+      local o = Fl_Group(_x + 544, _y + 355, 230, 115, _tr("Totals"));
+      kit_group_totals = o;
+      o.labelsize(16);
+      o.color(166);
+      o.box(FL_UP_BOX);
+      {
+        {
+          local o = Fl_Float_Input(_x + 664, _y + 433, 100, 25, _tr("Price"));
+          kit_sales_price = o;
+          o.textsize(16);
+          o.align(5);
+          o.labelsize(16);
+        }
+        {
+          local o = Fl_Float_Input(_x + 664, _y + 380, 100, 25, _tr("Prices Sum"));
+          kit_prices_sum = o;
+          o.textsize(16);
+          o.align(5);
+          o.labelsize(16);
+        }
+        {
+          local o = Fl_Int_Input(_x + 554, _y + 380, 100, 25, _tr("Parts"));
+          kit_parts = o;
+          o.textsize(16);
+          o.align(5);
+          o.labelsize(16);
+        }
+        {
+          local o = Fl_Float_Input(_x + 554, _y + 433, 100, 25, _tr("Markup %"));
+          kit_markup = o;
+          o.textsize(16);
+          o.align(5);
+          o.labelsize(16);
+        }
+      }
+      o.end();
+    }
+  }
+}

+ 56 - 0
SquiLu-ourbiz/product-prices-gui.fl

@@ -0,0 +1,56 @@
+# data file for the Fltk User Interface Designer (fluid)
+version 1.0302 
+i18n_type 1 
+i18n_include i18n_function.h 
+i18n_function _tr 
+header_name {.h} 
+code_name {.cxx}
+decl {\#include "My_Base_App.h"} {public global
+} 
+
+widget_class ProductPricesGroup {
+  label {Product Prices by Quantity} open
+  xywh {448 139 760 220} type Double labelsize 16
+  class Base_Edit_Group visible position_relative
+} {
+  Fl_Browser grid {
+    label {Prices by Quantity}
+    dirty_name grid
+    xywh {5 5 750 155} labelsize 16 align 1 textsize 16
+    class Fl_Data_Table
+  }
+  Fl_Input db_product_prices_quantity {
+    label Quantity
+    dirty_name db_product_prices_quantity
+    xywh {5 185 100 25} type Float labelsize 16 align 5 textsize 16
+    code0 {o->decimal_places(-6);}
+  }
+  Fl_Input db_product_prices_markup_pct {
+    label {Markup %}
+    dirty_name db_product_prices_markup_pct
+    xywh {115 185 108 25} type Float labelsize 16 align 5 textsize 16
+    code0 {//o->decimal_places(-6);}
+  }
+  Fl_Input db_product_prices_discount_pct {
+    label {Discount %}
+    dirty_name db_product_prices_discount_pct
+    xywh {233 185 108 25} type Float labelsize 16 align 5 textsize 16
+    code0 {//o->decimal_places(-6);}
+  }
+  Fl_Input db_product_prices_price {
+    label Price
+    dirty_name db_product_prices_price
+    xywh {351 185 108 25} type Float labelsize 16 align 5 textsize 16
+  }
+  Fl_Button btnDbAction {
+    label Save
+    dirty_name btnDbAction selected
+    xywh {469 185 105 25} labelsize 16
+  }
+  Fl_Choice dbAction {
+    label Action
+    dirty_name dbAction open
+    xywh {590 185 105 25} down_box BORDER_BOX labelsize 16 align 1 textsize 16
+    class Fl_Choice_dbAction
+  } {}
+} 

+ 69 - 0
SquiLu-ourbiz/product-prices-gui.nut

@@ -0,0 +1,69 @@
+class ProductPricesGroup extends Fl_Group {
+  
+  // Declaration of class members
+  grid = null;
+  db_product_prices_quantity = null;
+  db_product_prices_markup_pct = null;
+  db_product_prices_discount_pct = null;
+  db_product_prices_price = null;
+  btnDbAction = null;
+  dbAction = null;
+  
+  constructor(){
+    base.constructor(448, 139, 760, 220, _tr("Product Prices by Quantity"));
+    local _x = 448, _y = 139;
+    // Create member functions and widgets
+    {
+      local o = Fl_Data_Table(_x + 5, _y + 5, 750, 155, _tr("Prices by Quantity"));
+      grid = o;
+      o.textsize(16);
+      o.align(1);
+      o.labelsize(16);
+      o.end();
+    }
+    {
+      local o = Fl_Float_Input(_x + 5, _y + 185, 100, 25, _tr("Quantity"));
+      db_product_prices_quantity = o;
+      o.textsize(16);
+      o.align(5);
+      o.labelsize(16);
+      o->decimal_places(-6);
+    }
+    {
+      local o = Fl_Float_Input(_x + 115, _y + 185, 108, 25, _tr("Markup %"));
+      db_product_prices_markup_pct = o;
+      o.textsize(16);
+      o.align(5);
+      o.labelsize(16);
+      //o->decimal_places(-6);
+    }
+    {
+      local o = Fl_Float_Input(_x + 233, _y + 185, 108, 25, _tr("Discount %"));
+      db_product_prices_discount_pct = o;
+      o.textsize(16);
+      o.align(5);
+      o.labelsize(16);
+      //o->decimal_places(-6);
+    }
+    {
+      local o = Fl_Float_Input(_x + 351, _y + 185, 108, 25, _tr("Price"));
+      db_product_prices_price = o;
+      o.textsize(16);
+      o.align(5);
+      o.labelsize(16);
+    }
+    {
+      local o = Fl_Button(_x + 469, _y + 185, 105, 25, _tr("Save"));
+      btnDbAction = o;
+      o.labelsize(16);
+    }
+    {
+      local o = Fl_Choice_dbAction(_x + 590, _y + 185, 105, 25, _tr("Action"));
+      dbAction = o;
+      o.textsize(16);
+      o.align(1);
+      o.down_box(FL_BORDER_BOX);
+      o.labelsize(16);
+    }
+  }
+}

+ 8 - 9
SquiLu/squilu.cbp

@@ -105,7 +105,6 @@
 					<Add option="-DWITH_FLTK=1" />
 					<Add directory="../../zeromq-3.2.2/include" />
 					<Add directory="../fltk" />
-					<Add directory="../third-party/flu" />
 					<Add directory="../libharu/include" />
 					<Add directory="../flu" />
 				</Compiler>
@@ -148,9 +147,9 @@
 					<Add option="-fno-strict-aliasing" />
 					<Add option="-DWITH_FLTK=1" />
 					<Add directory="../../zeromq-3.2.2/include" />
-					<Add directory="../../dadbiz++/third-party/fltk" />
-					<Add directory="../../dadbiz++/third-party/flu" />
-					<Add directory="../../dadbiz++/third-party/libharu/include" />
+					<Add directory="../fltk" />
+					<Add directory="../flu" />
+					<Add directory="../libharu/include" />
 				</Compiler>
 				<Linker>
 					<Add library="../../zeromq-3.2.2/libzmq3.a" />
@@ -171,9 +170,9 @@
 					<Add library="hpdfs" />
 					<Add library="discount" />
 					<Add directory="../../zeromq-3.2.2" />
-					<Add directory="../../dadbiz++/third-party/fltk/lib" />
-					<Add directory="../../dadbiz++/third-party/flu" />
-					<Add directory="../../dadbiz++/third-party/libharu/src" />
+					<Add directory="../fltk/lib" />
+					<Add directory="../flu" />
+					<Add directory="../libharu/src" />
 				</Linker>
 			</Target>
 		</Build>
@@ -216,7 +215,7 @@
 			<Add directory="include" />
 			<Add directory="sqstdlib" />
 			<Add directory="../myaxtls" />
-			<Add directory="../../dadbiz++/third-party/discount-2.1.2" />
+			<Add directory="../discount" />
 			<Add directory="/usr/include/postgresql" />
 			<Add directory="/usr/lib/jvm/default-java/include" />
 			<Add directory="/usr/lib/llvm-3.1/include" />
@@ -229,7 +228,7 @@
 			<Add directory="lib" />
 			<Add directory="../myaxtls" />
 			<Add directory="../mpdecimal" />
-			<Add directory="../../dadbiz++/third-party/discount-2.1.2" />
+			<Add directory="../discount" />
 		</Linker>
 		<Unit filename="../SquiLu-ext/dynamic_library.cpp" />
 		<Unit filename="../SquiLu-ext/dynamic_library.h" />