test-fltk-7.nut 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793
  1. function _tr(str){ return str;}
  2. class Fl_Data_Table extends Flv_Table {
  3. _forPrint = null;
  4. constructor(px, py, pw, ph, pl=""){
  5. base.constructor(px, py, pw, ph, pl);
  6. _forPrint=false;
  7. }
  8. }
  9. class Flu_Tree_Browser extends Flv_Table {
  10. _forPrint = null;
  11. constructor(px, py, pw, ph, pl=""){
  12. base.constructor(px, py, pw, ph, pl);
  13. _forPrint=false;
  14. }
  15. }
  16. class Fl_Box_ClearLabel extends Fl_Box {
  17. constructor(px, py, pw, ph, pl=""){
  18. base.constructor(px, py, pw, ph, pl);
  19. }
  20. }
  21. class Flu_Combo_List extends Fl_Box {
  22. constructor(px, py, pw, ph, pl=""){
  23. base.constructor(px, py, pw, ph, pl);
  24. }
  25. }
  26. class Fl_Image_Box extends Fl_Box {
  27. constructor(px, py, pw, ph, pl=""){
  28. base.constructor(px, py, pw, ph, pl);
  29. }
  30. }
  31. class Fl_Choice_Int extends Fl_Button {
  32. constructor(px, py, pw, ph, pl=""){
  33. base.constructor(px, py, pw, ph, pl);
  34. }
  35. }
  36. class Fl_Float_Input_Fmt extends Fl_Float_Input {
  37. constructor(px, py, pw, ph, pl=""){
  38. base.constructor(px, py, pw, ph, pl);
  39. }
  40. }
  41. class My_Fl_Float_Input extends Fl_Float_Input {
  42. constructor(px, py, pw, ph, pl=""){
  43. base.constructor(px, py, pw, ph, pl);
  44. }
  45. }
  46. class My_Fl_Return_Button extends Fl_Button {
  47. constructor(px, py, pw, ph, pl=""){
  48. base.constructor(px, py, pw, ph, pl);
  49. }
  50. }
  51. class Fl_Choice_Str extends Fl_Button {
  52. constructor(px, py, pw, ph, pl=""){
  53. base.constructor(px, py, pw, ph, pl);
  54. }
  55. }
  56. class Flu_Combo_Box extends Fl_Button {
  57. constructor(px, py, pw, ph, pl=""){
  58. base.constructor(px, py, pw, ph, pl);
  59. }
  60. }
  61. function add_input_field_to_map(tbl, fldname, fld){
  62. }
  63. //class BaseReportA4 extends Fl_Group {
  64. class BaseReportA4 extends Fl_Window {
  65. db_products_id=null;
  66. db_products_description_ro=null;
  67. db_products_mdate=null;
  68. db_products_cdate=null;
  69. tabs=null;
  70. tabMain=null;
  71. db_products_reference_code=null;
  72. db_products_supplier_code=null;
  73. db_products_bar_code=null;
  74. db_products_sell_description=null;
  75. db_products_buy_description=null;
  76. db_products_sell_price=null;
  77. db_products_measure_unit_id=null;
  78. db_products_sales_tax_id=null;
  79. db_products_warranty_id=null;
  80. db_products_sell_quantity_min=null;
  81. db_products_units_by_package=null;
  82. db_products_weight=null;
  83. db_products_sell_without_stock=null;
  84. db_products_is_active=null;
  85. db_products_show_on_sales=null;
  86. db_products_show_on_buys=null;
  87. db_products_show_on_web=null;
  88. db_products_show_price_on_web=null;
  89. tabNotes=null;
  90. db_products_sell_notes=null;
  91. tabNotesSupplier=null;
  92. db_products_buy_notes=null;
  93. tabTags=null;
  94. db_products_tags=null;
  95. tabGroups=null;
  96. btnImage=null;
  97. db_products_quantity_onhand=null;
  98. tabPrices=null;
  99. db_products_buy_price=null;
  100. db_products_buy_discount=null;
  101. db_products_buy_other_costs=null;
  102. db_products_sell_markup=null;
  103. markup_to_discount=null;
  104. db_products_sell_price_ro=null;
  105. db_products_price_decimals=null;
  106. btnSaveProrduct=null;
  107. db_products_stock_min=null;
  108. db_products_stock_max=null;
  109. db_products_buy_quantity_min=null;
  110. db_products_price_formula=null;
  111. db_products_price_date=null;
  112. productPrices=null;
  113. tabKit=null;
  114. tabChartStatistics=null;
  115. tabHistory=null;
  116. tabReports=null;
  117. grpExportImport=null;
  118. btnProductsExport=null;
  119. btnProductsImport=null;
  120. chkWithoutPrices=null;
  121. chkWebOnly=null;
  122. boxExportImportCount=null;
  123. btnProductGroupsExport=null;
  124. btnProductGroupsImport=null;
  125. btnUpdateWeb=null;
  126. grpPrintPriceList=null;
  127. chkPriceListWithVAT=null;
  128. chkPriceListSellOnWeb=null;
  129. btnPrintPriceList=null;
  130. chkPriceListSellSales=null;
  131. chkPriceListSellPDF=null;
  132. tabTotals=null;
  133. db_products_quantity_quoted_sales=null;
  134. db_products_quantity_ordered_sales=null;
  135. db_products_quantity_delivered=null;
  136. db_products_quantity_invoiced_sales=null;
  137. db_products_quantity_lost=null;
  138. db_products_quantity_quoted_buys=null;
  139. db_products_quantity_ordered_buys=null;
  140. db_products_quantity_received=null;
  141. db_products_quantity_invoiced_buys=null;
  142. dbAction=null;
  143. btnDbAction=null;
  144. db_products_group_id=null;
  145. constructor() {
  146. base.constructor(10, 50, 800, 560, _tr("Edit Products"));
  147. begin();
  148. this->box(FL_FLAT_BOX);
  149. this->color(FL_BACKGROUND_COLOR);
  150. this->selection_color(FL_BACKGROUND_COLOR);
  151. this->labeltype(FL_NO_LABEL);
  152. this->labelfont(0);
  153. this->labelsize(14);
  154. this->labelcolor(FL_FOREGROUND_COLOR);
  155. this->align((FL_ALIGN_TOP));
  156. this->when(FL_WHEN_RELEASE);
  157. { db_products_id =new Fl_Output(5, 5, 96, 25);
  158. db_products_id->labeltype(FL_NO_LABEL);
  159. db_products_id->labelsize(16);
  160. db_products_id->textsize(16);
  161. add_input_field_to_map("products", "id", db_products_id);
  162. } // Fl_Output* db_products_id
  163. { db_products_description_ro =new Fl_Output(110, 5, 545, 25);
  164. db_products_description_ro->labeltype(FL_NO_LABEL);
  165. db_products_description_ro->labelsize(16);
  166. db_products_description_ro->textsize(16);
  167. } // Fl_Output* db_products_description_ro
  168. { db_products_mdate =new Fl_Output(666, 5, 130, 25);
  169. db_products_mdate->labeltype(FL_NO_LABEL);
  170. db_products_mdate->labelsize(16);
  171. db_products_mdate->textsize(16);
  172. add_input_field_to_map("products", "mdate", db_products_mdate);
  173. } // Fl_Output* db_products_mdate
  174. { db_products_cdate =new Fl_Output(665, 35, 130, 25);
  175. db_products_cdate->labeltype(FL_NO_LABEL);
  176. db_products_cdate->labelsize(16);
  177. db_products_cdate->textsize(16);
  178. add_input_field_to_map("products", "cdate", db_products_cdate);
  179. } // Fl_Output* db_products_cdate
  180. { tabs =new Fl_Tabs(5, 35, 790, 520);
  181. tabs->selection_color(4);
  182. tabs->labelsize(16);
  183. tabs->labelcolor(FL_BACKGROUND2_COLOR);
  184. { tabMain =new Fl_Group(5, 60, 790, 495, _tr("Main"));
  185. tabMain->color(246);
  186. tabMain->labelsize(16);
  187. { db_products_reference_code =new Fl_Input(115, 70, 165, 25, _tr("Reference"));
  188. db_products_reference_code->labelsize(16);
  189. db_products_reference_code->textsize(16);
  190. add_input_field_to_map("products", "reference_code", db_products_reference_code);
  191. } // Fl_Input* db_products_reference_code
  192. { db_products_supplier_code =new Fl_Input(380, 70, 165, 25, _tr("Ref. Supp."));
  193. db_products_supplier_code->labelsize(16);
  194. db_products_supplier_code->textsize(16);
  195. add_input_field_to_map("products", "supplier_code", db_products_supplier_code);
  196. } // Fl_Input* db_products_supplier_code
  197. { db_products_bar_code =new Fl_Input(620, 70, 165, 25, _tr("Barcode"));
  198. db_products_bar_code->labelsize(16);
  199. db_products_bar_code->textsize(16);
  200. add_input_field_to_map("products", "bar_code", db_products_bar_code);
  201. } // Fl_Input* db_products_bar_code
  202. { db_products_sell_description =new Fl_Input(115, 100, 670, 25, _tr("Description"));
  203. db_products_sell_description->labelsize(16);
  204. db_products_sell_description->textsize(16);
  205. add_input_field_to_map("products", "sell_description", db_products_sell_description);
  206. } // Fl_Input* db_products_sell_description
  207. { db_products_buy_description =new Fl_Input(115, 130, 670, 25, _tr("Desc. Supp."));
  208. db_products_buy_description->labelsize(16);
  209. db_products_buy_description->textsize(16);
  210. add_input_field_to_map("products", "buy_description", db_products_buy_description);
  211. } // Fl_Input* db_products_buy_description
  212. { db_products_sell_price =new Fl_Float_Input_Fmt(115, 160, 110, 25, _tr("Sales Price"));
  213. db_products_sell_price->type(1);
  214. db_products_sell_price->box(FL_DOWN_BOX);
  215. db_products_sell_price->color(FL_BACKGROUND2_COLOR);
  216. db_products_sell_price->selection_color(FL_SELECTION_COLOR);
  217. db_products_sell_price->labeltype(FL_NORMAL_LABEL);
  218. db_products_sell_price->labelfont(0);
  219. db_products_sell_price->labelsize(16);
  220. db_products_sell_price->labelcolor(FL_FOREGROUND_COLOR);
  221. db_products_sell_price->textsize(16);
  222. db_products_sell_price->align((FL_ALIGN_LEFT));
  223. db_products_sell_price->when(FL_WHEN_RELEASE);
  224. add_input_field_to_map("products", "sell_price", db_products_sell_price);
  225. } // Fl_Float_Input_Fmt* db_products_sell_price
  226. { db_products_measure_unit_id =new Fl_Choice_Int(370, 160, 110, 25, _tr("Measure Unit"));
  227. db_products_measure_unit_id->box(FL_FLAT_BOX);
  228. db_products_measure_unit_id->down_box(FL_BORDER_BOX);
  229. db_products_measure_unit_id->color(FL_BACKGROUND_COLOR);
  230. db_products_measure_unit_id->selection_color(FL_SELECTION_COLOR);
  231. db_products_measure_unit_id->labeltype(FL_NORMAL_LABEL);
  232. db_products_measure_unit_id->labelfont(0);
  233. db_products_measure_unit_id->labelsize(16);
  234. db_products_measure_unit_id->labelcolor(FL_FOREGROUND_COLOR);
  235. db_products_measure_unit_id->textsize(16);
  236. db_products_measure_unit_id->align((FL_ALIGN_LEFT));
  237. db_products_measure_unit_id->when(FL_WHEN_RELEASE);
  238. add_input_field_to_map("products", "measure_unit_id", db_products_measure_unit_id);
  239. } // Fl_Choice_Int* db_products_measure_unit_id
  240. { db_products_sales_tax_id =new Fl_Choice_Int(115, 190, 110, 25, _tr("V.A.T."));
  241. db_products_sales_tax_id->box(FL_FLAT_BOX);
  242. db_products_sales_tax_id->down_box(FL_BORDER_BOX);
  243. db_products_sales_tax_id->color(FL_BACKGROUND_COLOR);
  244. db_products_sales_tax_id->selection_color(FL_SELECTION_COLOR);
  245. db_products_sales_tax_id->labeltype(FL_NORMAL_LABEL);
  246. db_products_sales_tax_id->labelfont(0);
  247. db_products_sales_tax_id->labelsize(16);
  248. db_products_sales_tax_id->labelcolor(FL_FOREGROUND_COLOR);
  249. db_products_sales_tax_id->textsize(16);
  250. db_products_sales_tax_id->align((FL_ALIGN_LEFT));
  251. db_products_sales_tax_id->when(FL_WHEN_RELEASE);
  252. add_input_field_to_map("products", "sales_tax_id", db_products_sales_tax_id);
  253. } // Fl_Choice_Int* db_products_sales_tax_id
  254. { db_products_warranty_id =new Fl_Choice_Int(370, 190, 110, 25, _tr("Warranty"));
  255. db_products_warranty_id->box(FL_FLAT_BOX);
  256. db_products_warranty_id->down_box(FL_BORDER_BOX);
  257. db_products_warranty_id->color(FL_BACKGROUND_COLOR);
  258. db_products_warranty_id->selection_color(FL_SELECTION_COLOR);
  259. db_products_warranty_id->labeltype(FL_NORMAL_LABEL);
  260. db_products_warranty_id->labelfont(0);
  261. db_products_warranty_id->labelsize(16);
  262. db_products_warranty_id->labelcolor(FL_FOREGROUND_COLOR);
  263. db_products_warranty_id->textsize(16);
  264. db_products_warranty_id->align((FL_ALIGN_LEFT));
  265. db_products_warranty_id->when(FL_WHEN_RELEASE);
  266. add_input_field_to_map("products", "warranty_id", db_products_warranty_id);
  267. } // Fl_Choice_Int* db_products_warranty_id
  268. { local o = db_products_sell_quantity_min =new Fl_Float_Input(370, 250, 110, 25, _tr("Sell Min. Qty."));
  269. db_products_sell_quantity_min->type(1);
  270. db_products_sell_quantity_min->labelsize(16);
  271. db_products_sell_quantity_min->textsize(16);
  272. o->decimal_places(-6);
  273. add_input_field_to_map("products", "sell_quantity_min", db_products_sell_quantity_min);
  274. } // Fl_Float_Input* db_products_sell_quantity_min
  275. { local o = db_products_units_by_package =new Fl_Float_Input(370, 280, 110, 25, _tr("Units by Pack."));
  276. db_products_units_by_package->type(1);
  277. db_products_units_by_package->labelsize(16);
  278. db_products_units_by_package->textsize(16);
  279. o->decimal_places(-6);
  280. add_input_field_to_map("products", "units_by_package", db_products_units_by_package);
  281. } // Fl_Float_Input* db_products_units_by_package
  282. { local o = db_products_weight =new Fl_Float_Input(370, 220, 110, 25, _tr("Weight"));
  283. db_products_weight->type(1);
  284. db_products_weight->labelsize(16);
  285. db_products_weight->textsize(16);
  286. o->decimal_places(-6);
  287. add_input_field_to_map("products", "weight", db_products_weight);
  288. } // Fl_Float_Input* db_products_weight
  289. { db_products_sell_without_stock =new Fl_Check_Button(10, 250, 215, 25, _tr("Sell without stock"));
  290. db_products_sell_without_stock->down_box(FL_DOWN_BOX);
  291. db_products_sell_without_stock->labelsize(16);
  292. add_input_field_to_map("products", "sell_without_stock", db_products_sell_without_stock);
  293. } // Fl_Check_Button* db_products_sell_without_stock
  294. { db_products_is_active =new Fl_Check_Button(10, 280, 110, 25, _tr("Active"));
  295. db_products_is_active->down_box(FL_DOWN_BOX);
  296. db_products_is_active->labelsize(16);
  297. add_input_field_to_map("products", "is_active", db_products_is_active);
  298. } // Fl_Check_Button* db_products_is_active
  299. { db_products_show_on_sales =new Fl_Check_Button(10, 310, 105, 25, _tr("Sales"));
  300. db_products_show_on_sales->down_box(FL_DOWN_BOX);
  301. db_products_show_on_sales->labelsize(16);
  302. add_input_field_to_map("products", "show_on_sales", db_products_show_on_sales);
  303. } // Fl_Check_Button* db_products_show_on_sales
  304. { db_products_show_on_buys =new Fl_Check_Button(10, 340, 95, 25, _tr("Buys"));
  305. db_products_show_on_buys->down_box(FL_DOWN_BOX);
  306. db_products_show_on_buys->labelsize(16);
  307. add_input_field_to_map("products", "show_on_buys", db_products_show_on_buys);
  308. } // Fl_Check_Button* db_products_show_on_buys
  309. { db_products_show_on_web =new Fl_Check_Button(115, 310, 120, 25, _tr("Web"));
  310. db_products_show_on_web->down_box(FL_DOWN_BOX);
  311. db_products_show_on_web->labelsize(16);
  312. add_input_field_to_map("products", "show_on_web", db_products_show_on_web);
  313. } // Fl_Check_Button* db_products_show_on_web
  314. { db_products_show_price_on_web =new Fl_Check_Button(115, 340, 100, 25, _tr("Web price"));
  315. db_products_show_price_on_web->down_box(FL_DOWN_BOX);
  316. db_products_show_price_on_web->labelsize(16);
  317. add_input_field_to_map("products", "show_price_on_web", db_products_show_price_on_web);
  318. } // Fl_Check_Button* db_products_show_price_on_web
  319. { local o =new Fl_Group(675, 402, 110, 143);
  320. { local o =new Fl_Box(675, 402, 110, 68, _tr("Spacer"));
  321. o->labeltype(FL_NO_LABEL);
  322. Fl_Group.current()->resizable(o);
  323. } // Fl_Box* o
  324. { dbAction = new Fl_Button(675, 520, 110, 25);
  325. dbAction->label(_tr("Action"));
  326. dbAction->down_box(FL_BORDER_BOX);
  327. dbAction->labelsize(16);
  328. dbAction->textsize(16);
  329. dbAction->align((FL_ALIGN_TOP));
  330. } // Fl_Choice* dbAction
  331. { btnDbAction = new My_Fl_Return_Button(675, 470, 110, 25, _tr("Action"));
  332. btnDbAction->labelsize(16);
  333. } // Fl_Button* btnDbAction
  334. o->end();
  335. } // Fl_Group* o
  336. { local o =new Fl_Tabs(10, 370, 650, 181);
  337. o->selection_color(4);
  338. o->labelsize(16);
  339. o->labelcolor(FL_BACKGROUND2_COLOR);
  340. { tabNotes =new Fl_Group(10, 400, 650, 150, _tr("Notes"));
  341. tabNotes->labelsize(16);
  342. { db_products_sell_notes =new Fl_Text_Editor_Buffered(10, 400, 650, 150);
  343. db_products_sell_notes->type(4);
  344. db_products_sell_notes->box(FL_DOWN_BOX);
  345. db_products_sell_notes->color(FL_BACKGROUND2_COLOR);
  346. db_products_sell_notes->selection_color(FL_SELECTION_COLOR);
  347. db_products_sell_notes->labeltype(FL_NO_LABEL);
  348. db_products_sell_notes->labelfont(0);
  349. db_products_sell_notes->labelsize(16);
  350. db_products_sell_notes->labelcolor(FL_FOREGROUND_COLOR);
  351. db_products_sell_notes->textsize(16);
  352. db_products_sell_notes->align((FL_ALIGN_TOP_LEFT));
  353. db_products_sell_notes->when(FL_WHEN_RELEASE);
  354. Fl_Group.current()->resizable(db_products_sell_notes);
  355. add_input_field_to_map("products", "sell_notes", db_products_sell_notes);
  356. } // Fl_Text_Editor_Buffered* db_products_sell_notes
  357. tabNotes->end();
  358. } // Fl_Group* tabNotes
  359. { tabNotesSupplier =new Fl_Group(10, 400, 650, 150, _tr("Notes Supplier"));
  360. tabNotesSupplier->labelsize(16);
  361. tabNotesSupplier->hide();
  362. { db_products_buy_notes =new Fl_Text_Editor_Buffered(10, 400, 650, 150);
  363. db_products_buy_notes->type(4);
  364. db_products_buy_notes->box(FL_DOWN_BOX);
  365. db_products_buy_notes->color(FL_BACKGROUND2_COLOR);
  366. db_products_buy_notes->selection_color(FL_SELECTION_COLOR);
  367. db_products_buy_notes->labeltype(FL_NO_LABEL);
  368. db_products_buy_notes->labelfont(0);
  369. db_products_buy_notes->labelsize(16);
  370. db_products_buy_notes->labelcolor(FL_FOREGROUND_COLOR);
  371. db_products_buy_notes->textsize(16);
  372. db_products_buy_notes->align((FL_ALIGN_TOP_LEFT));
  373. db_products_buy_notes->when(FL_WHEN_RELEASE);
  374. Fl_Group.current()->resizable(db_products_buy_notes);
  375. add_input_field_to_map("products", "buy_notes", db_products_buy_notes);
  376. } // Fl_Text_Editor_Buffered* db_products_buy_notes
  377. tabNotesSupplier->end();
  378. } // Fl_Group* tabNotesSupplier
  379. { tabTags =new Fl_Group(10, 400, 650, 150, _tr("Tags"));
  380. tabTags->labelsize(16);
  381. tabTags->hide();
  382. { db_products_tags =new Fl_Text_Editor_Buffered(10, 400, 650, 150);
  383. db_products_tags->type(4);
  384. db_products_tags->box(FL_DOWN_BOX);
  385. db_products_tags->color(FL_BACKGROUND2_COLOR);
  386. db_products_tags->selection_color(FL_SELECTION_COLOR);
  387. db_products_tags->labeltype(FL_NO_LABEL);
  388. db_products_tags->labelfont(0);
  389. db_products_tags->labelsize(16);
  390. db_products_tags->labelcolor(FL_FOREGROUND_COLOR);
  391. db_products_tags->textsize(16);
  392. db_products_tags->align((FL_ALIGN_TOP_LEFT));
  393. db_products_tags->when(FL_WHEN_RELEASE);
  394. Fl_Group.current()->resizable(db_products_tags);
  395. add_input_field_to_map("products", "tags", db_products_tags);
  396. } // Fl_Text_Editor_Buffered* db_products_tags
  397. tabTags->end();
  398. } // Fl_Group* tabTags
  399. { tabGroups =new Fl_Group(10, 395, 650, 156, _tr("Groups"));
  400. tabGroups->hide();
  401. { db_products_group_id = new Flu_Tree_Browser(10, 400, 650, 150);
  402. db_products_group_id->box(FL_DOWN_BOX);
  403. db_products_group_id->color(FL_BACKGROUND2_COLOR);
  404. db_products_group_id->selection_color(FL_SELECTION_COLOR);
  405. db_products_group_id->labeltype(FL_NORMAL_LABEL);
  406. db_products_group_id->labelfont(0);
  407. db_products_group_id->labelsize(16);
  408. db_products_group_id->labelcolor(FL_FOREGROUND_COLOR);
  409. db_products_group_id->align((FL_ALIGN_TOP));
  410. db_products_group_id->when(FL_WHEN_CHANGED);
  411. add_input_field_to_map("products", "group_id", db_products_group_id);
  412. } // Flu_Tree_Browser* db_products_group_id
  413. tabGroups->end();
  414. } // Fl_Group* tabGroups
  415. o->end();
  416. } // Fl_Tabs* o
  417. { btnImage =new Fl_Image_Box(485, 158, 300, 232);
  418. btnImage->box(FL_ENGRAVED_BOX);
  419. btnImage->color(FL_BACKGROUND2_COLOR);
  420. btnImage->selection_color(FL_BACKGROUND_COLOR);
  421. btnImage->labeltype(FL_NORMAL_LABEL);
  422. btnImage->labelfont(0);
  423. btnImage->labelsize(14);
  424. btnImage->labelcolor(FL_FOREGROUND_COLOR);
  425. btnImage->align((FL_ALIGN_CLIP|FL_ALIGN_INSIDE));
  426. btnImage->when(FL_WHEN_RELEASE);
  427. } // Fl_Image_Box* btnImage
  428. { local o =new Fl_Check_Button(370, 375, 102, 25, _tr("Wrap lines"));
  429. o->down_box(FL_DOWN_BOX);
  430. o->value(1);
  431. o->labelsize(16);
  432. o->callback(cb_Wrap);
  433. } // Fl_Check_Button* o
  434. { local o = db_products_quantity_onhand =new Fl_Float_Input(115, 220, 110, 25, _tr("Onhand"));
  435. db_products_quantity_onhand->type(1);
  436. db_products_quantity_onhand->labelsize(16);
  437. db_products_quantity_onhand->textsize(16);
  438. o->decimal_places(-6);
  439. add_input_field_to_map("products", "quantity_onhand", db_products_quantity_onhand);
  440. } // Fl_Float_Input* db_products_quantity_onhand
  441. tabMain->end();
  442. Fl_Group.current()->resizable(tabMain);
  443. } // Fl_Group* tabMain
  444. { tabPrices =new Fl_Group(5, 60, 790, 495, _tr("Prices"));
  445. tabPrices->color(246);
  446. tabPrices->labelsize(16);
  447. tabPrices->hide();
  448. { local o =new Fl_Group(15, 88, 770, 201, _tr("Sales Price"));
  449. o->box(FL_UP_BOX);
  450. o->color(166);
  451. o->labelsize(16);
  452. { db_products_buy_price =new Fl_Float_Input_Fmt(25, 115, 115, 25, _tr("Buy $"));
  453. db_products_buy_price->type(1);
  454. db_products_buy_price->box(FL_DOWN_BOX);
  455. db_products_buy_price->color(FL_BACKGROUND2_COLOR);
  456. db_products_buy_price->selection_color(FL_SELECTION_COLOR);
  457. db_products_buy_price->labeltype(FL_NORMAL_LABEL);
  458. db_products_buy_price->labelfont(0);
  459. db_products_buy_price->labelsize(16);
  460. db_products_buy_price->labelcolor(FL_FOREGROUND_COLOR);
  461. db_products_buy_price->textsize(16);
  462. db_products_buy_price->align((FL_ALIGN_TOP_LEFT));
  463. db_products_buy_price->when(FL_WHEN_RELEASE);
  464. add_input_field_to_map("products", "buy_price", db_products_buy_price);
  465. } // Fl_Float_Input_Fmt* db_products_buy_price
  466. { local o = db_products_buy_discount =new Fl_Float_Input_Fmt(151, 115, 115, 25, _tr("Buy Disc. %"));
  467. db_products_buy_discount->type(1);
  468. db_products_buy_discount->box(FL_DOWN_BOX);
  469. db_products_buy_discount->color(FL_BACKGROUND2_COLOR);
  470. db_products_buy_discount->selection_color(FL_SELECTION_COLOR);
  471. db_products_buy_discount->labeltype(FL_NORMAL_LABEL);
  472. db_products_buy_discount->labelfont(0);
  473. db_products_buy_discount->labelsize(16);
  474. db_products_buy_discount->labelcolor(FL_FOREGROUND_COLOR);
  475. db_products_buy_discount->textsize(16);
  476. db_products_buy_discount->align((FL_ALIGN_TOP_LEFT));
  477. db_products_buy_discount->when(FL_WHEN_RELEASE);
  478. add_input_field_to_map("products", "buy_discount", db_products_buy_discount);
  479. o->decimal_places(-6);
  480. } // Fl_Float_Input_Fmt* db_products_buy_discount
  481. { db_products_buy_other_costs =new Fl_Float_Input_Fmt(278, 115, 115, 25, _tr("Other Costs $"));
  482. db_products_buy_other_costs->type(1);
  483. db_products_buy_other_costs->box(FL_DOWN_BOX);
  484. db_products_buy_other_costs->color(FL_BACKGROUND2_COLOR);
  485. db_products_buy_other_costs->selection_color(FL_SELECTION_COLOR);
  486. db_products_buy_other_costs->labeltype(FL_NORMAL_LABEL);
  487. db_products_buy_other_costs->labelfont(0);
  488. db_products_buy_other_costs->labelsize(16);
  489. db_products_buy_other_costs->labelcolor(FL_FOREGROUND_COLOR);
  490. db_products_buy_other_costs->textsize(16);
  491. db_products_buy_other_costs->align((FL_ALIGN_TOP_LEFT));
  492. db_products_buy_other_costs->when(FL_WHEN_RELEASE);
  493. add_input_field_to_map("products", "buy_other_costs", db_products_buy_other_costs);
  494. } // Fl_Float_Input_Fmt* db_products_buy_other_costs
  495. { local o = db_products_sell_markup =new Fl_Float_Input_Fmt(404, 115, 115, 25, _tr("Markup %"));
  496. db_products_sell_markup->type(1);
  497. db_products_sell_markup->box(FL_DOWN_BOX);
  498. db_products_sell_markup->color(FL_BACKGROUND2_COLOR);
  499. db_products_sell_markup->selection_color(FL_SELECTION_COLOR);
  500. db_products_sell_markup->labeltype(FL_NORMAL_LABEL);
  501. db_products_sell_markup->labelfont(0);
  502. db_products_sell_markup->labelsize(16);
  503. db_products_sell_markup->labelcolor(FL_FOREGROUND_COLOR);
  504. db_products_sell_markup->textsize(16);
  505. db_products_sell_markup->align((FL_ALIGN_TOP_LEFT));
  506. db_products_sell_markup->when(FL_WHEN_RELEASE);
  507. add_input_field_to_map("products", "sell_markup", db_products_sell_markup);
  508. //o->decimal_places(-6);
  509. } // Fl_Float_Input_Fmt* db_products_sell_markup
  510. { local o = markup_to_discount =new Fl_Float_Input_Fmt(531, 115, 115, 25, _tr("Margin %"));
  511. markup_to_discount->type(1);
  512. markup_to_discount->box(FL_DOWN_BOX);
  513. markup_to_discount->color(FL_BACKGROUND2_COLOR);
  514. markup_to_discount->selection_color(FL_SELECTION_COLOR);
  515. markup_to_discount->labeltype(FL_NORMAL_LABEL);
  516. markup_to_discount->labelfont(0);
  517. markup_to_discount->labelsize(16);
  518. markup_to_discount->labelcolor(FL_FOREGROUND_COLOR);
  519. markup_to_discount->textsize(16);
  520. markup_to_discount->align((FL_ALIGN_TOP_LEFT));
  521. markup_to_discount->when(FL_WHEN_RELEASE);
  522. //o->decimal_places(-6);
  523. } // Fl_Float_Input_Fmt* markup_to_discount
  524. { db_products_sell_price_ro =new Fl_Float_Input_Fmt(658, 115, 115, 25, _tr("Sales $"));
  525. db_products_sell_price_ro->type(1);
  526. db_products_sell_price_ro->box(FL_DOWN_BOX);
  527. db_products_sell_price_ro->color(FL_BACKGROUND2_COLOR);
  528. db_products_sell_price_ro->selection_color(FL_SELECTION_COLOR);
  529. db_products_sell_price_ro->labeltype(FL_NORMAL_LABEL);
  530. db_products_sell_price_ro->labelfont(0);
  531. db_products_sell_price_ro->labelsize(16);
  532. db_products_sell_price_ro->labelcolor(FL_FOREGROUND_COLOR);
  533. db_products_sell_price_ro->textsize(16);
  534. db_products_sell_price_ro->align((FL_ALIGN_TOP_LEFT));
  535. db_products_sell_price_ro->when(FL_WHEN_RELEASE);
  536. } // Fl_Float_Input_Fmt* db_products_sell_price_ro
  537. { local o = db_products_price_decimals =new Fl_Int_Input(530, 150, 30, 25, _tr("Decimals for calculation"));
  538. db_products_price_decimals->type(2);
  539. db_products_price_decimals->labelfont(1);
  540. db_products_price_decimals->labelsize(16);
  541. db_products_price_decimals->textfont(1);
  542. db_products_price_decimals->textsize(16);
  543. add_input_field_to_map("products", "price_decimals", db_products_price_decimals);
  544. //o->decimal_places(-6);
  545. } // Fl_Int_Input* db_products_price_decimals
  546. { btnSaveProrduct =new Fl_Button(662, 150, 111, 25, _tr("Save"));
  547. btnSaveProrduct->labelsize(16);
  548. } // Fl_Button* btnSaveProrduct
  549. { local o = db_products_stock_min =new Fl_Float_Input(665, 195, 110, 25, _tr("Stock Min."));
  550. db_products_stock_min->type(1);
  551. db_products_stock_min->labelsize(16);
  552. db_products_stock_min->textsize(16);
  553. add_input_field_to_map("products", "stock_min", db_products_stock_min);
  554. o->decimal_places(-6);
  555. } // Fl_Float_Input* db_products_stock_min
  556. { local o = db_products_stock_max =new Fl_Float_Input(665, 225, 110, 25, _tr("Stock Max."));
  557. db_products_stock_max->type(1);
  558. db_products_stock_max->labelsize(16);
  559. db_products_stock_max->textsize(16);
  560. add_input_field_to_map("products", "stock_max", db_products_stock_max);
  561. o->decimal_places(-6);
  562. } // Fl_Float_Input* db_products_stock_max
  563. { local o = db_products_buy_quantity_min =new Fl_Float_Input(665, 255, 110, 25, _tr("Buy Min. Qty."));
  564. db_products_buy_quantity_min->type(1);
  565. db_products_buy_quantity_min->labelsize(16);
  566. db_products_buy_quantity_min->textsize(16);
  567. add_input_field_to_map("products", "buy_quantity_min", db_products_buy_quantity_min);
  568. o->decimal_places(-6);
  569. } // Fl_Float_Input* db_products_buy_quantity_min
  570. { db_products_price_formula =new Fl_Input(25, 197, 495, 83, _tr("Price formula"));
  571. db_products_price_formula->type(4);
  572. db_products_price_formula->labelsize(16);
  573. db_products_price_formula->textsize(16);
  574. db_products_price_formula->align((FL_ALIGN_TOP_LEFT));
  575. add_input_field_to_map("products", "price_formula", db_products_price_formula);
  576. } // Fl_Input* db_products_price_formula
  577. { db_products_price_date =new Fl_Output(25, 150, 130, 25, _tr("Last Update"));
  578. db_products_price_date->labelsize(16);
  579. db_products_price_date->textsize(16);
  580. db_products_price_date->align((FL_ALIGN_RIGHT));
  581. } // Fl_Output* db_products_price_date
  582. o->end();
  583. } // Fl_Group* o
  584. { local o =new Fl_Box(15, 290, 770, 40, _tr("Spacer"));
  585. o->labeltype(FL_NO_LABEL);
  586. Fl_Group.current()->resizable(o);
  587. } // Fl_Box* o
  588. { productPrices =new Fl_Group(15, 332, 770, 212);
  589. productPrices->box(FL_UP_BOX);
  590. productPrices->color(166);
  591. productPrices->labeltype(FL_NO_LABEL);
  592. productPrices->labelsize(16);
  593. productPrices->end();
  594. } // Fl_Group* productPrices
  595. tabPrices->end();
  596. } // Fl_Group* tabPrices
  597. { tabKit =new Fl_Group(5, 59, 790, 495, _tr("Kit"));
  598. tabKit->color(246);
  599. tabKit->labelsize(16);
  600. tabKit->hide();
  601. tabKit->end();
  602. } // Fl_Group* tabKit
  603. { tabChartStatistics =new Fl_Group(5, 60, 790, 495, _tr("Statistics"));
  604. tabChartStatistics->color(246);
  605. tabChartStatistics->labelsize(16);
  606. tabChartStatistics->hide();
  607. tabChartStatistics->end();
  608. } // Fl_Group* tabChartStatistics
  609. { tabHistory =new Fl_Group(5, 60, 790, 495, _tr("History"));
  610. tabHistory->color(246);
  611. tabHistory->labelsize(16);
  612. tabHistory->hide();
  613. tabHistory->end();
  614. } // Fl_Group* tabHistory
  615. { tabReports =new Fl_Group(5, 60, 790, 495, _tr("Reports"));
  616. tabReports->box(FL_UP_BOX);
  617. tabReports->color(246);
  618. tabReports->labelsize(16);
  619. tabReports->hide();
  620. { grpExportImport =new Fl_Group(15, 465, 770, 80, _tr("Export / Import"));
  621. grpExportImport->box(FL_ENGRAVED_FRAME);
  622. grpExportImport->labelsize(16);
  623. { btnProductsExport =new Fl_Button(25, 475, 175, 25, _tr("Products Export"));
  624. btnProductsExport->labelsize(16);
  625. } // Fl_Button* btnProductsExport
  626. { btnProductsImport =new Fl_Button(25, 510, 175, 25, _tr("Products Import"));
  627. btnProductsImport->labelsize(16);
  628. } // Fl_Button* btnProductsImport
  629. { chkWithoutPrices =new Fl_Check_Button(225, 480, 150, 25, _tr("Withouth Prices"));
  630. chkWithoutPrices->down_box(FL_DOWN_BOX);
  631. chkWithoutPrices->labelsize(16);
  632. } // Fl_Check_Button* chkWithoutPrices
  633. { chkWebOnly =new Fl_Check_Button(225, 510, 150, 25, _tr("WEB Only"));
  634. chkWebOnly->down_box(FL_DOWN_BOX);
  635. chkWebOnly->labelsize(16);
  636. } // Fl_Check_Button* chkWebOnly
  637. { boxExportImportCount =new Fl_Box(405, 499, 42, 25, _tr("0"));
  638. boxExportImportCount->labelsize(16);
  639. } // Fl_Box* boxExportImportCount
  640. { btnProductGroupsExport =new Fl_Button(555, 475, 220, 25, _tr("Product Groups Export"));
  641. btnProductGroupsExport->labelsize(16);
  642. } // Fl_Button* btnProductGroupsExport
  643. { btnProductGroupsImport =new Fl_Button(555, 510, 220, 25, _tr("Product Groups import"));
  644. btnProductGroupsImport->labelsize(16);
  645. } // Fl_Button* btnProductGroupsImport
  646. grpExportImport->end();
  647. } // Fl_Group* grpExportImport
  648. { btnUpdateWeb =new Fl_Button(610, 70, 175, 25, _tr("Update WEB"));
  649. btnUpdateWeb->labelsize(16);
  650. } // Fl_Button* btnUpdateWeb
  651. { grpPrintPriceList =new Fl_Group(10, 85, 195, 165, _tr("Price List"));
  652. grpPrintPriceList->box(FL_ENGRAVED_FRAME);
  653. grpPrintPriceList->labelsize(16);
  654. { chkPriceListWithVAT =new Fl_Check_Button(20, 95, 175, 25, _tr("With V.A.T."));
  655. chkPriceListWithVAT->down_box(FL_DOWN_BOX);
  656. chkPriceListWithVAT->labelsize(16);
  657. } // Fl_Check_Button* chkPriceListWithVAT
  658. { chkPriceListSellOnWeb =new Fl_Check_Button(20, 125, 170, 25, _tr("Sell on WEB"));
  659. chkPriceListSellOnWeb->down_box(FL_DOWN_BOX);
  660. chkPriceListSellOnWeb->labelsize(16);
  661. } // Fl_Check_Button* chkPriceListSellOnWeb
  662. { btnPrintPriceList =new Fl_Button(20, 215, 175, 25, _tr("Print"));
  663. btnPrintPriceList->labelsize(16);
  664. } // Fl_Button* btnPrintPriceList
  665. { chkPriceListSellSales =new Fl_Check_Button(20, 155, 175, 25, _tr("Sales"));
  666. chkPriceListSellSales->down_box(FL_DOWN_BOX);
  667. chkPriceListSellSales->labelsize(16);
  668. } // Fl_Check_Button* chkPriceListSellSales
  669. { chkPriceListSellPDF =new Fl_Check_Button(20, 185, 175, 25, _tr("PDF"));
  670. chkPriceListSellPDF->down_box(FL_DOWN_BOX);
  671. chkPriceListSellPDF->labelsize(16);
  672. } // Fl_Check_Button* chkPriceListSellPDF
  673. grpPrintPriceList->end();
  674. } // Fl_Group* grpPrintPriceList
  675. tabReports->end();
  676. } // Fl_Group* tabReports
  677. { tabTotals =new Fl_Group(5, 60, 790, 495, _tr("Totals"));
  678. tabTotals->color(246);
  679. tabTotals->labelsize(16);
  680. tabTotals->hide();
  681. { local o = db_products_quantity_quoted_sales =new Fl_Float_Input(220, 80, 110, 25, _tr("Quantity quoted sales"));
  682. db_products_quantity_quoted_sales->type(1);
  683. db_products_quantity_quoted_sales->labelsize(16);
  684. db_products_quantity_quoted_sales->textsize(16);
  685. o->decimal_places(-6);
  686. add_input_field_to_map("products", "quantity_quoted_sales", db_products_quantity_quoted_sales);
  687. } // Fl_Float_Input* db_products_quantity_quoted_sales
  688. { local o = db_products_quantity_ordered_sales =new Fl_Float_Input(220, 115, 110, 25, _tr("Quantity ordered sales"));
  689. db_products_quantity_ordered_sales->type(1);
  690. db_products_quantity_ordered_sales->labelsize(16);
  691. db_products_quantity_ordered_sales->textsize(16);
  692. o->decimal_places(-6);
  693. add_input_field_to_map("products", "quantity_ordered_sales", db_products_quantity_ordered_sales);
  694. } // Fl_Float_Input* db_products_quantity_ordered_sales
  695. { local o = db_products_quantity_delivered =new Fl_Float_Input(220, 150, 110, 25, _tr("Quantity delivered"));
  696. db_products_quantity_delivered->type(1);
  697. db_products_quantity_delivered->labelsize(16);
  698. db_products_quantity_delivered->textsize(16);
  699. o->decimal_places(-6);
  700. add_input_field_to_map("products", "quantity_delivered", db_products_quantity_delivered);
  701. } // Fl_Float_Input* db_products_quantity_delivered
  702. { local o = db_products_quantity_invoiced_sales =new Fl_Float_Input(220, 185, 110, 25, _tr("Quantity invoiced sales"));
  703. db_products_quantity_invoiced_sales->type(1);
  704. db_products_quantity_invoiced_sales->labelsize(16);
  705. db_products_quantity_invoiced_sales->textsize(16);
  706. o->decimal_places(-6);
  707. add_input_field_to_map("products", "quantity_invoiced_sales", db_products_quantity_invoiced_sales);
  708. } // Fl_Float_Input* db_products_quantity_invoiced_sales
  709. { local o = db_products_quantity_lost =new Fl_Float_Input(220, 220, 110, 25, _tr("Quantity lost"));
  710. db_products_quantity_lost->type(1);
  711. db_products_quantity_lost->labelsize(16);
  712. db_products_quantity_lost->textsize(16);
  713. o->decimal_places(-6);
  714. add_input_field_to_map("products", "quantity_lost", db_products_quantity_lost);
  715. } // Fl_Float_Input* db_products_quantity_lost
  716. { local o = db_products_quantity_quoted_buys =new Fl_Float_Input(665, 85, 110, 25, _tr("Quantity quoted buys"));
  717. db_products_quantity_quoted_buys->type(1);
  718. db_products_quantity_quoted_buys->labelsize(16);
  719. db_products_quantity_quoted_buys->textsize(16);
  720. o->decimal_places(-6);
  721. add_input_field_to_map("products", "quantity_quoted_buys", db_products_quantity_quoted_buys);
  722. } // Fl_Float_Input* db_products_quantity_quoted_buys
  723. { local o = db_products_quantity_ordered_buys =new Fl_Float_Input(665, 120, 110, 25, _tr("Quantity ordered buys"));
  724. db_products_quantity_ordered_buys->type(1);
  725. db_products_quantity_ordered_buys->labelsize(16);
  726. db_products_quantity_ordered_buys->textsize(16);
  727. o->decimal_places(-6);
  728. add_input_field_to_map("products", "quantity_ordered_buys", db_products_quantity_ordered_buys);
  729. } // Fl_Float_Input* db_products_quantity_ordered_buys
  730. { local o = db_products_quantity_received =new Fl_Float_Input(665, 155, 110, 25, _tr("Quantity received"));
  731. db_products_quantity_received->type(1);
  732. db_products_quantity_received->labelsize(16);
  733. db_products_quantity_received->textsize(16);
  734. o->decimal_places(-6);
  735. add_input_field_to_map("products", "quantity_received", db_products_quantity_received);
  736. } // Fl_Float_Input* db_products_quantity_received
  737. { local o = db_products_quantity_invoiced_buys =new Fl_Float_Input(665, 190, 110, 25, _tr("Quantity invoiced buys"));
  738. db_products_quantity_invoiced_buys->type(1);
  739. db_products_quantity_invoiced_buys->labelsize(16);
  740. db_products_quantity_invoiced_buys->textsize(16);
  741. o->decimal_places(-6);
  742. add_input_field_to_map("products", "quantity_invoiced_buys", db_products_quantity_invoiced_buys);
  743. } // Fl_Float_Input* db_products_quantity_invoiced_buys
  744. tabTotals->end();
  745. } // Fl_Group* tabTotals
  746. tabs->end();
  747. Fl_Group.current()->resizable(tabs);
  748. } // Fl_Tabs* tabs
  749. end();
  750. }
  751. function cb_Wrap(){}
  752. function cb_btnSearch(){}
  753. function cb_btnSelect(){}
  754. function cb_btnUpdate(){}
  755. function cb_btnInsert(){}
  756. }
  757. //local win = new MainWindow(10, 50, 330, 320, "OURBIZ");
  758. local win = new BaseReportA4();
  759. win->resizable(win);
  760. win->show_main();
  761. math.number_format_set_dec_point(",");
  762. math.number_format_set_thousand_sep(".");
  763. Fl_Input.default_number_format("\0x02,.");
  764. //Fl:scheme("plastic");
  765. Fl.scheme("gtk+");
  766. //use partial match to find verdana font
  767. Fl.visual(FL_RGB);
  768. //allow arrow keys navigation
  769. Fl.option(Fl.OPTION_ARROW_FOCUS, true);
  770. Fl.run();